-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
27 lines (21 loc) · 743 Bytes
/
setup.py
File metadata and controls
27 lines (21 loc) · 743 Bytes
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
import os, json
from sys import exit
from lib.Frontend.lib.Core.Utils.funcs import generateNonce
from conf import CONF_ROOT, INFORMA_CONF_ROOT
if __name__ == "__main__":
default_home_mime_types = ["image/jpeg", "video/x-matroska"]
try:
with open(os.path.join(CONF_ROOT, "unveillance.secrets.json"), 'rb') as CONF:
config = json.loads(CONF.read())
if 'web_home_mime_types' in config.keys():
default_home_mime_types = config['web_home_mime_types']
except Exception as e:
print "NO CONF?"
with open(os.path.join(INFORMA_CONF_ROOT, "informacam.init.json"), 'wb+') as WEB:
WEB.write(json.dumps({
'web' : {
'BATCH_SALT' : generateNonce(),
'DEFAULT_HOME_MIME_TYPES' : default_home_mime_types
}
}))
exit(0)