diff --git a/zproject/local_settings.py b/zproject/local_settings.py index c970f200ae..abac6bd77a 100644 --- a/zproject/local_settings.py +++ b/zproject/local_settings.py @@ -36,11 +36,6 @@ NOREPLY_EMAIL_ADDRESS = "noreply@zulip.com" SESSION_SERIALIZER = "django.contrib.sessions.serializers.PickleSerializer" -if DEPLOYED: - EXTERNAL_URI_SCHEME = "https://" -else: - EXTERNAL_URI_SCHEME = "http://" - if TESTING_DEPLOYED: EXTERNAL_HOST = platform.node() elif STAGING_DEPLOYED: @@ -48,8 +43,7 @@ elif STAGING_DEPLOYED: elif DEPLOYED: EXTERNAL_HOST = 'zulip.com' EXTERNAL_API_PATH = 'api.zulip.com' -else: - EXTERNAL_HOST = 'localhost:9991' + # For now, ENTERPRISE is only testing, so write to our test buckets if DEPLOYED and not ENTERPRISE: @@ -89,8 +83,6 @@ if STAGING_DEPLOYED: EMAIL_GATEWAY_PATTERN = "%s@streams.staging.zulip.com" elif DEPLOYED: EMAIL_GATEWAY_PATTERN = "%s@streams.zulip.com" -else: - EMAIL_GATEWAY_PATTERN = "%s@" + EXTERNAL_HOST # Email mirror configuration # The email of the Zulip bot that the email gateway should post as. @@ -99,14 +91,8 @@ EMAIL_GATEWAY_BOT = "emailgateway@zulip.com" SSO_APPEND_DOMAIN = None -if DEPLOYED: - AUTHENTICATION_BACKENDS = ('zproject.backends.EmailAuthBackend', - 'zproject.backends.GoogleMobileOauth2Backend') -else: - ## WARNING: ENABLING DevAuthBackend WILL ENABLE - ## ANYONE TO LOG IN AS ANY USER. - AUTHENTICATION_BACKENDS = ('zproject.backends.DevAuthBackend',) - +AUTHENTICATION_BACKENDS = ('zproject.backends.EmailAuthBackend', + 'zproject.backends.GoogleMobileOauth2Backend') JWT_AUTH_KEYS = {} diff --git a/zproject/settings.py b/zproject/settings.py index 0844ba9b95..7e228f1c4e 100644 --- a/zproject/settings.py +++ b/zproject/settings.py @@ -42,10 +42,6 @@ def get_secret(key): return secrets_file.get('secrets', key) return None -# Import variables like secrets from the local_settings file -# Import local_settings after determining the deployment/machine type -from local_settings import * - # Make this unique, and don't share it with anybody. SECRET_KEY = get_secret("secret_key") @@ -82,6 +78,28 @@ TEST_SUITE = False # The new user tutorial is enabled by default, but disabled for client tests. TUTORIAL_ENABLED = True +# Import variables like secrets from the local_settings file +# Import local_settings after determining the deployment/machine type +if DEPLOYED: + from local_settings import * +else: + # For the Dev VM environment, we use the same settings as the + # sample local_settings.py file, with a few exceptions. + from local_settings_template import * + EXTERNAL_HOST = 'localhost:9991' + AUTHENTICATION_BACKENDS = ('zproject.backends.DevAuthBackend',) + # Add some of the below if you're testing other backends + # AUTHENTICATION_BACKENDS = ('zproject.backends.EmailAuthBackend', + # 'zproject.backends.GoogleMobileOauth2Backend', + # 'zproject.backends.GoogleBackend') + EXTERNAL_URI_SCHEME = "http://" + EMAIL_GATEWAY_PATTERN = "%s@" + EXTERNAL_HOST + ADMIN_DOMAIN = "zulip.com" + NOTIFICATION_BOT = "notification-bot@zulip.com" + ERROR_BOT = "error-bot@zulip.com" + NEW_USER_BOT = "new-user-bot@zulip.com" + EMAIL_GATEWAY_BOT = "emailgateway@zulip.com" + ######################################################################## # STANDARD DJANGO SETTINGS ######################################################################## diff --git a/zproject/test_settings.py b/zproject/test_settings.py index 6b4e6c8309..c1234e3971 100644 --- a/zproject/test_settings.py +++ b/zproject/test_settings.py @@ -53,4 +53,5 @@ CACHES['database'] = { LOGGING['loggers']['zulip.requests']['level'] = 'CRITICAL' LOGGING['loggers']['zulip.management']['level'] = 'CRITICAL' +CAMO_URI = 'https://external-content.zulipcdn.net/' CAMO_KEY = 'dummy'