forked from gsathya/centinel-server
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathconfig.py
More file actions
49 lines (38 loc) · 1.39 KB
/
config.py
File metadata and controls
49 lines (38 loc) · 1.39 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
import os
import getpass
import logging
# misc
recommended_version = 1.1
production = True
# user details
current_user = getpass.getuser()
centinel_home = "/opt/centinel-server/"
# directory structure
results_dir = os.path.join(centinel_home, 'results')
experiments_dir = os.path.join(centinel_home, 'experiments')
inputs_dir = os.path.join(centinel_home, 'inputs')
static_files_allowed = ['economistDemocracyIndex.pdf', 'consent.js']
# details for how to access the database
def load_uri_from_file(filename):
with open(filename, 'r') as filep:
uri = filep.read()
return uri
# Setup the database to connect to
database_uri_file = os.path.join(centinel_home, "cent.pgpass")
if not production:
DATABASE_URI = "postgresql://postgres:postgres@localhost/centinel"
else:
DATABASE_URI = load_uri_from_file(database_uri_file)
# GeoIP and AS databases from http://dev.maxmind.com/geoip/legacy/geolite/
# use https://dev.maxmind.com/geoip/geoipupdate/#For_Free_GeoLite2_and_GeoLite_Legacy_Databases
# to update databases
geoip_db = '/usr/local/share/GeoIP/GeoLite2-Country.mmdb'
asn_db = '/usr/local/share/GeoIP/GeoLiteASNum.dat'
# consent form
prefetch_freedomhouse = False
# web server
ssl_cert = "server.iclab.org.crt"
ssl_key = "server.iclab.org.key"
ssl_chain = "server.iclab.org_bundle.crt"
LOG_FILE = os.path.join(centinel_home, "centinel-server.log")
LOG_LEVEL = logging.DEBUG