Просмотр исходного кода

compensate for configuration file changes; have make.bash generate a docker compatible config file automatically

Michael Goldberger 9 лет назад
Родитель
Сommit
228587b539
3 измененных файлов с 19 добавлено и 5 удалено
  1. 2 1
      Server/.gitignore
  2. 2 2
      Server/Dockerfile
  3. 15 2
      Server/make.bash

+ 2 - 1
Server/.gitignore

@@ -1,4 +1,5 @@
 Server
 psiphond
 psiphond.config
-serverEntry.dat
+psiphond-traffic-rules.config
+server-entry.dat

+ 2 - 2
Server/Dockerfile

@@ -10,8 +10,8 @@ RUN apk add --update \
 
 RUN mkdir -p /opt/psiphon
 
-ADD ["psiphond", "psiphond.config", "/opt/psiphon/"]
+ADD ["psiphond", "psiphond.config", "psiphond-traffic-rules.config", "/opt/psiphon/"]
 
 WORKDIR /opt/psiphon
 
-ENTRYPOINT ["./psiphond", "--config", "psiphond.config", "run"]
+ENTRYPOINT ["./psiphond", "run"]

+ 15 - 2
Server/make.bash

@@ -23,9 +23,22 @@ build_for_linux () {
     echo "...'go build' failed, exiting"
     exit $?
   fi
-  chmod 777 psiphond
+  chmod 555 psiphond
+
+  if [ "$1" == "generate" ]; then
+    ./psiphond --ipaddress 0.0.0.0 --protocol SSH:22 --protocol OSSH:53 --web 80 generate
+    # Temporary:
+    #  - Disable syslog integration until final strategy is chosen
+    #  - Disable Fail2Ban integration until final strategy is chosen
+    sed -i 's/"SyslogFacility": "user"/"SyslogFacility": ""/' psiphond.config
+    sed -i 's/"Fail2BanFormat": "Authentication failure for psiphon-client from %s"/"Fail2BanFormat": ""/' psiphond.config
+
+    chmod 666 psiphond.config
+    chmod 666 psiphond-traffic-rules.config
+    chmod 666 server-entry.dat
+  fi
 
 }
 
-build_for_linux
+build_for_linux generate
 echo "Done"