Browse Source

init secrets via /dev/random

/ # nc postsrsd 10001
get fabianpeter@test.local
500 No secrets in SRS configuration.
Fabian Peter Hammerle 4 năm trước cách đây
mục cha
commit
a4a3373104
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  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