Change semantics of ZULIP_COM to include ZULIP_COM_STAGING machines.

(imported from commit 2e84c756b4ac41c13d619ab6ceb99e347d1f48cb)
This commit is contained in:
Tim Abbott
2015-08-21 09:49:56 -07:00
parent a8261dd6ac
commit 83a653efce
6 changed files with 11 additions and 9 deletions

View File

@@ -24,7 +24,7 @@ import logging
import cProfile import cProfile
from zerver.lib.mandrill_client import get_mandrill_client from zerver.lib.mandrill_client import get_mandrill_client
if settings.ZULIP_COM or settings.ZULIP_COM_STAGING: if settings.ZULIP_COM:
from zilencer.models import get_deployment_by_domain, Deployment from zilencer.models import get_deployment_by_domain, Deployment
else: else:
from mock import Mock from mock import Mock

View File

@@ -2173,7 +2173,7 @@ def encode_email_address_helper(name, email_token):
def decode_email_address(email): def decode_email_address(email):
# Perform the reverse of encode_email_address. Returns a tuple of (streamname, email_token) # Perform the reverse of encode_email_address. Returns a tuple of (streamname, email_token)
pattern_parts = [re.escape(part) for part in settings.EMAIL_GATEWAY_PATTERN.split('%s')] pattern_parts = [re.escape(part) for part in settings.EMAIL_GATEWAY_PATTERN.split('%s')]
if settings.ZULIP_COM or settings.ZULIP_COM_STAGING: if settings.ZULIP_COM:
# Accept mails delivered to any Zulip server # Accept mails delivered to any Zulip server
pattern_parts[-1] = r'@[\w-]*\.zulip\.net' pattern_parts[-1] = r'@[\w-]*\.zulip\.net'
match_email_re = re.compile("(.*?)".join(pattern_parts)) match_email_re = re.compile("(.*?)".join(pattern_parts))

View File

@@ -81,7 +81,7 @@ Usage: python manage.py create_realm --domain=foo.com --name='Foo, Inc.'"""
deployment.realms.add(realm) deployment.realms.add(realm)
deployment.save() deployment.save()
print "Added to deployment", str(deployment.id) print "Added to deployment", str(deployment.id)
elif settings.ZULIP_COM or settings.ZULIP_COM_STAGING: elif settings.ZULIP_COM:
deployment = Deployment.objects.get(base_site_url="https://zulip.com/") deployment = Deployment.objects.get(base_site_url="https://zulip.com/")
deployment.realms.add(realm) deployment.realms.add(realm)
deployment.save() deployment.save()

View File

@@ -53,7 +53,7 @@ def queue_digest_recipient(user_profile, cutoff):
queue_json_publish("digest_emails", event, lambda event: None) queue_json_publish("digest_emails", event, lambda event: None)
def domains_for_this_deployment(): def domains_for_this_deployment():
if settings.ZULIP_COM or settings.ZULIP_COM_STAGING: if settings.ZULIP_COM:
# Voyager deployments don't have a Deployment entry. # Voyager deployments don't have a Deployment entry.
# Only send zulip.com digests on staging. # Only send zulip.com digests on staging.
from zilencer.models import Deployment from zilencer.models import Deployment

View File

@@ -15,8 +15,9 @@ PRODUCTION = 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 PRODUCTION flag, but we need them for now. # them and just have the PRODUCTION flag, but we need them for now.
ZULIP_COM_STAGING = PRODUCTION and config_file.get('machine', 'deploy_type') == 'zulip.com-staging' ZULIP_COM_STAGING = PRODUCTION and config_file.get('machine', 'deploy_type') == 'zulip.com-staging'
ZULIP_COM = PRODUCTION and config_file.get('machine', 'deploy_type') == 'zulip.com-prod' ZULIP_COM = ((PRODUCTION and config_file.get('machine', 'deploy_type') == 'zulip.com-prod')
if not ZULIP_COM and not ZULIP_COM_STAGING: or ZULIP_COM_STAGING)
if not ZULIP_COM:
raise Exception("You should create your own local settings from local_settings_template.") raise Exception("You should create your own local settings from local_settings_template.")
ZULIP_FRIENDS_LIST_ID = '84b2f3da6b' ZULIP_FRIENDS_LIST_ID = '84b2f3da6b'

View File

@@ -30,14 +30,15 @@ DEVELOPMENT = not PRODUCTION
# 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 PRODUCTION flag, but we need them for now. # them and just have the PRODUCTION flag, but we need them for now.
ZULIP_COM_STAGING = PRODUCTION and config_file.get('machine', 'deploy_type') == 'zulip.com-staging' ZULIP_COM_STAGING = PRODUCTION and config_file.get('machine', 'deploy_type') == 'zulip.com-staging'
ZULIP_COM = PRODUCTION and config_file.get('machine', 'deploy_type') == 'zulip.com-prod' ZULIP_COM = ((PRODUCTION and config_file.get('machine', 'deploy_type') == 'zulip.com-prod')
or ZULIP_COM_STAGING)
# Voyager is a production zulip server that is not zulip.com or # Voyager is a production zulip server that is not zulip.com or
# staging.zulip.com VOYAGER is the standalone all-on-one-server # staging.zulip.com VOYAGER is the standalone all-on-one-server
# production deployment model for based on the original Zulip # production deployment model for based on the original Zulip
# ENTERPRISE implementation. We expect most users of the open source # ENTERPRISE implementation. We expect most users of the open source
# project will be using VOYAGER=True in production. # project will be using VOYAGER=True in production.
VOYAGER = PRODUCTION and not ZULIP_COM and not ZULIP_COM_STAGING VOYAGER = PRODUCTION and not ZULIP_COM
secrets_file = ConfigParser.RawConfigParser() secrets_file = ConfigParser.RawConfigParser()
if PRODUCTION: if PRODUCTION:
@@ -282,7 +283,7 @@ CACHES = {
######################################################################## ########################################################################
LOCAL_STATSD = (False) LOCAL_STATSD = (False)
USING_STATSD = ZULIP_COM or ZULIP_COM_STAGING or LOCAL_STATSD USING_STATSD = ZULIP_COM 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