forked from CGM_Public/pretix_original
Allow to set fallback secret keys (#4482)
This commit is contained in:
@@ -294,6 +294,10 @@ Example::
|
|||||||
setting is not provided, pretix will generate a random secret on the first start
|
setting is not provided, pretix will generate a random secret on the first start
|
||||||
and will store it in the filesystem for later usage.
|
and will store it in the filesystem for later usage.
|
||||||
|
|
||||||
|
``secret_fallback0`` ... ``secret_fallback9``
|
||||||
|
Prior versions of the secret to be used by Django for signing and verification purposes that will still
|
||||||
|
be accepted but no longer be used for new signing.
|
||||||
|
|
||||||
``debug``
|
``debug``
|
||||||
Whether or not to run in debug mode. Default is ``False``.
|
Whether or not to run in debug mode. Default is ``False``.
|
||||||
|
|
||||||
|
|||||||
@@ -94,6 +94,13 @@ else:
|
|||||||
pass # os.chown is not available on Windows
|
pass # os.chown is not available on Windows
|
||||||
f.write(SECRET_KEY)
|
f.write(SECRET_KEY)
|
||||||
|
|
||||||
|
|
||||||
|
SECRET_KEY_FALLBACKS = []
|
||||||
|
for i in range(10):
|
||||||
|
if config.has_option('django', f'secret_fallback{i}'):
|
||||||
|
SECRET_KEY_FALLBACKS.append(config.get('django', f'secret_fallback{i}'))
|
||||||
|
|
||||||
|
|
||||||
# Adjustable settings
|
# Adjustable settings
|
||||||
|
|
||||||
debug_fallback = "runserver" in sys.argv or "runserver_plus" in sys.argv
|
debug_fallback = "runserver" in sys.argv or "runserver_plus" in sys.argv
|
||||||
|
|||||||
Reference in New Issue
Block a user