This repository has been archived by the owner on Jan 31, 2019. It is now read-only.
forked from fwenzel/reporter
-
Notifications
You must be signed in to change notification settings - Fork 20
/
settings.py
207 lines (173 loc) · 5.61 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
from funfactory.settings_base import *
SYSLOG_TAG = "http_app_reporter"
DATABASE_ROUTERS = ('website_issues.db.DatabaseRouter',
'multidb.MasterSlaveRouter',)
CACHE_DEFAULT_PERIOD = CACHE_MIDDLEWARE_SECONDS = 60 * 5 # 5 minutes
CACHE_COUNT_TIMEOUT = 60 # seconds
CACHE_PREFIX = CACHE_MIDDLEWARE_KEY_PREFIX = 'reporter:'
# Site ID.
# Site 1 is the desktop site, site == MOBILE_SITE_ID is the mobile site. This
# is set automatically in input.middleware.MobileSiteMiddleware according to
# the request domain.
DESKTOP_SITE_ID = 1
MOBILE_SITE_ID = 2
# The desktop version is the default.
SITE_ID = DESKTOP_SITE_ID
# Accepted locales
PROD_LANGUAGES = ('ar', 'bg', 'ca', 'cs', 'da', 'de', 'el', 'en-US', 'es',
'fr', 'fy-NL', 'ga-IE', 'gl', 'he', 'hr', 'hu', 'id', 'it',
'ja', 'ko', 'nb-NO', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro',
'ru', 'sk', 'sl', 'sq', 'uk', 'vi', 'zh-TW', 'zh-CN')
RTL_LANGUAGES = ('ar', 'he',) # ('fa', 'fa-IR')
# Fallbacks for locales that are not recognized by Babel. Bug 596981.
BABEL_FALLBACK = {'fy-nl': 'nl'}
LANGUAGE_URL_MAP = dict((i[:2], i) for i in PROD_LANGUAGES if '-' in i)
LANGUAGE_URL_MAP.update((i.lower(), i) for i in PROD_LANGUAGES)
# Paths that don't require a locale prefix.
SUPPORTED_NONLOCALES = ('media', 'admin')
# Templates
CSRF_FAILURE_VIEW = '%s.urls.handler_csrf' % ROOT_PACKAGE
TEMPLATE_CONTEXT_PROCESSORS = list(TEMPLATE_CONTEXT_PROCESSORS) + [
# TODO: is this needed?
'input.context_processors.i18n',
'input.context_processors.input',
'input.context_processors.mobile',
'input.context_processors.opinion_types',
'search.context_processors.product_versions',
'jingo_minify.helpers.build_ids',
]
# Bundles is a dictionary of two dictionaries, css and js, which list css files
# and js files that can be bundled together by the jingo-minify app.
MINIFY_BUNDLES = {
'css': {
'common': (
'css/libs/reset-min.css',
'css/libs/jquery-ui.css',
'css/input.css',
),
'common_mobile': (
'css/libs/reset-min.css',
'css/input-mobile.css',
),
# old styles for submission pages
'common_old': (
'css/reporter.css',
),
'mobile_old': (
'css/reporter.css',
'css/mobile.css',
),
'feedback': (
'css/libs/reset2.css',
'css/feedback.css',
),
'feedback-mobile': (
'css/libs/reset-min.css',
'css/feedback-mobile.css',
),
},
'js': {
'common': (
'js/libs/jquery.min.js',
'js/libs/jquery-ui.min.js',
'js/libs/jquery.cookie.js',
'js/init.js',
'js/input.js',
'js/search.js',
# Time-based charts
'js/libs/highcharts.src.js',
'js/dashboard.js',
),
'common_mobile': (
'js/libs/jquery.min.js',
'js/input-mobile.js',
),
# old scripts for submission pages (desktop and mobile)
'common_old': (
'js/libs/jquery.min.js',
'js/libs/jquery.NobleCount.js',
'js/init.js',
'js/reporter.js',
),
# Release versions feedback
'feedback': (
'js/libs/jquery.min.js',
'js/init.js',
'js/feedback.js',
),
'feedback-mobile': (
'js/feedback-mobile.js',
),
},
}
JAVA_BIN = '/usr/bin/java'
JINGO_EXCLUDE_APPS = ['debug_toolbar', 'admin']
MIDDLEWARE_CLASSES = list(MIDDLEWARE_CLASSES) + [
'input.middleware.MobileSiteMiddleware',
'commonware.response.middleware.GraphiteMiddleware',
'commonware.response.middleware.GraphiteRequestTimingMiddleware',
]
INSTALLED_APPS = list(INSTALLED_APPS) + [
'input', # comes first so it always takes precedence.
'api',
'feedback',
'myadmin',
'search',
'swearwords',
'themes',
'website_issues',
'annoying',
'cronjobs',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.messages',
]
# Where to store product details
PROD_DETAILS_DIR = path('lib/product_details_json')
# Term filter options
MIN_TERM_LENGTH = 3
MAX_TERM_LENGTH = 25
# Number of items to show in the "Trends" box and Messages box.
MESSAGES_COUNT = 10
TRENDS_COUNT = 10
# Sphinx Search Index
SPHINX_HOST = '127.0.0.1'
SPHINX_PORT = 3314
SPHINXQL_PORT = 3309
SPHINX_SEARCHD = 'searchd'
SPHINX_INDEXER = 'indexer'
SPHINX_CATALOG_PATH = path('tmp/data/sphinx')
SPHINX_LOG_PATH = path('tmp/log/searchd')
SPHINX_CONFIG_PATH = path('configs/sphinx/sphinx.conf')
TEST_SPHINX_PORT = 3414
TEST_SPHINXQL_PORT = 3409
TEST_SPHINX_CATALOG_PATH = path('tmp/test/data/sphinx')
TEST_SPHINX_LOG_PATH = path('tmp/test/log/searchd')
SEARCH_MAX_RESULTS = 1000
SEARCH_PERPAGE = 20 # results per page
SEARCH_MAX_PAGES = SEARCH_MAX_RESULTS / SEARCH_PERPAGE
CLUSTER_SIM_THRESHOLD = 2
## Celery
BROKER_HOST = "127.0.0.1"
BROKER_PORT = 5672
BROKER_VHOST = "input"
BROKER_USER = "guest"
BROKER_PASSWORD = "guest"
CELERY_IMPORTS = ('django_arecibo.tasks',)
## API
TSV_EXPORT_DIR = path('media/data')
# URL for reporting arecibo errors too. If not set, won't be sent.
ARECIBO_SERVER_URL = ""
## ElasticSearch
ES_HOSTS = []
ES_INDEX = 'input'
ES_DISABLED = True
## FEATURE FLAGS:
# Setting this to False allows feedback to be collected from any user agent.
# (good for testing)
ENFORCE_USER_AGENT = True
DISABLE_TERMS = False
# Minnum of opinions in the last 30 days for version to be shown in dashboard
DASHBOARD_THRESHOLD = 800
DASHBOARD_THRESHOLD_MOBILE = 120
SESSION_COOKIE_SECURE = True