2012-08-28 18:44:51 +02:00
|
|
|
# Django settings for humbug project.
|
2012-08-28 18:45:32 +02:00
|
|
|
import os
|
2012-09-17 23:30:29 +02:00
|
|
|
import platform
|
2013-03-26 22:08:25 +01:00
|
|
|
import time
|
2013-06-05 17:10:25 +02:00
|
|
|
import re
|
2012-08-28 18:44:51 +02:00
|
|
|
|
2013-02-20 22:26:06 +01:00
|
|
|
from zephyr.openid import openid_failure_handler
|
|
|
|
|
2013-03-26 22:08:25 +01:00
|
|
|
SERVER_GENERATION = int(time.time())
|
|
|
|
|
2013-07-22 21:52:22 +02:00
|
|
|
DEPLOYED = (('zulip.net' in platform.node())
|
2012-10-27 17:11:30 +02:00
|
|
|
or os.path.exists('/etc/humbug-server'))
|
2013-07-14 06:11:00 +02:00
|
|
|
STAGING_DEPLOYED = (platform.node() == 'staging.zulip.net')
|
2013-06-05 17:10:25 +02:00
|
|
|
TESTING_DEPLOYED = not not re.match(r'^test', platform.node())
|
2012-09-17 23:30:29 +02:00
|
|
|
|
Reuse minified JS from previous deploys
This is a big change affecting lots of areas:
* Pipeline no longer deals with JS (though it still minifies CSS)
* A new script, tools/minify-js (called from update-prod-static),
minifies JavaScripts
* A command-line argument --prev-deploy, if passed to minify-js or
update-prod-static, is used to copy minified JS from a previous
deploy (i.e., a previous git checkout), if the source files have
not changed
* update-deployment passes --prev-deploy
* Scripts are now included with the minified_js template tag, rather
than Pipeline's compressed_js
Also, as a side benefit of this commit, our Handlebars templates will
no longer be copied into prod-static/ and accessible in production.
Unminification is probably broken, but, per Zev and Trac ticket #1377,
it wasn't working perfectly before this change either.
(Based on code review, this commit has been revised to:
* Warn if git returns an error in minify-js
* Add missing output redirects in update-prod-static
* Use DEPLOY_ROOT instead of manually constructing that directory
* Use old style formatting)
(imported from commit e67722ea252756db8519d5c0bd6a421d59374185)
2013-07-03 22:42:25 +02:00
|
|
|
# Uncomment end of next line to test JS/CSS minification.
|
|
|
|
DEBUG = not DEPLOYED # and platform.node() != 'your-machine'
|
2012-08-28 18:44:51 +02:00
|
|
|
TEMPLATE_DEBUG = DEBUG
|
2013-01-11 21:16:42 +01:00
|
|
|
TEST_SUITE = False
|
2012-08-28 18:44:51 +02:00
|
|
|
|
2012-09-19 22:25:13 +02:00
|
|
|
if DEBUG:
|
|
|
|
INTERNAL_IPS = ('127.0.0.1',)
|
2013-06-05 17:10:25 +02:00
|
|
|
if DEPLOYED and not TESTING_DEPLOYED:
|
2013-07-22 21:52:22 +02:00
|
|
|
# The IP addresses are for app.zulip.{com,net} and staging.zulip.{com,net}
|
|
|
|
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.245.120.64', '54.213.44.83', '.zulip.com', '.zulip.net']
|
2013-06-05 17:10:25 +02:00
|
|
|
elif TESTING_DEPLOYED:
|
|
|
|
# Allow any hosts for our test instances, to reduce 500 spam
|
|
|
|
ALLOWED_HOSTS = ['*']
|
2013-03-26 22:35:53 +01:00
|
|
|
else:
|
|
|
|
ALLOWED_HOSTS = ['localhost']
|
2012-09-19 22:25:13 +02:00
|
|
|
|
2012-08-28 18:44:51 +02:00
|
|
|
ADMINS = (
|
2013-07-11 16:45:53 +02:00
|
|
|
('Zulip Error Reports', 'errors@zulip.com'),
|
2012-08-28 18:44:51 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
MANAGERS = ADMINS
|
|
|
|
|
2013-03-05 22:58:39 +01:00
|
|
|
DATABASES = {"default": {
|
|
|
|
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
|
|
|
'NAME': 'humbug',
|
|
|
|
'USER': 'humbug',
|
|
|
|
'PASSWORD': '', # Authentication done via certificates
|
2013-03-18 21:53:13 +01:00
|
|
|
'HOST': 'postgres.humbughq.com',
|
2013-03-05 22:58:39 +01:00
|
|
|
'SCHEMA': 'humbug',
|
|
|
|
'OPTIONS': {
|
2013-03-18 21:53:13 +01:00
|
|
|
'sslmode': 'verify-full',
|
2012-09-14 19:22:56 +02:00
|
|
|
},
|
2012-09-14 19:17:26 +02:00
|
|
|
},
|
2012-09-14 22:29:53 +02:00
|
|
|
}
|
|
|
|
|
2013-03-05 22:58:39 +01:00
|
|
|
if not DEPLOYED:
|
2013-06-12 16:46:25 +02:00
|
|
|
DATABASES["default"].update({
|
|
|
|
'PASSWORD': 'xxxxxxxxxxxx',
|
|
|
|
'HOST': 'localhost',
|
|
|
|
'OPTIONS': {}
|
|
|
|
})
|
|
|
|
INTERNAL_HUMBUG_USERS = []
|
2012-08-28 18:44:51 +02:00
|
|
|
|
|
|
|
# Local time zone for this installation. Choices can be found here:
|
|
|
|
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
|
|
|
|
# although not all choices may be available on all operating systems.
|
|
|
|
# In a Windows environment this must be set to your system time zone.
|
2012-09-12 22:40:18 +02:00
|
|
|
TIME_ZONE = 'America/New_York'
|
2012-08-28 18:44:51 +02:00
|
|
|
|
|
|
|
# Language code for this installation. All choices can be found here:
|
|
|
|
# http://www.i18nguy.com/unicode/language-identifiers.html
|
|
|
|
LANGUAGE_CODE = 'en-us'
|
|
|
|
|
2012-11-01 23:11:32 +01:00
|
|
|
# The ID, as an integer, of the current site in the django_site database table.
|
|
|
|
# This is used so that application data can hook into specific site(s) and a
|
|
|
|
# single database can manage content for multiple sites.
|
|
|
|
#
|
2013-07-22 21:52:22 +02:00
|
|
|
# We set this site's domain to 'zulip.com' in populate_db.
|
2012-08-28 18:44:51 +02:00
|
|
|
SITE_ID = 1
|
|
|
|
|
|
|
|
# If you set this to False, Django will make some optimizations so as not
|
|
|
|
# to load the internationalization machinery.
|
|
|
|
USE_I18N = True
|
|
|
|
|
|
|
|
# If you set this to False, Django will not format dates, numbers and
|
|
|
|
# calendars according to the current locale.
|
|
|
|
USE_L10N = True
|
|
|
|
|
|
|
|
# If you set this to False, Django will not use timezone-aware datetimes.
|
|
|
|
USE_TZ = True
|
|
|
|
|
2013-06-24 20:56:44 +02:00
|
|
|
DEPLOY_ROOT = os.path.join(os.path.realpath(os.path.dirname(__file__)), '..')
|
|
|
|
TEMPLATE_DIRS = ( os.path.join(DEPLOY_ROOT, 'templates'), )
|
2012-08-28 18:44:51 +02:00
|
|
|
|
|
|
|
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
|
|
|
# trailing slash.
|
|
|
|
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
|
|
|
|
MEDIA_URL = ''
|
|
|
|
|
|
|
|
# Make this unique, and don't share it with anybody.
|
|
|
|
SECRET_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
|
|
|
|
2012-09-21 17:08:02 +02:00
|
|
|
# A fixed salt used for hashing in certain places, e.g. email-based
|
|
|
|
# username generation.
|
|
|
|
HASH_SALT = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
2012-09-19 19:39:34 +02:00
|
|
|
|
2013-06-10 21:35:48 +02:00
|
|
|
# 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 Humbug, which isn't
|
|
|
|
# the end of the world. Don't use the salt where there is more security exposure.
|
|
|
|
AVATAR_SALT = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
|
|
|
|
2012-10-17 22:35:35 +02:00
|
|
|
# Tell the browser to never send our cookies without encryption, e.g.
|
|
|
|
# when executing the initial http -> https redirect.
|
|
|
|
#
|
|
|
|
# Turn it off for local testing because we don't have SSL.
|
2012-12-11 22:07:57 +01:00
|
|
|
if DEPLOYED:
|
2012-10-17 22:35:35 +02:00
|
|
|
SESSION_COOKIE_SECURE = True
|
|
|
|
CSRF_COOKIE_SECURE = True
|
|
|
|
|
2012-10-26 21:57:13 +02:00
|
|
|
# Prevent Javascript from reading the CSRF token from cookies. Our code gets
|
|
|
|
# the token from the DOM, which means malicious code could too. But hiding the
|
|
|
|
# cookie will slow down some attackers.
|
|
|
|
CSRF_COOKIE_PATH = '/;HttpOnly'
|
|
|
|
|
2013-05-28 23:59:55 +02:00
|
|
|
# Used just for generating initial passwords (only used in testing environments).
|
2012-10-10 16:59:59 +02:00
|
|
|
INITIAL_PASSWORD_SALT = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
|
|
|
|
2012-10-09 22:21:03 +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'
|
|
|
|
|
2012-11-08 21:49:04 +01:00
|
|
|
# Base URL of the Tornado server
|
2012-11-08 23:23:25 +01:00
|
|
|
# We set it to None when running backend tests or populate_db.
|
|
|
|
# We override the port number when running frontend tests.
|
2012-11-08 21:49:04 +01:00
|
|
|
TORNADO_SERVER = 'http://localhost:9993'
|
2013-01-09 22:45:23 +01:00
|
|
|
RUNNING_INSIDE_TORNADO = False
|
2012-10-09 22:21:03 +02:00
|
|
|
|
2012-10-09 23:52:48 +02:00
|
|
|
# Make redirects work properly behind a reverse proxy
|
|
|
|
USE_X_FORWARDED_HOST = True
|
|
|
|
|
2012-08-28 18:44:51 +02:00
|
|
|
# List of callables that know how to import templates from various sources.
|
|
|
|
TEMPLATE_LOADERS = (
|
|
|
|
'django.template.loaders.filesystem.Loader',
|
|
|
|
'django.template.loaders.app_directories.Loader',
|
|
|
|
)
|
|
|
|
|
|
|
|
MIDDLEWARE_CLASSES = (
|
2012-11-14 21:00:26 +01:00
|
|
|
# Our logging middleware should be the first middleware item.
|
|
|
|
'zephyr.middleware.LogRequests',
|
2012-12-19 20:19:46 +01:00
|
|
|
'zephyr.middleware.JsonErrorHandler',
|
2013-05-29 23:58:07 +02:00
|
|
|
'zephyr.middleware.RateLimitMiddleware',
|
2012-08-28 18:44:51 +02:00
|
|
|
'django.middleware.common.CommonMiddleware',
|
|
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
|
|
)
|
|
|
|
|
2013-02-20 22:26:06 +01:00
|
|
|
AUTHENTICATION_BACKENDS = ('humbug.backends.EmailAuthBackend',
|
2013-06-22 00:05:48 +02:00
|
|
|
'humbug.backends.GoogleBackend',
|
|
|
|
'guardian.backends.ObjectPermissionBackend')
|
|
|
|
ANONYMOUS_USER_ID = None
|
|
|
|
|
2013-04-04 19:02:47 +02:00
|
|
|
AUTH_USER_MODEL = "zephyr.UserProfile"
|
2012-09-21 16:10:36 +02:00
|
|
|
|
2012-11-14 20:50:47 +01:00
|
|
|
TEST_RUNNER = 'zephyr.tests.Runner'
|
|
|
|
|
2012-08-28 18:44:51 +02:00
|
|
|
ROOT_URLCONF = 'humbug.urls'
|
|
|
|
|
|
|
|
# Python dotted path to the WSGI application used by Django's runserver.
|
|
|
|
WSGI_APPLICATION = 'humbug.wsgi.application'
|
|
|
|
|
|
|
|
INSTALLED_APPS = (
|
|
|
|
'django.contrib.auth',
|
2013-01-16 21:36:32 +01:00
|
|
|
'humbug.authhack',
|
2012-08-28 18:44:51 +02:00
|
|
|
'django.contrib.contenttypes',
|
|
|
|
'django.contrib.sessions',
|
|
|
|
'django.contrib.sites',
|
2013-01-30 23:11:34 +01:00
|
|
|
'django.contrib.staticfiles',
|
2013-01-02 19:42:00 +01:00
|
|
|
'south',
|
2013-02-20 22:26:06 +01:00
|
|
|
'django_openid_auth',
|
2012-09-28 22:47:05 +02:00
|
|
|
'confirmation',
|
2013-06-22 00:05:48 +02:00
|
|
|
'guardian',
|
2013-01-30 23:11:34 +01:00
|
|
|
'pipeline',
|
2012-08-28 18:44:51 +02:00
|
|
|
'zephyr',
|
|
|
|
)
|
|
|
|
|
2013-04-16 22:51:14 +02:00
|
|
|
LOCAL_STATSD = (False)
|
2013-06-05 17:10:25 +02:00
|
|
|
USING_STATSD = (DEPLOYED and not TESTING_DEPLOYED) or LOCAL_STATSD
|
2013-04-16 22:51:14 +02:00
|
|
|
|
|
|
|
if USING_STATSD:
|
|
|
|
if LOCAL_STATSD:
|
|
|
|
STATSD_HOST = 'localhost'
|
|
|
|
else:
|
2013-04-26 23:44:01 +02:00
|
|
|
STATSD_HOST = '10.252.2.167'
|
2013-04-16 22:51:14 +02:00
|
|
|
|
|
|
|
INSTALLED_APPS = ('django_statsd',) + INSTALLED_APPS
|
|
|
|
STATSD_PORT = 8125
|
|
|
|
STATSD_CLIENT = 'django_statsd.clients.normal'
|
|
|
|
|
|
|
|
if STAGING_DEPLOYED:
|
|
|
|
STATSD_PREFIX = 'staging'
|
|
|
|
elif DEPLOYED:
|
|
|
|
STATSD_PREFIX = 'app'
|
|
|
|
else:
|
|
|
|
STATSD_PREFIX = 'user'
|
2013-01-30 23:11:34 +01:00
|
|
|
|
2013-05-29 23:58:07 +02:00
|
|
|
RATE_LIMITING = True
|
|
|
|
REDIS_HOST = '127.0.0.1'
|
|
|
|
REDIS_PORT = 6379
|
|
|
|
|
|
|
|
RATE_LIMITING_RULES = [
|
|
|
|
(60, 100), # 100 requests max every minute
|
|
|
|
]
|
|
|
|
|
2013-01-30 23:11:34 +01:00
|
|
|
# Static files and minification
|
|
|
|
|
|
|
|
STATIC_URL = '/static/'
|
|
|
|
|
2013-06-20 19:44:44 +02:00
|
|
|
# HumbugStorage is a modified version of PipelineCachedStorage,
|
|
|
|
# and, like that class, it inserts a file hash into filenames
|
2013-02-24 19:28:43 +01:00
|
|
|
# to prevent the browser from using stale files from cache.
|
2013-02-25 23:19:20 +01:00
|
|
|
#
|
|
|
|
# Unlike PipelineStorage, it requires the files to exist in
|
|
|
|
# STATIC_ROOT even for dev servers. So we only use
|
2013-06-20 19:44:44 +02:00
|
|
|
# HumbugStorage when not DEBUG.
|
2013-02-25 23:19:20 +01:00
|
|
|
|
2013-07-26 20:14:54 +02:00
|
|
|
# This is the default behavior from Pipeline, but we set it
|
|
|
|
# here so that urls.py can read it.
|
|
|
|
PIPELINE = not DEBUG
|
|
|
|
|
2013-02-25 23:19:20 +01:00
|
|
|
if DEBUG:
|
|
|
|
STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'
|
2013-06-12 19:33:53 +02:00
|
|
|
STATICFILES_FINDERS = (
|
|
|
|
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
|
|
|
)
|
2013-07-26 20:14:54 +02:00
|
|
|
if PIPELINE:
|
|
|
|
STATIC_ROOT = 'prod-static/serve'
|
|
|
|
else:
|
|
|
|
STATIC_ROOT = 'static/'
|
2013-02-25 23:19:20 +01:00
|
|
|
else:
|
2013-06-12 00:01:13 +02:00
|
|
|
STATICFILES_STORAGE = 'zephyr.storage.HumbugStorage'
|
2013-06-12 19:33:53 +02:00
|
|
|
STATICFILES_FINDERS = (
|
|
|
|
'zephyr.finders.HumbugFinder',
|
|
|
|
)
|
2013-06-12 19:56:12 +02:00
|
|
|
if DEPLOYED:
|
|
|
|
STATIC_ROOT = '/home/humbug/prod-static'
|
|
|
|
else:
|
|
|
|
STATIC_ROOT = 'prod-static/serve'
|
2013-01-30 23:11:34 +01:00
|
|
|
|
2013-07-25 22:41:44 +02:00
|
|
|
STATICFILES_DIRS = ['static/']
|
2013-06-12 00:01:13 +02:00
|
|
|
STATIC_HEADER_FILE = 'zephyr/static_header.txt'
|
2013-01-30 23:11:34 +01:00
|
|
|
|
2013-06-24 16:45:57 +02:00
|
|
|
# To use minified files in dev, set PIPELINE = True. For the full
|
|
|
|
# cache-busting behavior, you must also set DEBUG = False.
|
2013-02-24 19:57:01 +01:00
|
|
|
#
|
2013-06-24 16:45:57 +02:00
|
|
|
# You will need to run ./tools/update-prod-static after changing
|
|
|
|
# static files.
|
2013-02-24 19:57:01 +01:00
|
|
|
|
2013-01-30 23:11:34 +01:00
|
|
|
PIPELINE_CSS = {
|
2013-02-25 02:59:59 +01:00
|
|
|
'activity': {
|
|
|
|
'source_filenames': ('styles/activity.css',),
|
|
|
|
'output_filename': 'min/activity.css'
|
|
|
|
},
|
|
|
|
'portico': {
|
|
|
|
'source_filenames': (
|
2013-05-28 21:46:16 +02:00
|
|
|
'third/zocial/zocial.css',
|
2013-02-25 02:59:59 +01:00
|
|
|
'styles/portico.css',
|
|
|
|
'styles/pygments.css',
|
2013-07-23 00:18:28 +02:00
|
|
|
'styles/thirdparty-fonts.css',
|
2013-04-22 00:50:18 +02:00
|
|
|
'styles/fonts.css',
|
2013-02-25 02:59:59 +01:00
|
|
|
),
|
|
|
|
'output_filename': 'min/portico.css'
|
|
|
|
},
|
2013-07-01 20:13:26 +02:00
|
|
|
# Two versions of the app CSS exist because of QTBUG-3467
|
|
|
|
'app-fontcompat': {
|
|
|
|
'source_filenames': (
|
|
|
|
'third/bootstrap-notify/css/bootstrap-notify.css',
|
|
|
|
'third/spectrum/spectrum.css',
|
2013-07-25 22:34:39 +02:00
|
|
|
'styles/zulip.css',
|
2013-07-01 20:13:26 +02:00
|
|
|
'styles/pygments.css',
|
|
|
|
'styles/thirdparty-fonts.css',
|
|
|
|
# We don't want fonts.css on QtWebKit, so its omitted here
|
|
|
|
),
|
|
|
|
'output_filename': 'min/app-fontcompat.css'
|
|
|
|
},
|
2013-01-30 23:11:34 +01:00
|
|
|
'app': {
|
|
|
|
'source_filenames': (
|
2013-06-19 01:41:27 +02:00
|
|
|
'third/bootstrap-notify/css/bootstrap-notify.css',
|
2013-05-28 21:46:16 +02:00
|
|
|
'third/spectrum/spectrum.css',
|
2013-07-25 22:34:39 +02:00
|
|
|
'styles/zulip.css',
|
2013-01-30 23:11:34 +01:00
|
|
|
'styles/pygments.css',
|
2013-07-01 20:13:26 +02:00
|
|
|
'styles/thirdparty-fonts.css',
|
2013-04-22 00:50:18 +02:00
|
|
|
'styles/fonts.css',
|
2013-01-30 23:11:34 +01:00
|
|
|
),
|
|
|
|
'output_filename': 'min/app.css'
|
|
|
|
},
|
2013-05-28 21:46:16 +02:00
|
|
|
'common': {
|
2013-04-06 00:19:32 +02:00
|
|
|
'source_filenames': (
|
|
|
|
'third/bootstrap/css/bootstrap.css',
|
|
|
|
'third/bootstrap/css/bootstrap-responsive.css',
|
|
|
|
),
|
2013-05-28 21:46:16 +02:00
|
|
|
'output_filename': 'min/common.css'
|
2013-04-06 00:19:32 +02:00
|
|
|
},
|
2013-01-30 23:11:34 +01:00
|
|
|
}
|
|
|
|
|
Reuse minified JS from previous deploys
This is a big change affecting lots of areas:
* Pipeline no longer deals with JS (though it still minifies CSS)
* A new script, tools/minify-js (called from update-prod-static),
minifies JavaScripts
* A command-line argument --prev-deploy, if passed to minify-js or
update-prod-static, is used to copy minified JS from a previous
deploy (i.e., a previous git checkout), if the source files have
not changed
* update-deployment passes --prev-deploy
* Scripts are now included with the minified_js template tag, rather
than Pipeline's compressed_js
Also, as a side benefit of this commit, our Handlebars templates will
no longer be copied into prod-static/ and accessible in production.
Unminification is probably broken, but, per Zev and Trac ticket #1377,
it wasn't working perfectly before this change either.
(Based on code review, this commit has been revised to:
* Warn if git returns an error in minify-js
* Add missing output redirects in update-prod-static
* Use DEPLOY_ROOT instead of manually constructing that directory
* Use old style formatting)
(imported from commit e67722ea252756db8519d5c0bd6a421d59374185)
2013-07-03 22:42:25 +02:00
|
|
|
JS_SPECS = {
|
2013-02-25 02:59:59 +01:00
|
|
|
'common': {
|
2013-05-28 21:46:16 +02:00
|
|
|
'source_filenames': (
|
|
|
|
'third/jquery/jquery-1.7.2.js',
|
|
|
|
'js/blueslip.js',
|
|
|
|
'third/bootstrap/js/bootstrap.js',
|
|
|
|
'js/common.js',
|
2013-07-29 21:01:29 +02:00
|
|
|
'third/underscore/underscore.js',
|
2013-05-28 21:46:16 +02:00
|
|
|
),
|
2013-02-25 02:59:59 +01:00
|
|
|
'output_filename': 'min/common.js'
|
|
|
|
},
|
2013-05-17 21:45:37 +02:00
|
|
|
'landing-page': {
|
2013-05-28 21:46:16 +02:00
|
|
|
'source_filenames': (
|
|
|
|
'third/jquery-form/jquery.form.js',
|
|
|
|
'js/landing-page.js',
|
|
|
|
),
|
2013-05-17 21:45:37 +02:00
|
|
|
'output_filename': 'min/landing-page.js'
|
|
|
|
},
|
2013-02-25 02:59:59 +01:00
|
|
|
'signup': {
|
2013-05-28 21:46:16 +02:00
|
|
|
'source_filenames': (
|
|
|
|
'js/signup.js',
|
|
|
|
'third/jquery-validate/jquery.validate.js',
|
|
|
|
),
|
2013-02-25 02:59:59 +01:00
|
|
|
'output_filename': 'min/signup.js'
|
|
|
|
},
|
2013-07-11 21:40:52 +02:00
|
|
|
'initial_invite': {
|
|
|
|
'source_filenames': (
|
|
|
|
'third/jquery-validate/jquery.validate.js',
|
|
|
|
'js/initial_invite.js',
|
|
|
|
),
|
|
|
|
'output_filename': 'min/initial_invite.js'
|
|
|
|
},
|
2013-04-09 22:20:46 +02:00
|
|
|
'api': {
|
|
|
|
'source_filenames': ('js/api.js',),
|
|
|
|
'output_filename': 'min/api.js'
|
|
|
|
},
|
2013-02-25 02:59:59 +01:00
|
|
|
'app_debug': {
|
|
|
|
'source_filenames': ('js/debug.js',),
|
|
|
|
'output_filename': 'min/app_debug.js'
|
|
|
|
},
|
2013-01-30 23:11:34 +01:00
|
|
|
'app': {
|
2013-02-16 11:17:23 +01:00
|
|
|
'source_filenames': [
|
2013-06-19 01:41:27 +02:00
|
|
|
'third/bootstrap-notify/js/bootstrap-notify.js',
|
2013-06-25 21:54:24 +02:00
|
|
|
'third/html5-formdata/formdata.js',
|
2013-05-28 21:46:16 +02:00
|
|
|
'third/jquery-validate/jquery.validate.js',
|
|
|
|
'third/jquery-form/jquery.form.js',
|
|
|
|
'third/jquery-highlight/jquery.highlight.js',
|
|
|
|
'third/jquery-filedrop/jquery.filedrop.js',
|
|
|
|
'third/jquery-caret/jquery.caret.1.02.js',
|
|
|
|
'third/xdate/xdate.dev.js',
|
|
|
|
'third/spin/spin.js',
|
|
|
|
'third/jquery-mousewheel/jquery.mousewheel.js',
|
|
|
|
'third/jquery-throttle-debounce/jquery.ba-throttle-debounce.js',
|
|
|
|
'third/jquery-idle/jquery.idle.js',
|
|
|
|
'third/jquery-autosize/jquery.autosize.js',
|
|
|
|
'third/spectrum/spectrum.js',
|
|
|
|
('third/handlebars/handlebars.runtime.js'
|
|
|
|
if PIPELINE
|
|
|
|
else 'third/handlebars/handlebars.js'),
|
|
|
|
|
2013-08-01 17:59:23 +02:00
|
|
|
'js/feature_flags.js',
|
2013-01-30 23:11:34 +01:00
|
|
|
'js/util.js',
|
|
|
|
'js/setup.js',
|
2013-05-07 17:15:20 +02:00
|
|
|
'js/viewport.js',
|
2013-01-30 23:11:34 +01:00
|
|
|
'js/rows.js',
|
2013-05-17 21:32:26 +02:00
|
|
|
'js/unread.js',
|
2013-07-24 22:33:06 +02:00
|
|
|
'js/message_tour.js',
|
2013-05-06 02:54:15 +02:00
|
|
|
'js/stream_list.js',
|
2013-01-30 23:11:34 +01:00
|
|
|
'js/narrow.js',
|
|
|
|
'js/reload.js',
|
2013-01-30 21:49:56 +01:00
|
|
|
'js/notifications_bar.js',
|
2013-01-30 23:11:34 +01:00
|
|
|
'js/compose.js',
|
|
|
|
'js/subs.js',
|
2013-05-15 00:22:16 +02:00
|
|
|
'js/message_edit.js',
|
2013-01-30 23:11:34 +01:00
|
|
|
'js/ui.js',
|
2013-06-28 22:38:40 +02:00
|
|
|
'js/popovers.js',
|
2013-01-30 23:11:34 +01:00
|
|
|
'js/typeahead_helper.js',
|
2013-07-30 23:02:10 +02:00
|
|
|
'js/search_suggestion.js',
|
2013-01-30 23:11:34 +01:00
|
|
|
'js/search.js',
|
|
|
|
'js/composebox_typeahead.js',
|
2013-07-24 22:51:13 +02:00
|
|
|
'js/navigate.js',
|
2013-01-30 23:11:34 +01:00
|
|
|
'js/hotkey.js',
|
|
|
|
'js/notifications.js',
|
|
|
|
'js/hashchange.js',
|
|
|
|
'js/invite.js',
|
2012-12-05 23:54:49 +01:00
|
|
|
'js/message_list.js',
|
2013-05-08 15:31:26 +02:00
|
|
|
'js/onboarding.js',
|
2013-01-30 23:11:34 +01:00
|
|
|
'js/zephyr.js',
|
2013-02-07 19:57:45 +01:00
|
|
|
'js/activity.js',
|
2013-02-16 09:43:27 +01:00
|
|
|
'js/colorspace.js',
|
2013-01-14 17:26:50 +01:00
|
|
|
'js/timerender.js',
|
2013-02-13 22:04:35 +01:00
|
|
|
'js/tutorial.js',
|
2013-02-16 10:45:32 +01:00
|
|
|
'js/templates.js',
|
2013-07-29 17:29:25 +02:00
|
|
|
'js/avatar.js',
|
2013-05-09 21:12:53 +02:00
|
|
|
'js/settings.js',
|
|
|
|
'js/tab_bar.js',
|
2013-07-02 00:40:57 +02:00
|
|
|
'js/metrics.js',
|
|
|
|
'js/emoji.js'
|
2013-02-16 11:17:23 +01:00
|
|
|
],
|
2013-01-30 23:11:34 +01:00
|
|
|
'output_filename': 'min/app.js'
|
|
|
|
},
|
2013-05-28 21:46:16 +02:00
|
|
|
'activity': {
|
2013-04-06 00:19:32 +02:00
|
|
|
'source_filenames': (
|
|
|
|
'third/sorttable/sorttable.js',
|
|
|
|
),
|
2013-05-28 21:46:16 +02:00
|
|
|
'output_filename': 'min/activity.js'
|
2013-04-06 00:19:32 +02:00
|
|
|
},
|
2013-01-30 23:11:34 +01:00
|
|
|
}
|
|
|
|
|
Reuse minified JS from previous deploys
This is a big change affecting lots of areas:
* Pipeline no longer deals with JS (though it still minifies CSS)
* A new script, tools/minify-js (called from update-prod-static),
minifies JavaScripts
* A command-line argument --prev-deploy, if passed to minify-js or
update-prod-static, is used to copy minified JS from a previous
deploy (i.e., a previous git checkout), if the source files have
not changed
* update-deployment passes --prev-deploy
* Scripts are now included with the minified_js template tag, rather
than Pipeline's compressed_js
Also, as a side benefit of this commit, our Handlebars templates will
no longer be copied into prod-static/ and accessible in production.
Unminification is probably broken, but, per Zev and Trac ticket #1377,
it wasn't working perfectly before this change either.
(Based on code review, this commit has been revised to:
* Warn if git returns an error in minify-js
* Add missing output redirects in update-prod-static
* Use DEPLOY_ROOT instead of manually constructing that directory
* Use old style formatting)
(imported from commit e67722ea252756db8519d5c0bd6a421d59374185)
2013-07-03 22:42:25 +02:00
|
|
|
if not DEBUG:
|
2013-02-16 11:17:23 +01:00
|
|
|
# This file is generated by update-prod-static.
|
|
|
|
# In dev we fetch individual templates using Ajax.
|
Reuse minified JS from previous deploys
This is a big change affecting lots of areas:
* Pipeline no longer deals with JS (though it still minifies CSS)
* A new script, tools/minify-js (called from update-prod-static),
minifies JavaScripts
* A command-line argument --prev-deploy, if passed to minify-js or
update-prod-static, is used to copy minified JS from a previous
deploy (i.e., a previous git checkout), if the source files have
not changed
* update-deployment passes --prev-deploy
* Scripts are now included with the minified_js template tag, rather
than Pipeline's compressed_js
Also, as a side benefit of this commit, our Handlebars templates will
no longer be copied into prod-static/ and accessible in production.
Unminification is probably broken, but, per Zev and Trac ticket #1377,
it wasn't working perfectly before this change either.
(Based on code review, this commit has been revised to:
* Warn if git returns an error in minify-js
* Add missing output redirects in update-prod-static
* Use DEPLOY_ROOT instead of manually constructing that directory
* Use old style formatting)
(imported from commit e67722ea252756db8519d5c0bd6a421d59374185)
2013-07-03 22:42:25 +02:00
|
|
|
JS_SPECS['app']['source_filenames'].append('templates/compiled.js')
|
2013-02-16 11:17:23 +01:00
|
|
|
|
2013-01-30 23:11:34 +01:00
|
|
|
|
Reuse minified JS from previous deploys
This is a big change affecting lots of areas:
* Pipeline no longer deals with JS (though it still minifies CSS)
* A new script, tools/minify-js (called from update-prod-static),
minifies JavaScripts
* A command-line argument --prev-deploy, if passed to minify-js or
update-prod-static, is used to copy minified JS from a previous
deploy (i.e., a previous git checkout), if the source files have
not changed
* update-deployment passes --prev-deploy
* Scripts are now included with the minified_js template tag, rather
than Pipeline's compressed_js
Also, as a side benefit of this commit, our Handlebars templates will
no longer be copied into prod-static/ and accessible in production.
Unminification is probably broken, but, per Zev and Trac ticket #1377,
it wasn't working perfectly before this change either.
(Based on code review, this commit has been revised to:
* Warn if git returns an error in minify-js
* Add missing output redirects in update-prod-static
* Use DEPLOY_ROOT instead of manually constructing that directory
* Use old style formatting)
(imported from commit e67722ea252756db8519d5c0bd6a421d59374185)
2013-07-03 22:42:25 +02:00
|
|
|
PIPELINE_JS = {} # Now handled in tools/minify-js
|
|
|
|
PIPELINE_JS_COMPRESSOR = None
|
2013-03-27 17:59:24 +01:00
|
|
|
|
Reuse minified JS from previous deploys
This is a big change affecting lots of areas:
* Pipeline no longer deals with JS (though it still minifies CSS)
* A new script, tools/minify-js (called from update-prod-static),
minifies JavaScripts
* A command-line argument --prev-deploy, if passed to minify-js or
update-prod-static, is used to copy minified JS from a previous
deploy (i.e., a previous git checkout), if the source files have
not changed
* update-deployment passes --prev-deploy
* Scripts are now included with the minified_js template tag, rather
than Pipeline's compressed_js
Also, as a side benefit of this commit, our Handlebars templates will
no longer be copied into prod-static/ and accessible in production.
Unminification is probably broken, but, per Zev and Trac ticket #1377,
it wasn't working perfectly before this change either.
(Based on code review, this commit has been revised to:
* Warn if git returns an error in minify-js
* Add missing output redirects in update-prod-static
* Use DEPLOY_ROOT instead of manually constructing that directory
* Use old style formatting)
(imported from commit e67722ea252756db8519d5c0bd6a421d59374185)
2013-07-03 22:42:25 +02:00
|
|
|
PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.yui.YUICompressor'
|
|
|
|
PIPELINE_YUI_BINARY = '/usr/bin/env yui-compressor'
|
2013-01-30 23:11:34 +01:00
|
|
|
|
|
|
|
|
2013-01-11 21:16:42 +01:00
|
|
|
USING_RABBITMQ = DEPLOYED
|
|
|
|
# This password also appears in servers/configure-rabbitmq
|
|
|
|
RABBITMQ_PASSWORD = 'xxxxxxxxxxxxxxxx'
|
|
|
|
|
2013-07-02 23:29:00 +02:00
|
|
|
|
|
|
|
SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"
|
|
|
|
|
|
|
|
CACHES = {
|
|
|
|
'default': {
|
|
|
|
'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
|
|
|
|
'LOCATION': '127.0.0.1:11211',
|
|
|
|
'TIMEOUT': 3600
|
|
|
|
},
|
|
|
|
'database': {
|
|
|
|
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
|
|
|
|
'LOCATION': 'third_party_api_results',
|
|
|
|
# Basically never timeout. Setting to 0 isn't guaranteed
|
|
|
|
# to work, see https://code.djangoproject.com/ticket/9595
|
|
|
|
'TIMEOUT': 2000000000,
|
2012-09-19 17:58:22 +02:00
|
|
|
'OPTIONS': {
|
2013-07-02 23:29:00 +02:00
|
|
|
'MAX_ENTRIES': 100000000,
|
|
|
|
'CULL_FREQUENCY': 10,
|
2013-03-11 19:01:21 +01:00
|
|
|
}
|
2013-07-02 23:29:00 +02:00
|
|
|
},
|
|
|
|
}
|
2012-09-19 17:58:22 +02:00
|
|
|
|
2013-04-09 22:01:38 +02:00
|
|
|
if DEPLOYED:
|
|
|
|
SERVER_LOG_PATH = "/home/humbug/logs/server.log"
|
2013-04-11 20:06:03 +02:00
|
|
|
EVENT_LOG_DIR = '/home/humbug/logs/event_log'
|
2013-07-26 21:28:41 +02:00
|
|
|
ERROR_LOG_DIR = '/home/humbug/logs/errors'
|
2013-04-11 20:06:03 +02:00
|
|
|
STATS_DIR = '/home/humbug/stats'
|
2013-04-12 18:06:53 +02:00
|
|
|
PERSISTENT_QUEUE_FILENAME = "/home/humbug/tornado/event_queues.pickle"
|
2013-04-09 22:01:38 +02:00
|
|
|
else:
|
2013-04-11 20:06:03 +02:00
|
|
|
EVENT_LOG_DIR = 'event_log'
|
2013-04-09 22:01:38 +02:00
|
|
|
SERVER_LOG_PATH = "server.log"
|
2013-07-26 21:28:41 +02:00
|
|
|
ERROR_LOG_DIR = 'errors'
|
2013-04-11 20:06:03 +02:00
|
|
|
STATS_DIR = 'stats'
|
2013-04-12 18:06:53 +02:00
|
|
|
PERSISTENT_QUEUE_FILENAME = "event_queues.pickle"
|
2013-04-09 22:01:38 +02:00
|
|
|
|
2012-08-28 18:44:51 +02:00
|
|
|
LOGGING = {
|
|
|
|
'version': 1,
|
2012-10-16 22:52:51 +02:00
|
|
|
'disable_existing_loggers': True,
|
2012-09-18 22:40:19 +02:00
|
|
|
'formatters': {
|
|
|
|
'default': {
|
|
|
|
'format': '%(asctime)s %(levelname)-8s %(message)s'
|
|
|
|
}
|
|
|
|
},
|
2012-12-05 18:01:43 +01:00
|
|
|
'filters': {
|
2012-12-06 22:00:34 +01:00
|
|
|
'HumbugLimiter': {
|
2013-06-10 18:54:02 +02:00
|
|
|
'()': 'zephyr.lib.logging_util.HumbugLimiter',
|
2012-12-06 22:00:34 +01:00
|
|
|
},
|
|
|
|
'EmailLimiter': {
|
2013-06-10 18:54:02 +02:00
|
|
|
'()': 'zephyr.lib.logging_util.EmailLimiter',
|
2012-12-06 22:00:34 +01:00
|
|
|
},
|
|
|
|
'require_debug_false': {
|
|
|
|
'()': 'django.utils.log.RequireDebugFalse',
|
2013-03-15 17:03:56 +01:00
|
|
|
},
|
|
|
|
'nop': {
|
2013-06-10 18:54:02 +02:00
|
|
|
'()': 'zephyr.lib.logging_util.ReturnTrue',
|
2013-03-15 17:03:56 +01:00
|
|
|
},
|
2013-06-10 18:59:10 +02:00
|
|
|
'require_really_deployed': {
|
|
|
|
'()': 'zephyr.lib.logging_util.RequireReallyDeployed',
|
|
|
|
},
|
2012-12-05 18:01:43 +01:00
|
|
|
},
|
2012-09-18 22:40:19 +02:00
|
|
|
'handlers': {
|
2013-06-10 20:46:34 +02:00
|
|
|
'humbug_admins': {
|
2012-12-06 22:00:34 +01:00
|
|
|
'level': 'ERROR',
|
|
|
|
'class': 'zephyr.handlers.AdminHumbugHandler',
|
2013-03-15 17:03:56 +01:00
|
|
|
# For testing the handler delete the next line
|
2013-06-10 18:59:10 +02:00
|
|
|
'filters': ['HumbugLimiter', 'require_debug_false', 'require_really_deployed'],
|
2012-12-06 22:00:34 +01:00
|
|
|
'formatter': 'default'
|
|
|
|
},
|
2012-09-18 22:40:19 +02:00
|
|
|
'console': {
|
|
|
|
'level': 'DEBUG',
|
|
|
|
'class': 'logging.StreamHandler',
|
|
|
|
'formatter': 'default'
|
2012-10-12 23:47:43 +02:00
|
|
|
},
|
|
|
|
'file': {
|
2013-04-09 22:01:38 +02:00
|
|
|
'level': 'DEBUG',
|
|
|
|
'class': 'logging.handlers.TimedRotatingFileHandler',
|
|
|
|
'formatter': 'default',
|
|
|
|
'filename': SERVER_LOG_PATH,
|
|
|
|
'when': 'D',
|
|
|
|
'interval': 7,
|
|
|
|
'backupCount': 100000000,
|
2012-12-05 18:01:43 +01:00
|
|
|
},
|
2013-03-15 17:03:56 +01:00
|
|
|
# Django has some hardcoded code to add the
|
|
|
|
# require_debug_false filter to the mail_admins handler if no
|
|
|
|
# filters are specified. So for testing, one is recommended
|
|
|
|
# to replace the list of filters for mail_admins with 'nop'.
|
2012-12-05 18:01:43 +01:00
|
|
|
'mail_admins': {
|
|
|
|
'level': 'ERROR',
|
2013-01-16 20:45:07 +01:00
|
|
|
'class': 'zephyr.handlers.HumbugAdminEmailHandler',
|
2013-03-15 17:03:56 +01:00
|
|
|
# For testing the handler replace the filters list with just 'nop'
|
2013-06-10 18:59:10 +02:00
|
|
|
'filters': ['EmailLimiter', 'require_debug_false', 'require_really_deployed'],
|
2012-12-05 18:01:43 +01:00
|
|
|
},
|
2012-09-18 22:40:19 +02:00
|
|
|
},
|
|
|
|
'loggers': {
|
2012-10-09 17:41:13 +02:00
|
|
|
'': {
|
2013-03-27 22:07:45 +01:00
|
|
|
'handlers': ['console', 'file'],
|
|
|
|
'level': 'INFO',
|
|
|
|
'propagate': False,
|
|
|
|
},
|
|
|
|
'django': {
|
2013-06-10 20:46:34 +02:00
|
|
|
'handlers': ['humbug_admins', 'console', 'file', 'mail_admins'],
|
2013-03-27 22:07:45 +01:00
|
|
|
'level': 'INFO',
|
|
|
|
'propagate': False,
|
|
|
|
},
|
|
|
|
'humbug.requests': {
|
|
|
|
'handlers': ['console', 'file'],
|
|
|
|
'level': 'INFO',
|
|
|
|
'propagate': False,
|
2013-03-15 18:13:03 +01:00
|
|
|
},
|
|
|
|
## Uncomment the following to get all database queries logged to the console
|
|
|
|
# 'django.db': {
|
|
|
|
# 'handlers': ['console'],
|
|
|
|
# 'level': 'DEBUG',
|
2013-03-27 22:07:45 +01:00
|
|
|
# 'propagate': False,
|
2013-03-15 18:13:03 +01:00
|
|
|
# },
|
2012-09-18 22:40:19 +02:00
|
|
|
}
|
2012-08-28 18:44:51 +02:00
|
|
|
}
|
|
|
|
|
2012-10-15 22:52:08 +02:00
|
|
|
TEMPLATE_CONTEXT_PROCESSORS = (
|
|
|
|
'zephyr.context_processors.add_settings',
|
2013-06-17 18:01:22 +02:00
|
|
|
'zephyr.context_processors.add_metrics',
|
2012-10-15 22:52:08 +02:00
|
|
|
)
|
|
|
|
|
2012-08-28 18:44:51 +02:00
|
|
|
ACCOUNT_ACTIVATION_DAYS=7
|
2012-10-01 21:03:59 +02:00
|
|
|
EMAIL_USE_TLS = True
|
|
|
|
EMAIL_HOST = 'smtp.gmail.com'
|
|
|
|
EMAIL_HOST_USER = 'humbug@humbughq.com'
|
|
|
|
EMAIL_HOST_PASSWORD = 'xxxxxxxxxxxxxxxx'
|
|
|
|
EMAIL_PORT = 587
|
|
|
|
|
2013-07-11 16:45:53 +02:00
|
|
|
DEFAULT_FROM_EMAIL = "Zulip <zulip@zulip.com>"
|
2012-09-06 21:15:11 +02:00
|
|
|
|
|
|
|
LOGIN_REDIRECT_URL='/'
|
2013-02-20 22:26:06 +01:00
|
|
|
OPENID_SSO_SERVER_URL = 'https://www.google.com/accounts/o8/id'
|
|
|
|
OPENID_CREATE_USERS = True
|
|
|
|
OPENID_RENDER_FAILURE = openid_failure_handler
|
2012-09-27 19:58:42 +02:00
|
|
|
|
2013-04-02 19:59:12 +02:00
|
|
|
MAILCHIMP_API_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-us4'
|
|
|
|
HUMBUG_FRIENDS_LIST_ID = '84b2f3da6b'
|
|
|
|
|
2013-03-28 22:38:45 +01:00
|
|
|
# Client-side polling timeout for get_events, in milliseconds.
|
2012-12-11 18:08:18 +01:00
|
|
|
# We configure this here so that the client test suite can override it.
|
2013-03-28 22:38:45 +01:00
|
|
|
# We already kill the connection server-side with heartbeat events,
|
|
|
|
# but it's good to have a safety. This value should be greater than
|
|
|
|
# (HEARTBEAT_MIN_FREQ_SECS + 10)
|
|
|
|
POLL_TIMEOUT = 90 * 1000
|
2012-12-11 18:08:18 +01:00
|
|
|
|
2013-03-18 18:40:47 +01:00
|
|
|
# The new user tutorial is enabled by default, and disabled for
|
|
|
|
# client tests.
|
|
|
|
TUTORIAL_ENABLED = True
|
|
|
|
|
2013-05-17 23:58:34 +02:00
|
|
|
HOME_NOT_LOGGED_IN = '/login'
|
2012-12-11 22:07:57 +01:00
|
|
|
if DEPLOYED:
|
2012-10-15 22:47:52 +02:00
|
|
|
ALLOW_REGISTER = False
|
2012-10-15 22:52:08 +02:00
|
|
|
FULL_NAVBAR = False
|
2012-10-15 22:34:24 +02:00
|
|
|
else:
|
2012-10-15 22:47:52 +02:00
|
|
|
ALLOW_REGISTER = True
|
2012-10-15 22:52:08 +02:00
|
|
|
FULL_NAVBAR = True
|
2012-10-15 22:31:06 +02:00
|
|
|
|
2012-09-28 22:47:05 +02:00
|
|
|
# For testing, you may want to have emails be printed to the console.
|
2012-12-11 22:07:57 +01:00
|
|
|
if not DEPLOYED:
|
2012-10-01 21:03:59 +02:00
|
|
|
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
2012-10-20 21:25:33 +02:00
|
|
|
|
|
|
|
# Use fast password hashing for creating testing users when not
|
2012-12-11 22:07:57 +01:00
|
|
|
# DEPLOYED
|
2012-10-20 21:25:33 +02:00
|
|
|
PASSWORD_HASHERS = (
|
|
|
|
'django.contrib.auth.hashers.SHA1PasswordHasher',
|
2013-01-03 21:43:45 +01:00
|
|
|
'django.contrib.auth.hashers.PBKDF2PasswordHasher'
|
2012-10-20 21:25:33 +02:00
|
|
|
)
|
2012-12-07 23:00:13 +01:00
|
|
|
|
2012-12-11 22:07:57 +01:00
|
|
|
if DEPLOYED:
|
2012-12-07 23:00:13 +01:00
|
|
|
# Filter out user data
|
|
|
|
DEFAULT_EXCEPTION_REPORTER_FILTER = 'zephyr.filters.HumbugExceptionReporterFilter'
|
2013-03-14 22:12:25 +01:00
|
|
|
|
|
|
|
# We want all temporary uploaded files to be stored on disk.
|
|
|
|
|
|
|
|
FILE_UPLOAD_MAX_MEMORY_SIZE = 0
|
|
|
|
|
2013-06-21 16:52:46 +02:00
|
|
|
# We are not currently using embedly due to some performance issues, but
|
|
|
|
# we are keeping the code on master for now, behind this launch flag.
|
|
|
|
# If you turn this back on for dev, you will want it to be still False
|
|
|
|
# for running the tests, or you will need to ensure that embedly_client.is_supported()
|
|
|
|
# gets called before the tests run.
|
|
|
|
USING_EMBEDLY = False
|
2013-04-29 22:22:07 +02:00
|
|
|
EMBEDLY_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
|
|
|
2013-03-27 21:26:00 +01:00
|
|
|
if DEPLOYED:
|
|
|
|
S3_KEY="xxxxxxxxxxxxxxxxxxxx"
|
|
|
|
S3_SECRET_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
|
|
S3_BUCKET="humbug-user-uploads"
|
2013-06-07 22:44:44 +02:00
|
|
|
S3_AVATAR_BUCKET="humbug-user-avatars"
|
2013-05-21 18:15:48 +02:00
|
|
|
|
|
|
|
MIXPANEL_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
2013-03-27 21:26:00 +01:00
|
|
|
else:
|
|
|
|
S3_KEY="xxxxxxxxxxxxxxxxxxxx"
|
|
|
|
S3_SECRET_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
|
|
S3_BUCKET="humbug-user-uploads-test"
|
2013-06-07 22:44:44 +02:00
|
|
|
S3_AVATAR_BUCKET="humbug-user-avatars-test"
|
2013-05-21 18:15:48 +02:00
|
|
|
|
|
|
|
MIXPANEL_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|