forked from CGM_Public/pretix_original
Do not create world-readable secret file by default
This commit is contained in:
@@ -35,6 +35,8 @@ else:
|
|||||||
chars = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
|
chars = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
|
||||||
SECRET_KEY = get_random_string(50, chars)
|
SECRET_KEY = get_random_string(50, chars)
|
||||||
with open(SECRET_FILE, 'w') as f:
|
with open(SECRET_FILE, 'w') as f:
|
||||||
|
os.chmod(SECRET_FILE, 0o600)
|
||||||
|
os.chown(SECRET_FILE, os.getuid(), os.getgid())
|
||||||
f.write(SECRET_KEY)
|
f.write(SECRET_KEY)
|
||||||
|
|
||||||
# Adjustable settings
|
# Adjustable settings
|
||||||
|
|||||||
Reference in New Issue
Block a user