forked from gsathya/centinel-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
25 lines (21 loc) · 755 Bytes
/
run.py
File metadata and controls
25 lines (21 loc) · 755 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
import centinel
import centinel.models
import centinel.views
import config
import os
app = centinel.app
if __name__ == "__main__":
db = centinel.db
sql_dir = os.path.dirname(config.sqlite_db)
if not os.path.exists(sql_dir):
os.makedirs(sql_dir)
if not os.path.exists(config.sqlite_db):
db.create_all()
# create an admin and client role
db.session.add(centinel.models.Role('admin'))
db.session.add(centinel.models.Role('client'))
db.session.commit()
# Also, I shouldn't have to say this, but *DO NOT COMMIT THE
# KEY*. Under no circumstances should the key be committed
app.run(host="0.0.0.0", port=8082, debug=True,
ssl_context=(config.ssl_cert, config.ssl_key))