mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
settings: Use get_secret for altcha_hmac.
When building tarballs, we do not have development secrets.
This commit is contained in:
committed by
Tim Abbott
parent
8af90294d8
commit
74675fae94
@@ -1269,7 +1269,7 @@ def create_realm(request: HttpRequest, creation_key: str | None = None) -> HttpR
|
|||||||
# When settings.OPEN_REALM_CREATION is enabled, anyone can create a new realm,
|
# When settings.OPEN_REALM_CREATION is enabled, anyone can create a new realm,
|
||||||
# with a few restrictions on their email address.
|
# with a few restrictions on their email address.
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
if settings.USING_CAPTCHA:
|
if settings.USING_CAPTCHA and settings.ALTCHA_HMAC_KEY:
|
||||||
form: RealmCreationForm = CaptchaRealmCreationForm(data=request.POST, request=request)
|
form: RealmCreationForm = CaptchaRealmCreationForm(data=request.POST, request=request)
|
||||||
else:
|
else:
|
||||||
form = RealmCreationForm(request.POST)
|
form = RealmCreationForm(request.POST)
|
||||||
@@ -1343,7 +1343,7 @@ def create_realm(request: HttpRequest, creation_key: str | None = None) -> HttpR
|
|||||||
initial_data = {
|
initial_data = {
|
||||||
"realm_default_language": default_language_code,
|
"realm_default_language": default_language_code,
|
||||||
}
|
}
|
||||||
if settings.USING_CAPTCHA:
|
if settings.USING_CAPTCHA and settings.ALTCHA_HMAC_KEY:
|
||||||
form = CaptchaRealmCreationForm(request=request, initial=initial_data)
|
form = CaptchaRealmCreationForm(request=request, initial=initial_data)
|
||||||
else:
|
else:
|
||||||
form = RealmCreationForm(initial=initial_data)
|
form = RealmCreationForm(initial=initial_data)
|
||||||
|
@@ -469,7 +469,7 @@ else:
|
|||||||
TOR_EXIT_NODE_FILE_PATH = "/var/lib/zulip/tor-exit-nodes.json"
|
TOR_EXIT_NODE_FILE_PATH = "/var/lib/zulip/tor-exit-nodes.json"
|
||||||
|
|
||||||
if USING_CAPTCHA:
|
if USING_CAPTCHA:
|
||||||
ALTCHA_HMAC_KEY = get_mandatory_secret("altcha_hmac")
|
ALTCHA_HMAC_KEY = get_secret("altcha_hmac")
|
||||||
else:
|
else:
|
||||||
ALTCHA_HMAC_KEY = ""
|
ALTCHA_HMAC_KEY = ""
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user