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")
|
|
|
|
|
|
|
|
# Whether we're running in a production environment. Note that DEPLOYED does
|
|
|
|
# **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'
|
|
|
|
|
|
|
|
ENTERPRISE = DEPLOYED and config_file.get('machine', 'deploy_type') == 'enterprise'
|
|
|
|
|
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"
|
|
|
|
|
2013-09-07 00:27:10 +02:00
|
|
|
if TESTING_DEPLOYED:
|
|
|
|
EXTERNAL_HOST = platform.node()
|
|
|
|
elif STAGING_DEPLOYED:
|
|
|
|
EXTERNAL_HOST = 'staging.zulip.com'
|
|
|
|
elif DEPLOYED:
|
|
|
|
EXTERNAL_HOST = 'zulip.com'
|
2013-12-18 21:00:08 +01:00
|
|
|
EXTERNAL_API_PATH = 'api.zulip.com'
|
2015-08-21 08:19:57 +02:00
|
|
|
|
2013-09-07 00:27:10 +02:00
|
|
|
|
2013-11-12 18:14:02 +01:00
|
|
|
# For now, ENTERPRISE is only testing, so write to our test buckets
|
|
|
|
if DEPLOYED and not ENTERPRISE:
|
2013-09-24 20:28:28 +02:00
|
|
|
S3_BUCKET="humbug-user-uploads"
|
2013-10-23 16:46:18 +02:00
|
|
|
S3_AUTH_UPLOADS_BUCKET = "zulip-user-uploads"
|
2013-09-24 20:28:28 +02:00
|
|
|
S3_AVATAR_BUCKET="humbug-user-avatars"
|
|
|
|
else:
|
|
|
|
S3_BUCKET="humbug-user-uploads-test"
|
2013-10-23 16:46:18 +02:00
|
|
|
S3_AUTH_UPLOADS_BUCKET = "zulip-user-uploads-test"
|
2013-09-24 20:28:28 +02:00
|
|
|
S3_AVATAR_BUCKET="humbug-user-avatars-test"
|
|
|
|
|
2014-01-22 19:22:20 +01:00
|
|
|
if DEPLOYED or STAGING_DEPLOYED:
|
2013-10-23 20:29:07 +02:00
|
|
|
APNS_SANDBOX = "push_production"
|
|
|
|
APNS_FEEDBACK = "feedback_production"
|
|
|
|
APNS_CERT_FILE = "/etc/ssl/django-private/apns-dist.pem"
|
2015-02-10 08:08:47 +01:00
|
|
|
DBX_APNS_CERT_FILE = "/etc/ssl/django-private/dbx-apns-dist.pem"
|
2013-10-23 20:29:07 +02:00
|
|
|
else:
|
|
|
|
APNS_SANDBOX = "push_sandbox"
|
|
|
|
APNS_FEEDBACK = "feedback_sandbox"
|
|
|
|
APNS_CERT_FILE = "/etc/ssl/django-private/apns-dev.pem"
|
2015-02-10 08:08:47 +01:00
|
|
|
DBX_APNS_CERT_FILE = "/etc/ssl/django-private/dbx-apns-dev.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-01-29 08:59:41 +01:00
|
|
|
if DEPLOYED:
|
2015-01-29 09:00:23 +01:00
|
|
|
GOOGLE_OAUTH2_CLIENT_ID = '835904834568-ag4p18v0sd9a0tero14r3gekn6shoen3.apps.googleusercontent.com'
|
2015-01-29 08:59:41 +01:00
|
|
|
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'
|
|
|
|
|
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.
|
|
|
|
if STAGING_DEPLOYED:
|
|
|
|
EMAIL_GATEWAY_PATTERN = "%s@streams.staging.zulip.com"
|
|
|
|
elif DEPLOYED:
|
|
|
|
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
|
|
|
|
2013-10-29 22:21:17 +01:00
|
|
|
|
2014-03-28 00:49:20 +01:00
|
|
|
JWT_AUTH_KEYS = {}
|
|
|
|
|
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
|
|
|
|
|
|
|
# TODO: Store this info in the database
|
2013-11-12 23:31:52 +01:00
|
|
|
# Also note -- the email gateway bot is automatically added.
|
|
|
|
API_SUPER_USERS = set(["tabbott/extra@mit.edu",
|
|
|
|
"irc-bot@zulip.com",
|
2014-03-04 23:43:39 +01:00
|
|
|
"bot1@customer35.invalid",
|
2014-09-10 20:17:55 +02:00
|
|
|
"bot1@customer36.invalid",
|
|
|
|
"hipchat-bot@zulip.com",])
|
2013-11-13 19:55:04 +01:00
|
|
|
|
|
|
|
ADMINS = (
|
|
|
|
('Zulip Error Reports', 'errors@zulip.com'),
|
|
|
|
)
|