diff --git a/confirmation/views.py b/confirmation/views.py index b11151fafd..b1e547a1ad 100644 --- a/confirmation/views.py +++ b/confirmation/views.py @@ -31,7 +31,7 @@ def confirm(request, confirmation_key): 'key': confirmation_key, 'full_name': request.GET.get("full_name", None), 'support_email': settings.ZULIP_ADMINISTRATOR, - 'enterprise': settings.ENTERPRISE + 'enterprise': settings.VOYAGER } templates = [ 'confirmation/confirm.html', diff --git a/tools/build-enterprise-tarball b/tools/build-enterprise-tarball index 80889b3bcd..c7762114d7 100755 --- a/tools/build-enterprise-tarball +++ b/tools/build-enterprise-tarball @@ -42,7 +42,7 @@ cp zproject/local_settings_template.py zproject/local_settings.py # Some settings need to be updated for update-prod-static to work # # TODO: Would be much better to instead run the below tools with some -# sort of environment hack to make settings.ENTERPRISE=True so that we +# sort of environment hack to make settings.VOYAGER=True so that we # don't need to create this dummy secrets file. cat >> zproject/local_settings.py <>sys.stderr, "\033[1;31mExternal deployments cannot be open realms.\033[0m\n" self.print_help("python manage.py", "create_realm") exit(1) - if options["deployment_id"] is not None and settings.ENTERPRISE: + if options["deployment_id"] is not None and settings.VOYAGER: print >>sys.stderr, "\033[1;31mExternal deployments are not supported on enterprise deployments.\033[0m\n" exit(1) @@ -81,10 +81,11 @@ Usage: python manage.py create_realm --domain=foo.com --name='Foo, Inc.'""" deployment.realms.add(realm) deployment.save() print "Added to deployment", str(deployment.id) - elif not settings.ENTERPRISE: + elif settings.ZULIP_COM or settings.ZULIP_COM_STAGING: deployment = Deployment.objects.get(base_site_url="https://zulip.com/") deployment.realms.add(realm) deployment.save() + # should there be an else clause here? set_default_streams(realm, ["social", "engineering"]) print "\033[1;36mDefault streams set to social,engineering,zulip!\033[0m" diff --git a/zerver/management/commands/enqueue_digest_emails.py b/zerver/management/commands/enqueue_digest_emails.py index 3aaed39b1a..3fe7296916 100644 --- a/zerver/management/commands/enqueue_digest_emails.py +++ b/zerver/management/commands/enqueue_digest_emails.py @@ -53,8 +53,8 @@ def queue_digest_recipient(user_profile, cutoff): queue_json_publish("digest_emails", event, lambda event: None) def domains_for_this_deployment(): - if settings.PRODUCTION and not settings.ENTERPRISE: - # Enterprise deployments don't have a Deployment entry. + if settings.ZULIP_COM or settings.ZULIP_COM_STAGING: + # Voyager deployments don't have a Deployment entry. # Only send zulip.com digests on staging. from zilencer.models import Deployment site_url = settings.EXTERNAL_URI_SCHEME + settings.EXTERNAL_HOST.rstrip("/") @@ -65,18 +65,19 @@ def domains_for_this_deployment(): raise ValueError("digest: Unable to determine deployment.") return [r.domain for r in deployment.realms.all()] - # Enterprise and localhost. + # Voyager and development. return [] def should_process_digest(domain, deployment_domains): - if settings.ENTERPRISE: - # Enterprise. We ship with a zulip.com realm for the feedback bot, but + if settings.VOYAGER: + # Voyager. We ship with a zulip.com realm for the feedback bot, but # don't try to send e-mails to it. return domain != "zulip.com" elif settings.PRODUCTION: + # zulip.com or staging.zulip.com return domain in deployment_domains else: - # Localhost. + # Development return True class Command(BaseCommand): diff --git a/zerver/views/__init__.py b/zerver/views/__init__.py index 0becc6f08f..0f10deaddb 100644 --- a/zerver/views/__init__.py +++ b/zerver/views/__init__.py @@ -830,7 +830,7 @@ def send_registration_completion_email(email, request): """ prereg_user = create_preregistration_user(email, request) context = {'support_email': settings.ZULIP_ADMINISTRATOR, - 'enterprise': settings.ENTERPRISE} + 'enterprise': settings.VOYAGER} Confirmation.objects.send_confirmation(prereg_user, email, additional_context=context) @@ -966,7 +966,7 @@ def home(request): # Pass parameters to the client-side JavaScript code. # These end up in a global JavaScript Object named 'page_params'. page_params = dict( - enterprise = settings.ENTERPRISE, + enterprise = settings.VOYAGER, debug_mode = settings.DEBUG, test_suite = settings.TEST_SUITE, poll_timeout = settings.POLL_TIMEOUT, diff --git a/zerver/worker/queue_processors.py b/zerver/worker/queue_processors.py index 368cd6dbd4..1babf52fa4 100644 --- a/zerver/worker/queue_processors.py +++ b/zerver/worker/queue_processors.py @@ -125,7 +125,7 @@ class ConfirmationEmailWorker(QueueProcessingWorker): "zerver/emails/invitation/invitation_reminder_email", {'activate_url': link, 'referrer': referrer, - 'enterprise': settings.ENTERPRISE, + 'enterprise': settings.VOYAGER, 'external_host': settings.EXTERNAL_HOST, 'support_email': settings.ZULIP_ADMINISTRATOR}, datetime.timedelta(days=2), diff --git a/zilencer/management/commands/populate_db.py b/zilencer/management/commands/populate_db.py index c271266e0d..e49be83083 100644 --- a/zilencer/management/commands/populate_db.py +++ b/zilencer/management/commands/populate_db.py @@ -120,7 +120,7 @@ class Command(BaseCommand): for realm in Realm.objects.all(): realms[realm.domain] = realm - if not settings.ENTERPRISE: + if settings.ZULIP_COM or settings.ZULIP_COM_STAGING: # what about development? # Associate initial deployment with Realm dep = Deployment() dep.base_api_url = "https://zulip.com/api/" diff --git a/zproject/local_settings.py b/zproject/local_settings.py index 99dd7cb2a5..5e5748c315 100644 --- a/zproject/local_settings.py +++ b/zproject/local_settings.py @@ -7,16 +7,17 @@ config_file = ConfigParser.RawConfigParser() config_file.read("/etc/zulip/zulip.conf") # Whether we're running in a production environment. Note that PRODUCTION does -# **not** mean hosted on Zulip.com; customer sites are PRODUCTION and ENTERPRISE +# **not** mean hosted on Zulip.com; customer sites are PRODUCTION and VOYAGER # and as such should not assume they are the main Zulip site. PRODUCTION = config_file.has_option('machine', 'deploy_type') # The following flags are left over from the various configurations 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. -ZULIP_COM_STAGING = PRODUCTION and config_file.get('machine', 'deploy_type') == 'staging' -ZULIP_COM = PRODUCTION and config_file.get('machine', 'deploy_type') == 'prod' -ENTERPRISE = PRODUCTION and config_file.get('machine', 'deploy_type') == 'enterprise' +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' +if not ZULIP_COM and not ZULIP_COM_STAGING: + raise Exception("You should create your own local settings from local_settings_template.") ZULIP_FRIENDS_LIST_ID = '84b2f3da6b' @@ -41,39 +42,23 @@ SESSION_SERIALIZER = "django.contrib.sessions.serializers.PickleSerializer" if ZULIP_COM_STAGING: EXTERNAL_HOST = 'staging.zulip.com' -elif PRODUCTION: +else: EXTERNAL_HOST = 'zulip.com' EXTERNAL_API_PATH = 'api.zulip.com' -# For now, ENTERPRISE is only testing, so write to our test buckets -if PRODUCTION and not ENTERPRISE: - S3_BUCKET="humbug-user-uploads" - S3_AUTH_UPLOADS_BUCKET = "zulip-user-uploads" - S3_AVATAR_BUCKET="humbug-user-avatars" -else: - S3_BUCKET="humbug-user-uploads-test" - S3_AUTH_UPLOADS_BUCKET = "zulip-user-uploads-test" - S3_AVATAR_BUCKET="humbug-user-avatars-test" +S3_BUCKET="humbug-user-uploads" +S3_AUTH_UPLOADS_BUCKET = "zulip-user-uploads" +S3_AVATAR_BUCKET="humbug-user-avatars" -if PRODUCTION or ZULIP_COM_STAGING: - APNS_SANDBOX = "push_production" - APNS_FEEDBACK = "feedback_production" - APNS_CERT_FILE = "/etc/ssl/django-private/apns-dist.pem" - DBX_APNS_CERT_FILE = "/etc/ssl/django-private/dbx-apns-dist.pem" -else: - APNS_SANDBOX = "push_sandbox" - APNS_FEEDBACK = "feedback_sandbox" - APNS_CERT_FILE = "/etc/ssl/django-private/apns-dev.pem" - DBX_APNS_CERT_FILE = "/etc/ssl/django-private/dbx-apns-dev.pem" +APNS_SANDBOX = "push_production" +APNS_FEEDBACK = "feedback_production" +APNS_CERT_FILE = "/etc/ssl/django-private/apns-dist.pem" +DBX_APNS_CERT_FILE = "/etc/ssl/django-private/dbx-apns-dist.pem" GOOGLE_CLIENT_ID = "835904834568-77mtr5mtmpgspj9b051del9i9r5t4g4n.apps.googleusercontent.com" -if PRODUCTION: - GOOGLE_OAUTH2_CLIENT_ID = '835904834568-ag4p18v0sd9a0tero14r3gekn6shoen3.apps.googleusercontent.com' -else: - # Google OAUTH2 for dev with the redirect uri set to http://localhost:9991/accounts/login/google/done/ - GOOGLE_OAUTH2_CLIENT_ID = '607830223128-4qgthc7ofdqce232dk690t5jgkm1ce33.apps.googleusercontent.com' +GOOGLE_OAUTH2_CLIENT_ID = '835904834568-ag4p18v0sd9a0tero14r3gekn6shoen3.apps.googleusercontent.com' # Administrator domain for this install ADMIN_DOMAIN = "zulip.com" @@ -82,7 +67,7 @@ ADMIN_DOMAIN = "zulip.com" # The %s will be replaced with a unique token. if ZULIP_COM_STAGING: EMAIL_GATEWAY_PATTERN = "%s@streams.staging.zulip.com" -elif PRODUCTION: +else: EMAIL_GATEWAY_PATTERN = "%s@streams.zulip.com" # Email mirror configuration diff --git a/zproject/settings.py b/zproject/settings.py index 68b8098970..456cf8e3b4 100644 --- a/zproject/settings.py +++ b/zproject/settings.py @@ -31,7 +31,10 @@ DEVELOPMENT = not PRODUCTION # 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 = PRODUCTION and config_file.get('machine', 'deploy_type') == 'zulip.com-prod' -ENTERPRISE = PRODUCTION and config_file.get('machine', 'deploy_type') == 'enterprise' + +# Voyager is a production zulip server that is not zulip.com or staging.zulip.com +# VOYAGER is not ENTERPRISE. +VOYAGER = PRODUCTION and not ZULIP_COM and not ZULIP_COM_STAGING secrets_file = ConfigParser.RawConfigParser() if PRODUCTION: @@ -189,7 +192,7 @@ INSTALLED_APPS = [ 'zerver', ] -if not ENTERPRISE: +if not VOYAGER: INSTALLED_APPS += [ 'analytics', 'zilencer', @@ -220,7 +223,7 @@ DATABASES = {"default": { }, } -if ENTERPRISE: +if VOYAGER: DATABASES["default"].update({ # Host = '' => connect through a local socket 'HOST': '', @@ -276,7 +279,7 @@ CACHES = { ######################################################################## LOCAL_STATSD = (False) -USING_STATSD = (PRODUCTION and not ENTERPRISE) or LOCAL_STATSD +USING_STATSD = ZULIP_COM or ZULIP_COM_STAGING or LOCAL_STATSD # These must be named STATSD_PREFIX for the statsd module # to pick them up @@ -376,7 +379,7 @@ DEFAULT_SETTINGS = {'TWITTER_CONSUMER_KEY': '', 'ERROR_REPORTING': True, 'NAME_CHANGES_DISABLED': False, 'DEPLOYMENT_ROLE_NAME': "", - # The following bots only exist in non-ENTERPRISE installs + # The following bots only exist in non-VOYAGER installs 'ERROR_BOT': None, 'NEW_USER_BOT': None, 'NAGIOS_STAGING_SEND_BOT': None, @@ -533,7 +536,7 @@ else: STATICFILES_FINDERS = ( 'zerver.finders.ZulipFinder', ) - if PRODUCTION or ENTERPRISE: + if PRODUCTION: STATIC_ROOT = '/home/zulip/prod-static' else: STATIC_ROOT = 'prod-static/serve' @@ -765,7 +768,7 @@ ZULIP_PATHS = [ # The Event log basically logs most significant database changes, # which can be useful for debugging. -if ENTERPRISE: +if VOYAGER: EVENT_LOG_DIR = None else: ZULIP_PATHS.append(("EVENT_LOG_DIR", "/home/zulip/logs/event_log")) diff --git a/zproject/urls.py b/zproject/urls.py index 5e42ca8cdf..5a95b13ba2 100644 --- a/zproject/urls.py +++ b/zproject/urls.py @@ -254,7 +254,7 @@ v1_api_and_json_patterns = patterns('zerver.views', {'GET': 'get_events_backend', 'DELETE': 'cleanup_event_queue'}), ) -if not settings.ENTERPRISE: +if not settings.VOYAGER: v1_api_and_json_patterns += patterns('', # Still scoped to api/v1/, but under a different project url(r'^deployments/', include('zilencer.urls.api')),