Eliminate TESTING_DEPLOYED.

(imported from commit 477d8b7a15f703df1e10ae5682e02fea5ce040e4)
This commit is contained in:
David Roe
2015-08-20 23:43:31 -07:00
committed by Tim Abbott
parent 59b94a901c
commit 24f6743288
3 changed files with 10 additions and 19 deletions

View File

@@ -49,4 +49,4 @@ class ReturnTrue(logging.Filter):
class RequireReallyDeployed(logging.Filter): class RequireReallyDeployed(logging.Filter):
def filter(self, record): def filter(self, record):
from django.conf import settings from django.conf import settings
return settings.DEPLOYED and not settings.TESTING_DEPLOYED return settings.DEPLOYED

View File

@@ -11,7 +11,6 @@ config_file.read("/etc/zulip/zulip.conf")
# and as such should not for example assume they are the main Zulip site. # and as such should not for example assume they are the main Zulip site.
DEPLOYED = config_file.has_option('machine', 'deploy_type') DEPLOYED = config_file.has_option('machine', 'deploy_type')
STAGING_DEPLOYED = DEPLOYED and config_file.get('machine', 'deploy_type') == 'staging' STAGING_DEPLOYED = DEPLOYED and config_file.get('machine', 'deploy_type') == 'staging'
TESTING_DEPLOYED = DEPLOYED and config_file.get('machine', 'deploy_type') == 'test'
ENTERPRISE = DEPLOYED and config_file.get('machine', 'deploy_type') == 'enterprise' ENTERPRISE = DEPLOYED and config_file.get('machine', 'deploy_type') == 'enterprise'
@@ -36,9 +35,7 @@ NOREPLY_EMAIL_ADDRESS = "noreply@zulip.com"
SESSION_SERIALIZER = "django.contrib.sessions.serializers.PickleSerializer" SESSION_SERIALIZER = "django.contrib.sessions.serializers.PickleSerializer"
if TESTING_DEPLOYED: if STAGING_DEPLOYED:
EXTERNAL_HOST = platform.node()
elif STAGING_DEPLOYED:
EXTERNAL_HOST = 'staging.zulip.com' EXTERNAL_HOST = 'staging.zulip.com'
elif DEPLOYED: elif DEPLOYED:
EXTERNAL_HOST = 'zulip.com' EXTERNAL_HOST = 'zulip.com'
@@ -96,18 +93,13 @@ AUTHENTICATION_BACKENDS = ('zproject.backends.EmailAuthBackend',
# ALLOWED_HOSTS is used by django to determine which addresses # ALLOWED_HOSTS is used by django to determine which addresses
# Zulip can serve. This is a security measure. # Zulip can serve. This is a security measure.
if TESTING_DEPLOYED: # The following are the zulip.com hosts
# Allow any hosts for our test instances, to reduce 500 spam ALLOWED_HOSTS = ['localhost', '.humbughq.com', '54.214.48.144', '54.213.44.54',
ALLOWED_HOSTS = ['*']
else:
# Deployed on zulip.com
ALLOWED_HOSTS = ['localhost', '.humbughq.com', '54.214.48.144', '54.213.44.54',
'54.213.41.54', '54.213.44.58', '54.213.44.73', '54.213.41.54', '54.213.44.58', '54.213.44.73',
'54.200.19.65', '54.201.95.104', '54.201.95.206', '54.200.19.65', '54.201.95.104', '54.201.95.206',
'54.201.186.29', '54.200.111.22', '54.201.186.29', '54.200.111.22',
'54.245.120.64', '54.213.44.83', '.zulip.com', '.zulip.net', '54.245.120.64', '54.213.44.83', '.zulip.com', '.zulip.net',
'chat.dropboxer.net', 'chat.dropboxer.net']
]
JWT_AUTH_KEYS = {} JWT_AUTH_KEYS = {}

View File

@@ -28,7 +28,6 @@ DEPLOYED = config_file.has_option('machine', 'deploy_type')
# Zulip run by Zulip, Inc. We will eventually be able to get rid of # Zulip run by Zulip, Inc. We will eventually be able to get rid of
# them and just have the DEPLOYED flag, but we need them for now. # them and just have the DEPLOYED flag, but we need them for now.
STAGING_DEPLOYED = DEPLOYED and config_file.get('machine', 'deploy_type') == 'staging' STAGING_DEPLOYED = DEPLOYED and config_file.get('machine', 'deploy_type') == 'staging'
TESTING_DEPLOYED = DEPLOYED and config_file.get('machine', 'deploy_type') == 'test'
ENTERPRISE = DEPLOYED and config_file.get('machine', 'deploy_type') == 'enterprise' ENTERPRISE = DEPLOYED and config_file.get('machine', 'deploy_type') == 'enterprise'
secrets_file = ConfigParser.RawConfigParser() secrets_file = ConfigParser.RawConfigParser()
@@ -274,7 +273,7 @@ CACHES = {
######################################################################## ########################################################################
LOCAL_STATSD = (False) LOCAL_STATSD = (False)
USING_STATSD = (DEPLOYED and not TESTING_DEPLOYED and not ENTERPRISE) or LOCAL_STATSD USING_STATSD = (DEPLOYED and not ENTERPRISE) or LOCAL_STATSD
# These must be named STATSD_PREFIX for the statsd module # These must be named STATSD_PREFIX for the statsd module
# to pick them up # to pick them up