-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocal_settings.py.example
172 lines (144 loc) · 6.39 KB
/
local_settings.py.example
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
# List of people to receive site error notifications (5XX error tracebacks)
# https://docs.djangoproject.com/en/dev/ref/settings/#admins
ADMINS = (
('Zeus admin', '[email protected]'),
('Zeus admin 2', '[email protected]'),
)
# A list of people to receive broken link notifications
# https://docs.djangoproject.com/en/dev/ref/settings/#managers
MANAGERS = ADMINS
# A list of people to receive elections status notifications
ELECTION_ADMINS = (
('Elections admin', '[email protected]'),
('Elections admin 2', '[email protected]'),
)
# Database configuration
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'HOST': '127.0.0.1',
'NAME': '<DATABASE-NAME>',
'USER': '<DATABASE-USER>',
'PASSWORD': '<PASSWORD>'
}
}
# Helios settings
AUTH_ENABLED_AUTH_SYSTEMS = ['password']
HELIOS_ADMIN_ONLY = True
HELIOS_VOTERS_EMAIL = True
# How many mails to send per minute
# set it to a sane value to avoid mail congestion
ZEUS_VOTER_EMAIL_RATE = '120/m'
# Email and domain configuration
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = '<USERNAME>@gmail.com'
EMAIL_HOST_PASSWORD = '<PASSWORD>'
EMAIL_PORT = 587
DEFAULT_FROM_EMAIL = '[email protected]'
DEFAULT_FROM_NAME = 'Zeus'
SERVER_EMAIL = '%s <%s>' % (DEFAULT_FROM_NAME, DEFAULT_FROM_EMAIL)
SITE_DOMAIN = "zeus-server.gr"
URL_HOST = "https://%s" % SITE_DOMAIN
SECURE_URL_HOST = "https://%s" % SITE_DOMAIN
SITE_TITLE = "'Zeus': e-voting platform"
# Zeus cryptosystem configuration
HELIOS_CRYPTOSYSTEM_PARAMS = {}
HELIOS_CRYPTOSYSTEM_PARAMS['p'] = 19936216778566278769000253703181821530777724513886984297472278095277636456087690955868900309738872419217596317525891498128424073395840060513894962337598264322558055230566786268714502738012916669517912719860309819086261817093999047426105645828097562635912023767088410684153615689914052935698627462693772783508681806906452733153116119222181911280990397752728529137894709311659730447623090500459340155653968608895572426146788021409657502780399150625362771073012861137005134355305397837208305921803153308069591184864176876279550962831273252563865904505239163777934648725590326075580394712644972925907314817076990800469107L
HELIOS_CRYPTOSYSTEM_PARAMS['q'] = 9968108389283139384500126851590910765388862256943492148736139047638818228043845477934450154869436209608798158762945749064212036697920030256947481168799132161279027615283393134357251369006458334758956359930154909543130908546999523713052822914048781317956011883544205342076807844957026467849313731346886391754340903453226366576558059611090955640495198876364264568947354655829865223811545250229670077826984304447786213073394010704828751390199575312681385536506430568502567177652698918604152960901576654034795592432088438139775481415636626281932952252619581888967324362795163037790197356322486462953657408538495400234553L
HELIOS_CRYPTOSYSTEM_PARAMS['g'] = 19167066187022047436478413372880824313438678797887170030948364708695623454002582820938932961803261022277829853214287063757589819807116677650566996585535208649540448432196806454948132946013329765141883558367653598679571199251774119976449205171262636938096065535299103638890429717713646407483320109071252653916730386204380996827449178389044942428078669947938163252615751345293014449317883432900504074626873215717661648356281447274508124643639202368368971023489627632546277201661921395442643626191532112873763159722062406562807440086883536046720111922074921528340803081581395273135050422967787911879683841394288935013751L
# Zeus mixnet settings
# Set this to the number of available CPU cores
ZEUS_MIXNET_NR_PARALLEL = 16
# Slow/secure configuration
ZEUS_MIXNET_NR_ROUNDS = 128
# Faster but insecure. Uncomment if you are just testing out zeus
#ZEUS_MIXNET_NR_ROUNDS = 8
# How many questions to allow per election
MAX_QUESTIONS_LIMIT = 4
# Disable e-counting integration
ECOUNTING_LOGIN_URL = None
ECOUNTING_CHECK_URL = None
ECOUNTING_POST_URL = None
ECOUNTING_SECRET = None
# Celery configuration
CELERY_ALWAYS_EAGER = False
CELERY_EAGER_PROPAGATES_EXCEPTIONS = False
CELERY_RESULT_DBURI = DATABASES['default']
CELERY_SEND_TASK_ERROR_EMAILS = True
import djcelery
djcelery.setup_loader()
BROKER_URL = 'django://'
MEDIA_ROOT = '/usr/share/zeus/'
# If True apache mod_xsendfile should be configured
USE_X_SENDFILE = True
# Always False in production environments
DEBUG = False
# set up logging
import logging
logging.basicConfig(
level = logging.DEBUG if DEBUG else logging.INFO,
format = '%(asctime)s %(levelname)s %(message)s'
)
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '%(asctime)s - %(levelname)s %(module)s %(process)d - %(message)s'
},
},
'root': {
'level': 'INFO',
'handlers': ['file'],
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler',
},
'file': {
'class': 'logging.FileHandler',
'filename': '/srv/zeus-data/zeus.log',
'formatter': 'verbose',
},
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
}
}
}
ACTIVATE_SENTRY = False
SENTRY = {
'activate': False if os.environ.get("NO_SENTRY") else ACTIVATE_SENTRY,
'sentry_dsn': '<DSN_HERE>'
}
if SENTRY['activate']:
import raven
sentry_dsn = os.getenv("SENTRY_DSN") or SENTRY['sentry_dsn']
if not sentry_dsn:
raise RuntimeError("Sentry dsn not configured neither as environmental"
" variable nor in the settings.py file")
RAVEN_CONFIG = {
'dsn': sentry_dsn,
'release': '[email protected]',
}
INSTALLED_APPS += ('raven.contrib.django.raven_compat',)
LOGGING['handlers']['sentry'] = {
'class': 'raven.contrib.django.handlers.SentryHandler'
}
LOGGING['loggers']['django.request']['handlers'] = ['sentry', 'mail_admins']
# A random string
# https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-SECRET_KEY
SECRET_KEY = None
# Other django settings
# https://docs.djangoproject.com/en/dev/ref/settings/
LANGUAGE_CODE = 'en-us'
LANGUAGES = (('en', 'English'), ('gr', 'Greek'))
# related to /elections-held view
ZEUS_ELECTION_STATS_CSV_PATH = ""
ZEUS_ELECTION_STATS_INSTITUTION_MAP_PATH = ""
ZEUS_ELECTION_STATS_SMART_MAP = True