Explorar o código

init secrets via /dev/random

/ # nc postsrsd 10001
get fabianpeter@test.local
500 No secrets in SRS configuration.
Fabian Peter Hammerle %!s(int64=4) %!d(string=hai) anos
pai
achega
aef5490ac8
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      Dockerfile

+ 5 - 1
Dockerfile

@@ -19,4 +19,8 @@ EXPOSE 10001/tcp
 EXPOSE 10002/tcp
 
 # > Cannot open file with secret: /etc/postsrsd/secrets/list
-CMD touch "$SRS_SECRET" && postsrsd -l0.0.0.0 -e
+CMD set -x; \
+    if [ ! -f "$SRS_SECRET" ]; \
+        then tr -dc '1-9a-zA-Z' < /dev/random | head -c 32 > "$SRS_SECRET"; \
+    fi \
+    && postsrsd -l0.0.0.0 -e