2015-02-07 01:27:07 +01:00
|
|
|
# Non-secret secret Django settings for the Zulip project
|
2013-09-24 20:28:28 +02:00
|
|
|
import platform
|
2013-11-01 00:00:30 +01:00
|
|
|
import ConfigParser
|
2014-03-28 00:53:29 +01:00
|
|
|
from base64 import b64decode
|
2013-09-24 20:28:28 +02:00
|
|
|
|
2013-11-12 18:20:05 +01:00
|
|
|
config_file = ConfigParser.RawConfigParser()
|
|
|
|
config_file.read("/etc/zulip/zulip.conf")
|
|
|
|
|
2015-08-21 09:18:44 +02:00
|
|
|
# Whether we're running in a production environment. Note that PRODUCTION does
|
2015-08-21 11:24:18 +02:00
|
|
|
# **not** mean hosted on Zulip.com; customer sites are PRODUCTION and VOYAGER
|
2015-08-21 09:53:11 +02:00
|
|
|
# and as such should not assume they are the main Zulip site.
|
2015-08-21 09:18:44 +02:00
|
|
|
PRODUCTION = config_file.has_option('machine', 'deploy_type')
|
2015-08-21 09:02:03 +02:00
|
|
|
|
2015-08-21 09:53:11 +02:00
|
|
|
# The following flags are left over from the various configurations of
|
2015-08-21 09:02:03 +02:00
|
|
|
# Zulip run by Zulip, Inc. We will eventually be able to get rid of
|
2015-08-21 09:18:44 +02:00
|
|
|
# them and just have the PRODUCTION flag, but we need them for now.
|
2015-08-21 11:24:18 +02:00
|
|
|
ZULIP_COM_STAGING = PRODUCTION and config_file.get('machine', 'deploy_type') == 'zulip.com-staging'
|
2015-08-21 18:49:56 +02:00
|
|
|
ZULIP_COM = ((PRODUCTION and config_file.get('machine', 'deploy_type') == 'zulip.com-prod')
|
|
|
|
or ZULIP_COM_STAGING)
|
|
|
|
if not ZULIP_COM:
|
2015-08-21 11:24:18 +02:00
|
|
|
raise Exception("You should create your own local settings from local_settings_template.")
|
2013-11-12 18:20:05 +01:00
|
|
|
|
2013-09-24 20:28:28 +02:00
|
|
|
ZULIP_FRIENDS_LIST_ID = '84b2f3da6b'
|
|
|
|
|
2013-10-17 16:33:04 +02:00
|
|
|
# This can be filled in automatically from the database, maybe
|
|
|
|
DEPLOYMENT_ROLE_NAME = 'zulip.com'
|
2013-10-07 17:35:22 +02:00
|
|
|
|
2015-06-10 20:27:50 +02:00
|
|
|
# XXX: replace me
|
2013-11-15 19:53:04 +01:00
|
|
|
CAMO_URI = 'https://external-content.zulipcdn.net/'
|
|
|
|
|
2013-11-05 01:19:52 +01:00
|
|
|
# Leave EMAIL_HOST unset or empty if you do not wish for emails to be sent
|
2013-09-24 20:28:28 +02:00
|
|
|
EMAIL_HOST = 'smtp.gmail.com'
|
2013-10-04 19:59:25 +02:00
|
|
|
EMAIL_HOST_USER = 'zulip@zulip.com'
|
2013-09-24 20:28:28 +02:00
|
|
|
EMAIL_PORT = 587
|
2013-11-05 01:19:52 +01:00
|
|
|
EMAIL_USE_TLS = True
|
2013-11-16 00:47:17 +01:00
|
|
|
|
|
|
|
# We use mandrill, so this doesn't actually get used on our hosted deployment
|
|
|
|
DEFAULT_FROM_EMAIL = "Zulip <zulip@zulip.com>"
|
|
|
|
# The noreply address to be used as Reply-To for certain generated emails.
|
|
|
|
NOREPLY_EMAIL_ADDRESS = "noreply@zulip.com"
|
2013-09-24 20:28:28 +02:00
|
|
|
|
2013-11-01 20:12:28 +01:00
|
|
|
SESSION_SERIALIZER = "django.contrib.sessions.serializers.PickleSerializer"
|
|
|
|
|
2015-08-22 22:24:39 +02:00
|
|
|
REMOTE_POSTGRES_HOST = "postgres.zulip.net"
|
2015-08-22 22:18:55 +02:00
|
|
|
STATSD_HOST = 'stats.zulip.net'
|
|
|
|
|
2015-08-21 09:02:03 +02:00
|
|
|
if ZULIP_COM_STAGING:
|
2013-09-07 00:27:10 +02:00
|
|
|
EXTERNAL_HOST = 'staging.zulip.com'
|
2015-08-22 22:18:55 +02:00
|
|
|
STATSD_PREFIX = 'staging'
|
2015-08-21 11:24:18 +02:00
|
|
|
else:
|
2013-09-07 00:27:10 +02:00
|
|
|
EXTERNAL_HOST = 'zulip.com'
|
2013-12-18 21:00:08 +01:00
|
|
|
EXTERNAL_API_PATH = 'api.zulip.com'
|
2015-08-22 22:18:55 +02:00
|
|
|
STATSD_PREFIX = 'app'
|
2013-09-07 00:27:10 +02:00
|
|
|
|
2015-08-21 11:24:18 +02:00
|
|
|
S3_BUCKET="humbug-user-uploads"
|
|
|
|
S3_AUTH_UPLOADS_BUCKET = "zulip-user-uploads"
|
|
|
|
S3_AVATAR_BUCKET="humbug-user-avatars"
|
|
|
|
|
|
|
|
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"
|
2013-10-08 21:02:47 +02:00
|
|
|
|
2014-01-10 23:48:05 +01:00
|
|
|
GOOGLE_CLIENT_ID = "835904834568-77mtr5mtmpgspj9b051del9i9r5t4g4n.apps.googleusercontent.com"
|
|
|
|
|
2015-08-21 11:24:18 +02:00
|
|
|
GOOGLE_OAUTH2_CLIENT_ID = '835904834568-ag4p18v0sd9a0tero14r3gekn6shoen3.apps.googleusercontent.com'
|
2015-01-29 08:59:41 +01:00
|
|
|
|
2013-10-08 21:02:47 +02:00
|
|
|
# Administrator domain for this install
|
|
|
|
ADMIN_DOMAIN = "zulip.com"
|
|
|
|
|
|
|
|
# The email address pattern to use for auto-generated stream emails
|
2014-02-03 21:25:13 +01:00
|
|
|
# The %s will be replaced with a unique token.
|
2015-08-21 09:02:03 +02:00
|
|
|
if ZULIP_COM_STAGING:
|
2014-02-03 21:25:13 +01:00
|
|
|
EMAIL_GATEWAY_PATTERN = "%s@streams.staging.zulip.com"
|
2015-08-21 11:24:18 +02:00
|
|
|
else:
|
2014-02-03 21:25:13 +01:00
|
|
|
EMAIL_GATEWAY_PATTERN = "%s@streams.zulip.com"
|
2013-10-29 22:21:17 +01:00
|
|
|
|
2014-02-06 16:43:06 +01:00
|
|
|
# Email mirror configuration
|
|
|
|
# The email of the Zulip bot that the email gateway should post as.
|
|
|
|
EMAIL_GATEWAY_BOT = "emailgateway@zulip.com"
|
|
|
|
|
|
|
|
|
2013-11-04 23:16:46 +01:00
|
|
|
SSO_APPEND_DOMAIN = None
|
|
|
|
|
2015-08-21 08:19:57 +02:00
|
|
|
AUTHENTICATION_BACKENDS = ('zproject.backends.EmailAuthBackend',
|
|
|
|
'zproject.backends.GoogleMobileOauth2Backend')
|
2013-11-04 23:16:46 +01:00
|
|
|
|
2015-08-21 08:21:23 +02:00
|
|
|
# ALLOWED_HOSTS is used by django to determine which addresses
|
|
|
|
# Zulip can serve. This is a security measure.
|
2015-08-21 08:43:31 +02:00
|
|
|
# The following are the zulip.com hosts
|
|
|
|
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.200.19.65', '54.201.95.104', '54.201.95.206',
|
|
|
|
'54.201.186.29', '54.200.111.22',
|
|
|
|
'54.245.120.64', '54.213.44.83', '.zulip.com', '.zulip.net',
|
2015-09-20 00:12:33 +02:00
|
|
|
'54.244.50.66', '54.244.50.67', '54.244.50.68', '54.244.50.69', '54.244.50.70',
|
2015-09-20 00:18:41 +02:00
|
|
|
'54.244.50.64', '54.244.50.65', '54.244.50.74',
|
2015-08-21 08:43:31 +02:00
|
|
|
'chat.dropboxer.net']
|
2015-08-21 08:21:23 +02:00
|
|
|
|
2013-10-31 18:33:19 +01:00
|
|
|
NOTIFICATION_BOT = "notification-bot@zulip.com"
|
|
|
|
ERROR_BOT = "error-bot@zulip.com"
|
|
|
|
NEW_USER_BOT = "new-user-bot@zulip.com"
|
2013-11-01 14:51:36 +01:00
|
|
|
|
|
|
|
NAGIOS_SEND_BOT = 'iago@zulip.com'
|
|
|
|
NAGIOS_RECEIVE_BOT = 'othello@zulip.com'
|
|
|
|
|
|
|
|
# Our internal deployment has nagios checks for both staging and prod
|
|
|
|
NAGIOS_STAGING_SEND_BOT = 'iago@zulip.com'
|
|
|
|
NAGIOS_STAGING_RECEIVE_BOT = 'cordelia@zulip.com'
|
2013-11-04 19:37:05 +01:00
|
|
|
|
2013-11-16 00:47:17 +01:00
|
|
|
# Also used for support email in emails templates
|
2013-11-04 19:37:05 +01:00
|
|
|
ZULIP_ADMINISTRATOR = 'support@zulip.com'
|
2013-11-12 23:22:08 +01:00
|
|
|
|
2013-11-13 19:55:04 +01:00
|
|
|
ADMINS = (
|
|
|
|
('Zulip Error Reports', 'errors@zulip.com'),
|
|
|
|
)
|