-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconfig.py
More file actions
106 lines (93 loc) · 2.22 KB
/
config.py
File metadata and controls
106 lines (93 loc) · 2.22 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
"""
Configuration file for YunNet-Backend
"""
import sanic
# ---Begin configuration file--- #
"""
Sanic debug mode
"""
DEBUG = True
DEBUG_ENABLE_SMTP = False
DEBUG_ENABLE_SQL = True
DEBUG_PRINT_SQL_ONLY = False
DEBUG_ENABLE_MONGO = False
"""
Logger SocketHandler configuration
"""
LOGGING_SOCKET_ENABLED = False
LOGGING_SOCKET = {"host": "logger", "port": 9000}
"""
MAC Updater endpoint URI
"""
MAC_UPDATER_ENDPOINT = "http://updater:8000"
"""
Password salt
"""
PASSWORD_SALT = "PutYourSuperLongSaltSecretHereForPasswordHash"
"""
JWT configuration
"""
CUSTOM_JWT_SECRET = True # Generates new secret when backend starts
JWT = {
"useRSA": False, # RSA support is at low priority
"jwtSecret": "PutYourLongJsonWebTokenSecretHereForVerifyingSignature",
"algorithm": "HS256", # set approriate algorithm
# 'jwtPublicKey': '',
# 'jwtPrivateKey': '',
}
"""
SMTP Client parameters
"""
SMTP_CLIENT_PARAMETERS = {"hostname": "", "port": 465, "use_tls": True}
SMTP_CREDENTIALS = {"username": "", "password": ""}
"""
SQL_CREDENTIALS is the parameters of Connection constructor in PyMySQL
https://pymysql.readthedocs.io/en/latest/modules/connections.html#pymysql.connections.Connection
"""
SQL_CREDENTIALS = {
"host": "db",
"port": 3306,
"user": "root",
"password": "toor",
"db": "YunNet",
"autocommit": True,
}
"""
Setup MongoDB for logging
"""
MONGODB_URI = "mongodb://mongo:27017"
"""
Google reCaptcha configuration
"""
RECAPTCHA = {"enabled": False, "secret": ""}
"""
Sanic app configuration
https://sanic.readthedocs.io/en/latest/sanic/deploying.html
"""
SANIC_APP: dict = {
"host": "0.0.0.0",
"port": "8000",
# 'debug': False,
"ssl": None,
# 'sock': None,
# 'workers': 1,
# 'loop': None,
# 'protocol': sanic.websocket.HttpProtocol,
# 'access_log': True,
}
"""
Sanic configuration
Uncomment if you want to modify it
https://sanic.readthedocs.io/en/latest/sanic/config.html
"""
# REQUEST_MAX_SIZE = 100000000
# REQUEST_BUFFER_QUEUE_SIZE = 100
# REQUEST_TIMEOUT = 60
# RESPONSE_TIMEOUT = 60
# KEEP_ALIVE = True
# KEEP_ALIVE_TIMEOUT = 5
# GRACEFUL_SHUTDOWN_TIMEOUT = 15.0
# ACCESS_LOG = True
# PROXIES_COUNT = -1
# FORWARDED_FOR_HEADER = "X-Forwarded-For"
# REAL_IP_HEADER = "X-Real-IP"