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:
parent
542cce031e
commit
4cdc31b29a
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue