2013-09-24 20:28:28 +02:00
|
|
|
# Secret Django settings for the Zulip project
|
|
|
|
import platform
|
2013-11-01 00:00:30 +01:00
|
|
|
import ConfigParser
|
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
|
|
|
# Make this unique, and don't share it with anybody.
|
|
|
|
SECRET_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
|
|
|
|
|
|
|
# A fixed salt used for hashing in certain places, e.g. email-based
|
|
|
|
# username generation.
|
|
|
|
HASH_SALT = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
|
|
|
|
|
|
|
# Use this salt to hash a user's email into a filename for their user-uploaded
|
|
|
|
# avatar. If this salt is discovered, attackers will only be able to determine
|
|
|
|
# that the owner of an email account has uploaded an avatar to Zulip, which isn't
|
|
|
|
# the end of the world. Don't use the salt where there is more security exposure.
|
|
|
|
AVATAR_SALT = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
|
|
|
|
|
|
|
# Used just for generating initial passwords (only used in testing environments).
|
2013-11-12 18:20:05 +01:00
|
|
|
if not DEPLOYED:
|
|
|
|
INITIAL_PASSWORD_SALT = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
2013-09-24 20:28:28 +02:00
|
|
|
|
|
|
|
# A shared secret, used to authenticate different parts of the app to each other.
|
|
|
|
# FIXME: store this password more securely
|
|
|
|
SHARED_SECRET = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
|
|
|
|
|
|
|
RABBITMQ_PASSWORD = 'xxxxxxxxxxxxxxxx'
|
|
|
|
|
|
|
|
MAILCHIMP_API_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-us4'
|
|
|
|
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'
|
|
|
|
DEPLOYMENT_ROLE_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
2013-10-10 02:16:51 +02:00
|
|
|
|
2013-10-07 17:35:22 +02:00
|
|
|
# This comes from our mandrill accounts page
|
|
|
|
MANDRILL_API_KEY = 'xxxxxxxxxxxxxxxxxxxxxx'
|
|
|
|
|
2013-09-24 20:28:28 +02:00
|
|
|
# This should be synced with our camo installation
|
|
|
|
CAMO_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
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_HOST_PASSWORD = 'xxxxxxxxxxxxxxxx'
|
|
|
|
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-12-04 20:38:01 +01:00
|
|
|
if DEPLOYED:
|
|
|
|
EXTERNAL_URI_SCHEME = "https://"
|
|
|
|
else:
|
|
|
|
EXTERNAL_URI_SCHEME = "http://"
|
|
|
|
|
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'
|
|
|
|
else:
|
|
|
|
EXTERNAL_HOST = 'localhost:9991'
|
2013-12-04 20:38:01 +01:00
|
|
|
EXTERNAL_API_PATH = 'localhost:9991/api'
|
2013-09-07 00:27:10 +02:00
|
|
|
|
2013-09-24 20:28:28 +02:00
|
|
|
EMBEDLY_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
|
|
|
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_KEY="xxxxxxxxxxxxxxxxxxxx"
|
|
|
|
S3_SECRET_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
|
|
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"
|
|
|
|
|
|
|
|
MIXPANEL_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
|
|
else:
|
|
|
|
S3_KEY="xxxxxxxxxxxxxxxxxxxx"
|
|
|
|
S3_SECRET_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
|
|
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"
|
|
|
|
|
|
|
|
MIXPANEL_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
2013-09-25 21:51:23 +02:00
|
|
|
LOCAL_DATABASE_PASSWORD="xxxxxxxxxxxx"
|
2013-09-24 20:38:12 +02:00
|
|
|
|
|
|
|
# Twitter API credentials
|
|
|
|
if STAGING_DEPLOYED or TESTING_DEPLOYED:
|
|
|
|
# Application: "Humbug HQ"
|
|
|
|
TWITTER_CONSUMER_KEY = "xxxxxxxxxxxxxxxxxxxxxx"
|
|
|
|
TWITTER_CONSUMER_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
|
|
TWITTER_ACCESS_TOKEN_KEY = "xxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
2013-09-30 23:01:51 +02:00
|
|
|
TWITTER_ACCESS_TOKEN_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
2013-11-12 18:14:02 +01:00
|
|
|
elif DEPLOYED and not ENTERPRISE:
|
2013-09-24 20:38:12 +02:00
|
|
|
# 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"
|
|
|
|
TWITTER_CONSUMER_KEY = "xxxxxxxxxxxxxxxxxxxxx"
|
|
|
|
TWITTER_CONSUMER_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
|
|
TWITTER_ACCESS_TOKEN_KEY = "xxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
|
|
TWITTER_ACCESS_TOKEN_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
|
|
else:
|
|
|
|
# Application: "Humbug HQ Test"
|
|
|
|
TWITTER_CONSUMER_KEY = "xxxxxxxxxxxxxxxxxxxxxx"
|
|
|
|
TWITTER_CONSUMER_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
|
|
TWITTER_ACCESS_TOKEN_KEY = "xxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
|
|
TWITTER_ACCESS_TOKEN_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
2013-10-23 20:29:07 +02:00
|
|
|
|
|
|
|
if STAGING_DEPLOYED:
|
|
|
|
APNS_SANDBOX = "push_sandbox"
|
|
|
|
APNS_FEEDBACK = "feedback_sandbox"
|
|
|
|
APNS_CERT_FILE = "/etc/ssl/django-private/apns-dev.pem"
|
|
|
|
elif DEPLOYED:
|
|
|
|
APNS_SANDBOX = "push_production"
|
|
|
|
APNS_FEEDBACK = "feedback_production"
|
|
|
|
APNS_CERT_FILE = "/etc/ssl/django-private/apns-dist.pem"
|
|
|
|
else:
|
|
|
|
APNS_SANDBOX = "push_sandbox"
|
|
|
|
APNS_FEEDBACK = "feedback_sandbox"
|
|
|
|
APNS_CERT_FILE = "/etc/ssl/django-private/apns-dev.pem"
|
2013-10-08 21:02:47 +02:00
|
|
|
|
|
|
|
# Administrator domain for this install
|
|
|
|
ADMIN_DOMAIN = "zulip.com"
|
|
|
|
|
|
|
|
# Email mirror configuration
|
|
|
|
# The email of the Zulip bot that the email gateway
|
|
|
|
# should post as
|
2013-10-31 18:33:19 +01:00
|
|
|
EMAIL_GATEWAY_BOT = "emailgateway@zulip.com"
|
2013-10-08 21:02:47 +02:00
|
|
|
|
|
|
|
EMAIL_GATEWAY_LOGIN = "emailgateway@zulip.com"
|
|
|
|
EMAIL_GATEWAY_PASSWORD = "xxxxxxxxxxxxxxxx"
|
|
|
|
EMAIL_GATEWAY_IMAP_SERVER = "imap.gmail.com"
|
|
|
|
EMAIL_GATEWAY_IMAP_PORT = 993
|
2013-11-13 17:07:05 +01:00
|
|
|
if DEPLOYED:
|
|
|
|
EMAIL_GATEWAY_IMAP_FOLDER = "INBOX"
|
|
|
|
else:
|
|
|
|
# For local testing, only try to process messages in the Test folder.
|
|
|
|
EMAIL_GATEWAY_IMAP_FOLDER = "Test"
|
2013-10-08 21:02:47 +02:00
|
|
|
|
|
|
|
# The email address pattern to use for auto-generated stream emails
|
|
|
|
# The %s will be replaced with a unique token, and the resulting email
|
|
|
|
# must be delivered to the Inbox of the EMAIL_GATEWAY_LOGIN account above
|
|
|
|
EMAIL_GATEWAY_PATTERN = "%s@streams.zulip.com"
|
2013-10-29 22:21:17 +01:00
|
|
|
|
2013-11-04 23:16:46 +01:00
|
|
|
SSO_APPEND_DOMAIN = None
|
|
|
|
|
|
|
|
AUTHENTICATION_BACKENDS = ('zproject.backends.EmailAuthBackend',
|
|
|
|
'zproject.backends.GoogleBackend')
|
|
|
|
|
2013-10-29 22:21:17 +01:00
|
|
|
|
|
|
|
DROPBOX_APP_KEY = "xxxxxxxxxxxxxxx"
|
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",
|
|
|
|
"bot1@customer35.invalid"])
|
2013-11-13 19:55:04 +01:00
|
|
|
|
|
|
|
ADMINS = (
|
|
|
|
('Zulip Error Reports', 'errors@zulip.com'),
|
|
|
|
)
|