1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 11:16:47 +00:00

fix(docker): the generated secret key file is private from its creation

The container wrote data/secret_key and made it 600 afterwards; it is
now written under umask 077, as the installer does.
This commit is contained in:
catborise 2026-11-05 18:45:08 +03:00
parent 542cce031e
commit 4cdc31b29a

View file

@ -15,8 +15,8 @@ fi
if [ -z "$SECRET_KEY" ]; then
if [ ! -s "$DATA_DIR/secret_key" ]; then
echo "* Generating fresh random SECRET_KEY..."
"$APP_DIR/venv/bin/python3" -c 'import secrets; print(secrets.token_urlsafe(50))' > "$DATA_DIR/secret_key"
chmod 600 "$DATA_DIR/secret_key"
# created private: not readable by others before a chmod
(umask 077 && "$APP_DIR/venv/bin/python3" -c 'import secrets; print(secrets.token_urlsafe(50))' > "$DATA_DIR/secret_key")
fi
fi