forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.py
More file actions
482 lines (393 loc) · 15.4 KB
/
Copy pathsettings.py
File metadata and controls
482 lines (393 loc) · 15.4 KB
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
# Copyright The IETF Trust 2007, All Rights Reserved
# Django settings for ietf project.
# BASE_DIR and "settings_local" are from
# http://code.djangoproject.com/wiki/SplitSettings
import os
try:
import syslog
syslog.openlog("datatracker", syslog.LOG_PID, syslog.LOG_USER)
except ImportError:
pass
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# a place to put ajax logs if necessary.
LOG_DIR = '/var/log/datatracker'
import sys
sys.path.append(os.path.abspath(BASE_DIR + "/.."))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
# Domain name of the IETF
IETF_DOMAIN = 'ietf.org'
ADMINS = (
('IETF Django Developers', 'django-project@' + IETF_DOMAIN),
('GMail Tracker Archive', 'ietf.tracker.archive+errors@gmail.com'),
('Henrik Levkowetz', 'henrik@levkowetz.com'),
('Robert Sparks', 'rjsparks@nostrum.com'),
('Ole Laursen', 'olau@iola.dk'),
('Ryan Cross', 'rcross@amsl.com'),
)
ALLOWED_HOSTS = [".ietf.org", ".ietf.org.", "209.208.19.216", "4.31.198.44", ]
# Server name of the tools server
TOOLS_SERVER = 'tools.' + IETF_DOMAIN
# Override this in the settings_local.py file:
SERVER_EMAIL = 'Django Server <django-project@' + TOOLS_SERVER + '>'
DEFAULT_FROM_EMAIL = 'IETF Secretariat <ietf-secretariat-reply@' + IETF_DOMAIN + '>'
MANAGERS = ADMINS
DATABASES = {
'default': {
'NAME': 'ietf_utf8',
'ENGINE': 'django.db.backends.mysql',
'USER': 'ietf',
#'PASSWORD': 'ietf',
#'OPTIONS': {},
},
# 'legacy': {
# 'NAME': 'ietf',
# 'ENGINE': 'django.db.backends.mysql',
# 'USER': 'ietf',
# #'PASSWORD': 'ietf',
# },
}
DATABASE_TEST_OPTIONS = {
# Comment this out if your database doesn't support InnoDB
'init_command': 'SET storage_engine=InnoDB',
}
# Local time zone for this installation. Choices can be found here:
# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
# although not all variations may be possible on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'PST8PDT'
# Language code for this installation. All choices can be found here:
# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
# http://blogs.law.harvard.edu/tech/stories/storyReader$15
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = False
USE_TZ = False
MEDIA_URL = 'http://www.ietf.org/'
STATIC_URL = "/"
STATIC_ROOT = os.path.abspath(BASE_DIR + "/../static/")
WSGI_APPLICATION = "ietf.wsgi.application"
DAJAXICE_MEDIA_PREFIX = "dajaxice"
AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', )
#DATABASE_ROUTERS = ["ietf.legacy_router.LegacyRouter"]
# ------------------------------------------------------------------------
# Django/Python Logging Framework Modifications
# enable HTML error emails
from django.utils.log import DEFAULT_LOGGING
LOGGING = DEFAULT_LOGGING.copy()
LOGGING['handlers']['mail_admins']['include_html'] = True
# Filter out "Invalid HTTP_HOST" emails
# Based on http://www.tiwoc.de/blog/2013/03/django-prevent-email-notification-on-suspiciousoperation/
from django.core.exceptions import SuspiciousOperation
def skip_suspicious_operations(record):
if record.exc_info:
exc_value = record.exc_info[1]
if isinstance(exc_value, SuspiciousOperation):
return False
return True
LOGGING['filters']['skip_suspicious_operations'] = {
'()': 'django.utils.log.CallbackFilter',
'callback': skip_suspicious_operations,
}
LOGGING['handlers']['mail_admins']['filters'] += [ 'skip_suspicious_operations' ]
# Filter out UreadablePostError:
from django.http import UnreadablePostError
def skip_unreadable_post(record):
if record.exc_info:
exc_type, exc_value = record.exc_info[:2]
if isinstance(exc_value, UnreadablePostError):
return False
return True
LOGGING['filters']['skip_unreadable_posts'] = {
'()': 'django.utils.log.CallbackFilter',
'callback': skip_unreadable_post,
}
LOGGING['handlers']['mail_admins']['filters'] += [ 'skip_unreadable_posts' ]
# End logging
# ------------------------------------------------------------------------
#SESSION_COOKIE_AGE = 60 * 60 * 24 * 7 * 2 # Age of cookie, in seconds: 2 weeks.
SESSION_COOKIE_AGE = 60 * 60 * 24 * 365 * 50 # Age of cookie, in seconds: 50 years
SESSION_EXPIRE_AT_BROWSER_CLOSE = False
SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'ietf.dbtemplate.template.Loader',
)
MIDDLEWARE_CLASSES = (
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'ietf.middleware.FillInRemoteUserIfLoggedInMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.http.ConditionalGetMiddleware',
'ietf.middleware.SQLLogMiddleware',
'ietf.middleware.SMTPExceptionMiddleware',
'ietf.middleware.RedirectTrailingPeriod',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'ietf.middleware.UnicodeNfkcNormalization',
'ietf.secr.middleware.secauth.SecAuthMiddleware'
)
ROOT_URLCONF = 'ietf.urls'
TEMPLATE_DIRS = (
BASE_DIR + "/templates",
BASE_DIR + "/secr/templates",
BASE_DIR+"/../django-dajaxice/dajaxice/templates",
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.request',
'django.core.context_processors.media',
'django.contrib.messages.context_processors.messages',
'ietf.context_processors.server_mode',
'ietf.context_processors.revision_info',
'ietf.secr.context_processors.secr_revision_info',
'ietf.secr.context_processors.static',
'ietf.context_processors.rfcdiff_prefix',
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.sitemaps',
'django.contrib.admin',
'django.contrib.admindocs',
'django.contrib.humanize',
'django.contrib.messages',
'south',
'ietf.person',
'ietf.name',
'ietf.group',
'ietf.doc',
'ietf.message',
'ietf.idindex',
'ietf.ietfauth',
'ietf.iesg',
'ietf.ipr',
'ietf.liaisons',
'ietf.mailinglists',
'ietf.meeting',
'ietf.utils',
'ietf.redirects',
'ietf.submit',
'ietf.sync',
'ietf.community',
'ietf.release',
# secretariat apps
'form_utils',
'ietf.secr.announcement',
'ietf.secr.areas',
'ietf.secr.drafts',
'ietf.secr.groups',
'ietf.secr.ipradmin',
'ietf.secr.meetings',
'ietf.secr.proceedings',
'ietf.secr.roles',
'ietf.secr.rolodex',
'ietf.secr.telechat',
'ietf.secr.sreq',
'ietf.nomcom',
'ietf.dbtemplate',
'dajaxice',
)
INTERNAL_IPS = (
# AMS servers
'64.170.98.32',
'64.170.98.86',
# local
'127.0.0.1',
'::1',
)
# no slash at end
IDTRACKER_BASE_URL = "http://datatracker.ietf.org"
RFCDIFF_PREFIX = "//www.ietf.org/rfcdiff"
# Valid values:
# 'production', 'test', 'development'
# Override this in settings_local.py if it's not true
SERVER_MODE = 'development'
# The name of the method to use to invoke the test suite
TEST_RUNNER = 'ietf.utils.test_runner.IetfTestRunner'
# Fixtures which will be loaded before testing starts
GLOBAL_TEST_FIXTURES = [ 'names','ietf.utils.test_data.make_immutable_base_data' ]
TEST_DIFF_FAILURE_DIR = "/tmp/test/failure/"
# WG Chair configuration
MAX_WG_DELEGATES = 3
DATE_FORMAT = "Y-m-d"
DATETIME_FORMAT = "Y-m-d H:i"
# Override this in settings_local.py if needed
# *_PATH variables ends with a slash/ .
DOCUMENT_PATH_PATTERN = '/a/www/ietf-ftp/{doc.type_id}/'
INTERNET_DRAFT_PATH = '/a/www/ietf-ftp/internet-drafts/'
INTERNET_DRAFT_PDF_PATH = '/a/www/ietf-datatracker/pdf/'
RFC_PATH = '/a/www/ietf-ftp/rfc/'
CHARTER_PATH = '/a/www/ietf-ftp/charter/'
CONFLICT_REVIEW_PATH = '/a/www/ietf-ftp/conflict-reviews'
STATUS_CHANGE_PATH = '/a/www/ietf-ftp/status-changes'
AGENDA_PATH = '/a/www/www6s/proceedings/'
IPR_DOCUMENT_PATH = '/a/www/ietf-ftp/ietf/IPR/'
IESG_TASK_FILE = '/a/www/www6/iesg/internal/task.txt'
IESG_ROLL_CALL_FILE = '/a/www/www6/iesg/internal/rollcall.txt'
IESG_MINUTES_FILE = '/a/www/www6/iesg/internal/minutes.txt'
IESG_WG_EVALUATION_DIR = "/a/www/www6/iesg/evaluation"
INTERNET_DRAFT_ARCHIVE_DIR = '/a/www/www6s/draft-archive'
# Mailing list info URL for lists hosted on the IETF servers
MAILING_LIST_INFO_URL = "https://www.ietf.org/mailman/listinfo/%(list_addr)s"
# Ideally, more of these would be local -- but since we don't support
# versions right now, we'll point to external websites
DOC_HREFS = {
"charter": "http://www.ietf.org/charter/{doc.name}-{doc.rev}.txt",
"draft": "http://www.ietf.org/archive/id/{doc.name}-{doc.rev}.txt",
"slides": "http://www.ietf.org/slides/{doc.name}-{doc.rev}",
"conflrev": "http://www.ietf.org/cr/{doc.name}-{doc.rev}.txt",
"statchg": "http://www.ietf.org/sc/{doc.name}-{doc.rev}.txt",
}
MEETING_DOC_HREFS = {
"agenda": "/meeting/{meeting}/agenda/{doc.group.acronym}/",
"minutes": "http://www.ietf.org/proceedings/{meeting}/minutes/{doc.external_url}",
"slides": "http://www.ietf.org/proceedings/{meeting}/slides/{doc.external_url}",
}
# Override this in settings_local.py if needed
CACHE_MIDDLEWARE_SECONDS = 300
CACHE_MIDDLEWARE_KEY_PREFIX = ''
# The default with no CACHES setting is 'django.core.cache.backends.locmem.LocMemCache'
# This setting is possibly overridden further down, after the import of settings_local
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
}
}
IPR_EMAIL_TO = ['ietf-ipr@ietf.org', ]
DOC_APPROVAL_EMAIL_CC = ["RFC Editor <rfc-editor@rfc-editor.org>", ]
IANA_EVAL_EMAIL = "drafts-eval@icann.org"
IANA_APPROVE_EMAIL = "drafts-approval@icann.org"
# Put real password in settings_local.py
IANA_SYNC_PASSWORD = "secret"
IANA_SYNC_CHANGES_URL = "https://datatracker.iana.org:4443/data-tracker/changes"
IANA_SYNC_PROTOCOLS_URL = "http://www.iana.org/protocols/"
RFC_TEXT_RSYNC_SOURCE="ftp.rfc-editor.org::rfcs-text-only"
RFC_EDITOR_SYNC_PASSWORD="secret"
RFC_EDITOR_SYNC_NOTIFICATION_URL = "http://www.rfc-editor.org/parser/parser.php"
RFC_EDITOR_QUEUE_URL = "http://www.rfc-editor.org/queue2.xml"
RFC_EDITOR_INDEX_URL = "http://www.rfc-editor.org/rfc/rfc-index.xml"
# Liaison Statement Tool settings
LIAISON_UNIVERSAL_FROM = 'Liaison Statement Management Tool <lsmt@' + IETF_DOMAIN + '>'
LIAISON_ATTACH_PATH = '/a/www/ietf-datatracker/documents/LIAISON/'
LIAISON_ATTACH_URL = '/documents/LIAISON/'
# NomCom Tool settings
ROLODEX_URL = ""
NOMCOM_PUBLIC_KEYS_DIR = '/a/www/nomcom/public_keys/'
NOMCOM_FROM_EMAIL = 'nomcom-chair@ietf.org'
NOMCOM_ADMIN_EMAIL = DEFAULT_FROM_EMAIL
OPENSSL_COMMAND = '/usr/bin/openssl'
DAYS_TO_EXPIRE_NOMINATION_LINK = ''
DEFAULT_FEEDBACK_TYPE = 'offtopic'
NOMINEE_FEEDBACK_TYPES = ['comment', 'questio', 'nomina']
# ID Submission Tool settings
IDSUBMIT_FROM_EMAIL = 'IETF I-D Submission Tool <idsubmission@ietf.org>'
IDSUBMIT_TO_EMAIL = 'internet-drafts@ietf.org'
IDSUBMIT_ANNOUNCE_FROM_EMAIL = 'internet-drafts@ietf.org'
IDSUBMIT_ANNOUNCE_LIST_EMAIL = 'i-d-announce@ietf.org'
FIRST_CUTOFF_DAYS = 19 # Days from meeting to cut off dates on submit
SECOND_CUTOFF_DAYS = 12
CUTOFF_HOUR = 00 # midnight UTC
CUTOFF_WARNING_DAYS = 21 # Number of days before cutoff to start showing the cutoff date
SUBMISSION_START_DAYS = -90
SUBMISSION_CUTOFF_DAYS = 33
SUBMISSION_CORRECTION_DAYS = 52
INTERNET_DRAFT_DAYS_TO_EXPIRE = 185
IDSUBMIT_REPOSITORY_PATH = INTERNET_DRAFT_PATH
IDSUBMIT_STAGING_PATH = '/a/www/www6s/staging/'
IDSUBMIT_STAGING_URL = 'http://www.ietf.org/staging/'
IDSUBMIT_IDNITS_BINARY = '/a/www/ietf-datatracker/scripts/idnits'
IDSUBMIT_MAX_PLAIN_DRAFT_SIZE = 6291456 # Max size of the txt draft in bytes
IDSUBMIT_MAX_DAILY_SAME_DRAFT_NAME = 20
IDSUBMIT_MAX_DAILY_SAME_DRAFT_NAME_SIZE = 50 # in MB
IDSUBMIT_MAX_DAILY_SAME_SUBMITTER = 50
IDSUBMIT_MAX_DAILY_SAME_SUBMITTER_SIZE = 150 # in MB
IDSUBMIT_MAX_DAILY_SAME_GROUP = 150
IDSUBMIT_MAX_DAILY_SAME_GROUP_SIZE = 450 # in MB
IDSUBMIT_MAX_DAILY_SUBMISSIONS = 1000
IDSUBMIT_MAX_DAILY_SUBMISSIONS_SIZE = 2000 # in MB
DOT_BINARY = '/usr/bin/dot'
UNFLATTEN_BINARY= '/usr/bin/unflatten'
PS2PDF_BINARY = '/usr/bin/ps2pdf'
RSYNC_BINARY = '/usr/bin/rsync'
# Account settings
DAYS_TO_EXPIRE_REGISTRATION_LINK = 3
HTPASSWD_COMMAND = "/usr/bin/htpasswd2"
HTPASSWD_FILE = "/www/htpasswd"
SOUTH_TESTS_MIGRATE = False
# Generation of bibxml files for xml2rfc
BIBXML_BASE_PATH = '/a/www/ietf-ftp/xml2rfc'
# Timezone files for iCalendar
TZDATA_ICS_PATH = BASE_DIR + '/../vzic/zoneinfo/'
CHANGELOG_PATH = '/www/ietf-datatracker/web/changelog'
# Secretariat Tool
# this is a tuple of regular expressions. if the incoming URL matches one of
# these, than non secretariat access is allowed.
SECR_AUTH_UNRESTRICTED_URLS = (
#(r'^/$'),
(r'^/secr/announcement/'),
(r'^/secr/proceedings/'),
(r'^/secr/sreq/'),
)
SECR_BLUE_SHEET_PATH = '/a/www/ietf-datatracker/documents/blue_sheet.rtf'
SECR_BLUE_SHEET_URL = 'https://datatracker.ietf.org/documents/blue_sheet.rtf'
SECR_INTERIM_LISTING_DIR = '/a/www/www6/meeting/interim'
SECR_MAX_UPLOAD_SIZE = 40960000
SECR_PROCEEDINGS_DIR = '/a/www/www6s/proceedings/'
SECR_STATIC_URL = '/secretariat/'
USE_ETAGS=True
PRODUCTION_TIMEZONE = "America/Los_Angeles"
PYFLAKES_DEFAULT_ARGS= ["ietf", ]
VULTURE_DEFAULT_ARGS= ["ietf", ]
# Automatic Scheduling
#
# how much to login while running, bigger numbers make it more verbose.
BADNESS_CALC_LOG = 0
#
# these penalties affect the calculation of how bad the assignments are.
BADNESS_UNPLACED = 1000000
# following four are used only during migrations to setup up ConstraintName
# and penalties are taken from the database afterwards.
BADNESS_BETHERE = 200000
BADNESS_CONFLICT_1 = 100000
BADNESS_CONFLICT_2 = 10000
BADNESS_CONFLICT_3 = 1000
BADNESS_TOOSMALL_50 = 5000
BADNESS_TOOSMALL_100 = 50000
BADNESS_TOOBIG = 100
BADNESS_MUCHTOOBIG = 500
# do not run SELENIUM tests by default
SELENIUM_TESTS = False
SELENIUM_TESTS_ONLY = False
# Path to the email alias lists. Used by ietf.utils.aliases
DRAFT_ALIASES_PATH = "/a/postfix/draft-aliases"
DRAFT_VIRTUAL_PATH = "/a/postfix/draft-virtual"
GROUP_ALIASES_PATH = "/a/postfix/group-aliases"
GROUP_VIRTUAL_PATH = "/a/postfix/group-virtual"
POSTCONFIRM_PATH = "/a/postconfirm/test-wrapper"
# Put the production SECRET_KEY in settings_local.py, and also any other
# sensitive or site-specific changes. DO NOT commit settings_local.py to svn.
from settings_local import * # pyflakes:ignore
# We provide a secret key only for test and development modes. It's
# absolutely vital that django fails to start in production mode unless a
# secret key has been provided elsewhere, not in this file which is
# publicly available, for instance from the source repository.
if SERVER_MODE != 'production':
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
if 'SECRET_KEY' not in locals():
SECRET_KEY = 'PDwXboUq!=hPjnrtG2=ge#N$Dwy+wn@uivrugwpic8mxyPfHka'
X_FRAME_OPTIONS = "ALLOW-FROM tools.ietf.org"