Rename LOCALSERVER -> LOCAL_SERVER.

(imported from commit b3abdd10d54d2ad7a9c463af9a291d2e2127707f)
This commit is contained in:
Waseem Daher 2013-10-25 17:34:27 -04:00
parent 8e21d70afe
commit 66f48288b4
7 changed files with 17 additions and 17 deletions

View File

@ -6,7 +6,7 @@ import ujson
def add_settings(request): def add_settings(request):
return { return {
'full_navbar': settings.FULL_NAVBAR, 'full_navbar': settings.FULL_NAVBAR,
'localserver': settings.LOCALSERVER, 'local_server': settings.LOCAL_SERVER,
} }
def add_metrics(request): def add_metrics(request):

View File

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

View File

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

View File

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

View File

@ -46,13 +46,13 @@ EMAIL_HOST_PASSWORD = 'xxxxxxxxxxxxxxxx'
EMAIL_PORT = 587 EMAIL_PORT = 587
# Whether we're running in a production environment. Note that DEPLOYED does # Whether we're running in a production environment. Note that DEPLOYED does
# **not** mean hosted by us; customer sites are DEPLOYED and LOCALSERVER # **not** mean hosted by us; customer sites are DEPLOYED and LOCAL_SERVER
# 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 = os.path.exists('/etc/humbug-server') DEPLOYED = os.path.exists('/etc/humbug-server')
STAGING_DEPLOYED = (platform.node() == 'staging.zulip.net') STAGING_DEPLOYED = (platform.node() == 'staging.zulip.net')
TESTING_DEPLOYED = not not re.match(r'^test', platform.node()) TESTING_DEPLOYED = not not re.match(r'^test', platform.node())
LOCALSERVER = os.path.exists('/etc/zulip-local') LOCAL_SERVER = os.path.exists('/etc/zulip-local')
if TESTING_DEPLOYED: if TESTING_DEPLOYED:
EXTERNAL_HOST = platform.node() EXTERNAL_HOST = platform.node()
@ -70,8 +70,8 @@ if DEPLOYED:
else: else:
FEEDBACK_TARGET="http://localhost:9991/api" FEEDBACK_TARGET="http://localhost:9991/api"
# For now, LOCALSERVER is only testing, so write to our test buckets # For now, LOCAL_SERVER is only testing, so write to our test buckets
if DEPLOYED and not LOCALSERVER: if DEPLOYED and not LOCAL_SERVER:
S3_KEY="xxxxxxxxxxxxxxxxxxxx" S3_KEY="xxxxxxxxxxxxxxxxxxxx"
S3_SECRET_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" S3_SECRET_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
S3_BUCKET="humbug-user-uploads" S3_BUCKET="humbug-user-uploads"
@ -96,7 +96,7 @@ if STAGING_DEPLOYED or TESTING_DEPLOYED:
TWITTER_CONSUMER_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" TWITTER_CONSUMER_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
TWITTER_ACCESS_TOKEN_KEY = "xxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" TWITTER_ACCESS_TOKEN_KEY = "xxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
TWITTER_ACCESS_TOKEN_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" TWITTER_ACCESS_TOKEN_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
elif DEPLOYED and not LOCALSERVER: elif DEPLOYED and not LOCAL_SERVER:
# This is the real set of API credentials used by our real server, # 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 # and we probably shouldn't test with it just so we don't waste its requests
# Application: "Humbug HQ - Production" # Application: "Humbug HQ - Production"

View File

@ -11,13 +11,13 @@ import sys
from zerver.openid import openid_failure_handler from zerver.openid import openid_failure_handler
# Whether we're running in a production environment. Note that DEPLOYED does # Whether we're running in a production environment. Note that DEPLOYED does
# **not** mean hosted by us; customer sites are DEPLOYED and LOCALSERVER # **not** mean hosted by us; customer sites are DEPLOYED and LOCAL_SERVER
# 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 = os.path.exists('/etc/humbug-server') DEPLOYED = os.path.exists('/etc/humbug-server')
STAGING_DEPLOYED = (platform.node() == 'staging.zulip.net') STAGING_DEPLOYED = (platform.node() == 'staging.zulip.net')
TESTING_DEPLOYED = not not re.match(r'^test', platform.node()) TESTING_DEPLOYED = not not re.match(r'^test', platform.node())
LOCALSERVER = os.path.exists('/etc/zulip-local') LOCAL_SERVER = os.path.exists('/etc/zulip-local')
# TODO: Clean this up # TODO: Clean this up
if TESTING_DEPLOYED: if TESTING_DEPLOYED:
@ -42,8 +42,8 @@ TEST_SUITE = False
if DEBUG: if DEBUG:
INTERNAL_IPS = ('127.0.0.1',) INTERNAL_IPS = ('127.0.0.1',)
if TESTING_DEPLOYED or LOCALSERVER: if TESTING_DEPLOYED or LOCAL_SERVER:
# XXX we should probably tighten this for LOCALSERVER # XXX we should probably tighten this for LOCAL_SERVER
# Allow any hosts for our test instances, to reduce 500 spam # Allow any hosts for our test instances, to reduce 500 spam
ALLOWED_HOSTS = ['*'] ALLOWED_HOSTS = ['*']
elif DEPLOYED: elif DEPLOYED:
@ -73,7 +73,7 @@ DATABASES = {"default": {
}, },
} }
if not DEPLOYED or LOCALSERVER: if not DEPLOYED or LOCAL_SERVER:
DATABASES["default"].update({ DATABASES["default"].update({
'PASSWORD': LOCAL_DATABASE_PASSWORD, 'PASSWORD': LOCAL_DATABASE_PASSWORD,
'HOST': 'localhost', 'HOST': 'localhost',
@ -187,7 +187,7 @@ INSTALLED_APPS = (
) )
LOCAL_STATSD = (False) LOCAL_STATSD = (False)
USING_STATSD = (DEPLOYED and not TESTING_DEPLOYED and not LOCALSERVER) or LOCAL_STATSD USING_STATSD = (DEPLOYED and not TESTING_DEPLOYED and not LOCAL_SERVER) 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
@ -272,7 +272,7 @@ else:
STATICFILES_FINDERS = ( STATICFILES_FINDERS = (
'zerver.finders.ZulipFinder', 'zerver.finders.ZulipFinder',
) )
if DEPLOYED or LOCALSERVER: if DEPLOYED or LOCAL_SERVER:
STATIC_ROOT = '/home/zulip/prod-static' STATIC_ROOT = '/home/zulip/prod-static'
else: else:
STATIC_ROOT = 'prod-static/serve' STATIC_ROOT = 'prod-static/serve'

View File

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