2015-09-30 03:05:04 +02:00
|
|
|
# This file is the Zulip local_settings.py configuration for the
|
|
|
|
# zulip.com installation of Zulip. It shouldn't be used in other
|
|
|
|
# environments, but you may find it to be a a helpful reference when
|
|
|
|
# setting up your own Zulip installation to see how Zulip can be
|
|
|
|
# configured.
|
|
|
|
#
|
|
|
|
# On a normal Zulip production server, zproject/local_settings.py is a
|
2016-07-20 05:45:50 +02:00
|
|
|
# symlink to /etc/zulip/settings.py (based off prod_settings_template.py).
|
2013-09-24 20:28:28 +02:00
|
|
|
import platform
|
2015-11-01 17:14:36 +01:00
|
|
|
import six.moves.configparser
|
2014-03-28 00:53:29 +01:00
|
|
|
from base64 import b64decode
|
2017-05-23 23:04:54 +02:00
|
|
|
from typing import Optional, Set
|
2013-09-24 20:28:28 +02:00
|
|
|
|
2017-05-07 20:15:51 +02:00
|
|
|
config_file = six.moves.configparser.RawConfigParser() # type: ignore # https://github.com/python/typeshed/pull/206
|
2013-11-12 18:20:05 +01:00
|
|
|
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'
|
2017-01-24 05:50:04 +01:00
|
|
|
ZULIP_COM = ((PRODUCTION and config_file.get('machine', 'deploy_type') == 'zulip.com-prod') or
|
|
|
|
ZULIP_COM_STAGING)
|
2015-08-21 18:49:56 +02:00
|
|
|
if not ZULIP_COM:
|
2016-07-20 05:45:50 +02:00
|
|
|
raise Exception("You should create your own local settings from prod_settings_template.")
|
2013-11-12 18:20:05 +01:00
|
|
|
|
2013-09-24 20:28:28 +02:00
|
|
|
ZULIP_FRIENDS_LIST_ID = '84b2f3da6b'
|
2016-07-19 06:49:47 +02:00
|
|
|
SHOW_OSS_ANNOUNCEMENT = True
|
2016-07-19 06:52:34 +02:00
|
|
|
REGISTER_LINK_DISABLED = True
|
2016-07-19 06:56:45 +02:00
|
|
|
CUSTOM_LOGO_URL = "/static/images/logo/zulip-dropbox.png"
|
2016-07-19 07:31:59 +02:00
|
|
|
VERBOSE_SUPPORT_OFFERS = True
|
2013-09-24 20:28:28 +02:00
|
|
|
|
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
|
|
|
|
|
|
|
DEFAULT_FROM_EMAIL = "Zulip <zulip@zulip.com>"
|
|
|
|
# The noreply address to be used as Reply-To for certain generated emails.
|
2017-05-05 09:04:36 +02:00
|
|
|
NOREPLY_EMAIL_ADDRESS = "Zulip <noreply@zulip.com>"
|
2016-07-19 07:37:53 +02:00
|
|
|
WELCOME_EMAIL_SENDER = {'email': 'wdaher@zulip.com', 'name': 'Waseem Daher'}
|
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'
|
2016-07-19 06:41:55 +02:00
|
|
|
STAGING_ERROR_NOTIFICATIONS = True
|
2016-07-19 06:44:48 +02:00
|
|
|
SAVE_FRONTEND_STACKTRACES = True
|
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
|
|
|
|
2016-05-11 19:29:29 +02:00
|
|
|
# Terms of Service
|
2016-08-12 01:39:43 +02:00
|
|
|
TERMS_OF_SERVICE = 'corporate/terms.md'
|
2016-08-10 03:05:26 +02:00
|
|
|
# Major version number (the stuff before the first '.') has to be an integer.
|
|
|
|
# Users will be asked to re-sign the TOS only when the major version number increases.
|
|
|
|
# A TOS_VERSION of None has a major version number of -1.
|
|
|
|
# TOS_VERSION = '1.0'
|
|
|
|
# FIRST_TIME_TOS_TEMPLATE = 'zulipchat_migration_tos.html'
|
2016-05-11 19:29:29 +02:00
|
|
|
|
2015-09-30 03:10:17 +02:00
|
|
|
# Buckets used for Amazon S3 integration for storing files and user avatars.
|
2015-08-21 11:24:18 +02:00
|
|
|
S3_AUTH_UPLOADS_BUCKET = "zulip-user-uploads"
|
2016-11-28 23:29:01 +01:00
|
|
|
S3_AVATAR_BUCKET = "humbug-user-avatars"
|
2015-08-21 11:24:18 +02:00
|
|
|
|
2016-08-03 10:41:39 +02:00
|
|
|
APNS_SANDBOX = False
|
2015-08-21 11:24:18 +02:00
|
|
|
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
|
|
|
|
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
|
|
|
# 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"
|
2016-07-19 07:04:14 +02:00
|
|
|
EMAIL_GATEWAY_EXTRA_PATTERN_HACK = r'@[\w-]*\.zulip\.net'
|
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"
|
|
|
|
|
|
|
|
|
2017-05-23 23:04:54 +02:00
|
|
|
SSO_APPEND_DOMAIN = None # type: Optional[str]
|
2013-11-04 23:16:46 +01:00
|
|
|
|
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'),
|
|
|
|
)
|
2016-04-27 06:28:51 +02:00
|
|
|
|
|
|
|
EXTRA_INSTALLED_APPS = [
|
|
|
|
'analytics',
|
|
|
|
'zilencer',
|
2016-04-27 06:39:34 +02:00
|
|
|
'corporate',
|
2016-04-27 06:28:51 +02:00
|
|
|
]
|
2016-08-12 20:09:38 +02:00
|
|
|
|
|
|
|
EVENT_LOGS_ENABLED = True
|
2017-05-07 20:15:51 +02:00
|
|
|
SYSTEM_ONLY_REALMS = set() # type: Set[str]
|