mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
generate_secrets: Enable memcached authentication in production.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
committed by
Tim Abbott
parent
1ba48a04da
commit
97322dd195
@@ -17,6 +17,7 @@ import argparse
|
||||
import uuid
|
||||
import configparser
|
||||
from zerver.lib.utils import generate_random_token
|
||||
from zproject import settings
|
||||
|
||||
os.chdir(os.path.join(os.path.dirname(__file__), '..', '..'))
|
||||
|
||||
@@ -80,6 +81,13 @@ def generate_secrets(development=False):
|
||||
if need_secret('camo_key'):
|
||||
add_secret('camo_key', get_random_string(64))
|
||||
|
||||
if (
|
||||
not development
|
||||
and settings.MEMCACHED_LOCATION == "127.0.0.1:11211"
|
||||
and need_secret("memcached_password")
|
||||
):
|
||||
add_secret("memcached_password", generate_random_token(64))
|
||||
|
||||
# zulip_org_key is generated using os.urandom().
|
||||
# zulip_org_id does not require a secure CPRNG,
|
||||
# it only needs to be unique.
|
||||
|
||||
Reference in New Issue
Block a user