From 30c54d023b57926e9311da79a51f32f54a549809 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 4 Nov 2024 17:07:56 -0800 Subject: [PATCH] settings: Write fewer values into template settings files. This makes it easier for us to change the default values for these settings, and also just helps keep settings files clear of values that the relevant organization didn't choose themselves. There's about a dozen more settings that could receive similar treatment; I just went with the easiest ones. --- zproject/default_settings.py | 3 +++ zproject/prod_settings_template.py | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/zproject/default_settings.py b/zproject/default_settings.py index 6b62e88541..0747603ba1 100644 --- a/zproject/default_settings.py +++ b/zproject/default_settings.py @@ -222,6 +222,9 @@ AVATAR_CHANGES_DISABLED = False PASSWORD_MIN_LENGTH = 6 PASSWORD_MIN_GUESSES = 10000 +SESSION_EXPIRE_AT_BROWSER_CLOSE = False +SESSION_COOKIE_AGE = 60 * 60 * 24 * 7 * 2 # 2 weeks + ZULIP_SERVICES_URL = "https://push.zulipchat.com" ZULIP_SERVICE_PUSH_NOTIFICATIONS = False diff --git a/zproject/prod_settings_template.py b/zproject/prod_settings_template.py index 2cd819e086..dfb151452c 100644 --- a/zproject/prod_settings_template.py +++ b/zproject/prod_settings_template.py @@ -763,10 +763,10 @@ SOCIAL_AUTH_SAML_SUPPORT_CONTACT = { # PROMOTE_SPONSORING_ZULIP = True ## Controls whether session cookies expire when the browser closes -SESSION_EXPIRE_AT_BROWSER_CLOSE = False +# SESSION_EXPIRE_AT_BROWSER_CLOSE = False ## Session cookie expiry in seconds after the last page load -SESSION_COOKIE_AGE = 60 * 60 * 24 * 7 * 2 # 2 weeks +# SESSION_COOKIE_AGE = 60 * 60 * 24 * 7 * 2 # 2 weeks ## Password strength requirements; learn about configuration at ## https://zulip.readthedocs.io/en/latest/production/security-model.html. @@ -778,7 +778,7 @@ SESSION_COOKIE_AGE = 60 * 60 * 24 * 7 * 2 # 2 weeks ## Controls whether or not Zulip will parse links starting with ## "file:///" as a hyperlink (useful if you have e.g. an NFS share). -ENABLE_FILE_LINKS = False +# ENABLE_FILE_LINKS = False ## By default, files uploaded by users and profile pictures are stored ## directly on the Zulip server. You can configure files being instead @@ -804,21 +804,21 @@ LOCAL_UPLOADS_DIR = "/home/zulip/uploads" ## Maximum allowed size of uploaded files, in megabytes. Set ## MAX_FILE_UPLOAD_SIZE to 0 to disable file uploads completely ## (including hiding upload-related options from UI). -MAX_FILE_UPLOAD_SIZE = 100 +# MAX_FILE_UPLOAD_SIZE = 100 ## Controls whether name changes are completely disabled for this ## installation. This is useful when you're syncing names from an ## integrated LDAP/Active Directory. -NAME_CHANGES_DISABLED = False +# NAME_CHANGES_DISABLED = False ## Controls whether avatar changes are completely disabled for this ## installation. This is useful when you're syncing avatars from an ## integrated LDAP/Active Directory. -AVATAR_CHANGES_DISABLED = False +# AVATAR_CHANGES_DISABLED = False ## Controls whether users who have not uploaded an avatar will receive an avatar ## from gravatar.com. -ENABLE_GRAVATAR = True +# ENABLE_GRAVATAR = True ## To override the default avatar image if ENABLE_GRAVATAR is False, place your ## custom default avatar image at /home/zulip/local-static/default-avatar.png