Rename LOCAL_SERVER to ENTERPRISE.

(imported from commit 7edf353eefe6c9e7aac74b7bbc37b923cac1b913)
This commit is contained in:
Tim Abbott 2013-11-12 12:14:02 -05:00
parent b461e3c10e
commit 5293cdebe8
13 changed files with 28 additions and 28 deletions

View File

@ -18,7 +18,7 @@ var customer4_realms = [
var is_customer4 = _.contains(customer4_realms, page_params.domain);
// Local server-related flags
exports.do_not_share_the_love = page_params.local_server;
exports.do_not_share_the_love = page_params.enterprise;
// Manually-flipped debugging flags
exports.log_send_times = false;

View File

@ -106,7 +106,7 @@ sudo apt-get install zulip-desktop
at <code>plan9.zulip.com</code> and then... no, we're
totally kidding. There definitely isn't a version of Zulip
for Plan 9.</p>
{% if not local_server %}
{% if not enterprise %}
<p>But if you're the kind of person who would've gotten a kick
out of that sort of thing, we'd love to talk to you, because
we're hiring. Please send us a resume and any other relevant

View File

@ -20,7 +20,7 @@
<![endif]-->
<link href="/static/favicon.ico?v=2" rel="shortcut icon">
{% if not local_server %}
{% if not enterprise %}
<script type="text/javascript">var dropboxAppKey = "{{ dropboxAppKey }}";</script>
{# mixpanel #}
<script type="text/javascript">

View File

@ -24,7 +24,7 @@ hence the name.
<div class="column-right top-links">
<a href="/accounts/login/?next=/">Log in</a>
{% if local_server %}
{% if enterprise %}
<a href="{% url 'register' %}">Sign up</a>
{% else %}
<a href="{% url 'signup' %}">Sign up</a>
@ -51,7 +51,7 @@ hence the name.
<li><a href="/accounts/login/?next=/">Log in</a></li>
<li><span class="little-bullet">·</span></li>
<li>
{% if local_server %}
{% if enterprise %}
<a href="{% url 'register' %}">Sign up</a>
{% else %}
<a href="{% url 'signup' %}">Sign up</a>

View File

@ -7,7 +7,7 @@ from zproject.backends import password_auth_enabled
def add_settings(request):
return {
'full_navbar': settings.FULL_NAVBAR,
'local_server': settings.LOCAL_SERVER,
'enterprise': settings.ENTERPRISE,
'zulip_admin': settings.ZULIP_ADMINISTRATOR,
'password_auth_enabled': password_auth_enabled(),
}

View File

@ -57,7 +57,7 @@ Usage: python manage.py create_realm --domain=foo.com --name='Foo, Inc.'"""
print >>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.LOCAL_SERVER:
if options["deployment_id"] is not None and settings.ENTERPRISE:
print >>sys.stderr, "\033[1;31mExternal deployments are not supported on local server deployments.\033[0m\n"
exit(1)
@ -75,7 +75,7 @@ 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.LOCAL_SERVER:
elif not settings.ENTERPRISE:
deployment = Deployment.objects.get(base_site_url="https://zulip.com/")
deployment.realms.add(realm)
deployment.save()

View File

@ -337,7 +337,7 @@ class Stream(models.Model):
# historical messages for all streams that are not invite-only.
return ((not settings.DEPLOYED or self.realm.domain in
["zulip.com"] or self.realm.id > 68
or settings.LOCAL_SERVER)
or settings.ENTERPRISE)
and not self.invite_only)
class Meta:

View File

@ -662,7 +662,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 = simplejson.encoder.JSONEncoderForHTML().encode(dict(
local_server = settings.LOCAL_SERVER,
enterprise = settings.ENTERPRISE,
debug_mode = settings.DEBUG,
test_suite = settings.TEST_SUITE,
poll_timeout = settings.POLL_TIMEOUT,

View File

@ -119,7 +119,7 @@ class Command(BaseCommand):
for realm in Realm.objects.all():
realms[realm.domain] = realm
if not settings.LOCAL_SERVER:
if not settings.ENTERPRISE:
# Associate initial deployment with Realm
dep = Deployment.objects.all()[0]
dep.realms = [realms["zulip.com"]]

View File

@ -24,7 +24,7 @@ class Migration(SchemaMigration):
))
db.create_unique(u'zilencer_deployment_realms', ['deployment_id', 'realm_id'])
if not settings.LOCAL_SERVER:
if not settings.ENTERPRISE:
try:
dep = orm['zilencer.Deployment']()
dep.api_key = settings.DEPLOYMENT_ROLE_KEY

View File

@ -49,13 +49,13 @@ config_file = ConfigParser.RawConfigParser()
config_file.read("/etc/zulip/zulip.conf")
# Whether we're running in a production environment. Note that DEPLOYED does
# **not** mean hosted by us; customer sites are DEPLOYED and LOCAL_SERVER
# **not** mean hosted by us; customer sites are DEPLOYED and ENTERPRISE
# and as such should not for example assume they are the main Zulip site.
DEPLOYED = config_file.has_option('machine', 'deploy_type')
STAGING_DEPLOYED = DEPLOYED and config_file.get('machine', 'deploy_type') == 'staging'
TESTING_DEPLOYED = DEPLOYED and config_file.get('machine', 'deploy_type') == 'test'
LOCAL_SERVER = DEPLOYED and config_file.get('machine', 'deploy_type') == 'local'
ENTERPRISE = DEPLOYED and config_file.get('machine', 'deploy_type') == 'local'
SESSION_SERIALIZER = "django.contrib.sessions.serializers.PickleSerializer"
@ -79,8 +79,8 @@ if DEPLOYED:
else:
FEEDBACK_TARGET="http://localhost:9991/api"
# For now, LOCAL_SERVER is only testing, so write to our test buckets
if DEPLOYED and not LOCAL_SERVER:
# For now, ENTERPRISE is only testing, so write to our test buckets
if DEPLOYED and not ENTERPRISE:
S3_KEY="xxxxxxxxxxxxxxxxxxxx"
S3_SECRET_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
S3_BUCKET="humbug-user-uploads"
@ -105,7 +105,7 @@ if STAGING_DEPLOYED or TESTING_DEPLOYED:
TWITTER_CONSUMER_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
TWITTER_ACCESS_TOKEN_KEY = "xxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
TWITTER_ACCESS_TOKEN_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
elif DEPLOYED and not LOCAL_SERVER:
elif DEPLOYED and not ENTERPRISE:
# This is the real set of API credentials used by our real server,
# and we probably shouldn't test with it just so we don't waste its requests
# Application: "Humbug HQ - Production"

View File

@ -14,13 +14,13 @@ config_file = ConfigParser.RawConfigParser()
config_file.read("/etc/zulip/zulip.conf")
# Whether we're running in a production environment. Note that DEPLOYED does
# **not** mean hosted by us; customer sites are DEPLOYED and LOCAL_SERVER
# **not** mean hosted by us; customer sites are DEPLOYED and ENTERPRISE
# and as such should not for example assume they are the main Zulip site.
DEPLOYED = config_file.has_option('machine', 'deploy_type')
STAGING_DEPLOYED = DEPLOYED and config_file.get('machine', 'deploy_type') == 'staging'
TESTING_DEPLOYED = DEPLOYED and config_file.get('machine', 'deploy_type') == 'test'
LOCAL_SERVER = DEPLOYED and config_file.get('machine', 'deploy_type') == 'local'
ENTERPRISE = DEPLOYED and config_file.get('machine', 'deploy_type') == 'local'
# Import variables like secrets from the local_settings file
# Import local_settings after determining the deployment/machine type
@ -37,8 +37,8 @@ TEST_SUITE = False
if DEBUG:
INTERNAL_IPS = ('127.0.0.1',)
if TESTING_DEPLOYED or LOCAL_SERVER:
# XXX we should probably tighten this for LOCAL_SERVER
if TESTING_DEPLOYED or ENTERPRISE:
# XXX we should probably tighten this for ENTERPRISE
# Allow any hosts for our test instances, to reduce 500 spam
ALLOWED_HOSTS = ['*']
elif DEPLOYED:
@ -70,7 +70,7 @@ DATABASES = {"default": {
},
}
if LOCAL_SERVER:
if ENTERPRISE:
DATABASES["default"].update({
'HOST': 'localhost',
'OPTIONS': {
@ -192,14 +192,14 @@ INSTALLED_APPS = [
'zerver',
]
if not LOCAL_SERVER:
if not ENTERPRISE:
INSTALLED_APPS += [
'analytics',
'zilencer',
]
LOCAL_STATSD = (False)
USING_STATSD = (DEPLOYED and not TESTING_DEPLOYED and not LOCAL_SERVER) or LOCAL_STATSD
USING_STATSD = (DEPLOYED and not TESTING_DEPLOYED and not ENTERPRISE) or LOCAL_STATSD
# These must be named STATSD_PREFIX for the statsd module
# to pick them up
@ -251,7 +251,7 @@ DEFAULT_SETTINGS = {'TWITTER_CONSUMER_KEY': '',
'MAILCHIMP_API_KEY': '',
'LOCAL_UPLOADS_DIR': None,
'DROPBOX_APP_KEY': '',
# The following bots only exist in non-LOCAL_SERVER installs
# The following bots only exist in non-ENTERPRISE installs
'ERROR_BOT': None,
'NEW_USER_BOT': None,
'NAGIOS_STAGING_SEND_BOT': None,
@ -313,7 +313,7 @@ else:
STATICFILES_FINDERS = (
'zerver.finders.ZulipFinder',
)
if DEPLOYED or LOCAL_SERVER:
if DEPLOYED or ENTERPRISE:
STATIC_ROOT = '/home/zulip/prod-static'
else:
STATIC_ROOT = 'prod-static/serve'
@ -545,7 +545,7 @@ CACHES = {
if DEPLOYED:
SERVER_LOG_PATH = "/var/log/zulip/server.log"
WORKER_LOG_PATH = "/var/log/zulip/workers.log"
if LOCAL_SERVER:
if ENTERPRISE:
EVENT_LOG_DIR = None
else:
EVENT_LOG_DIR = '/home/zulip/logs/event_log'

View File

@ -224,7 +224,7 @@ v1_api_and_json_patterns = patterns('zerver.views',
url(r'^events$', 'rest_dispatch',
{'GET': 'get_events_backend'}),
)
if not settings.LOCAL_SERVER:
if not settings.ENTERPRISE:
v1_api_and_json_patterns += patterns('',
# Still scoped to api/v1/, but under a different project
url(r'^deployments/', include('zilencer.urls.api')),