-
Notifications
You must be signed in to change notification settings - Fork 0
/
temp-config.py
148 lines (136 loc) · 7.24 KB
/
temp-config.py
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
"""=== Public config file ==========================================================
Including settings for the Project, to be changed on or after install.
Not including sensitive data
================================================================== by Sziller ==="""
import os
HOME = os.path.expanduser("~") # experimental row to be developed later
# Development settings:
isLIVE: bool = True
# Language settings:
LANGUAGE_CODE = "EN" # ["HU", "DE"]
# Path settings:
PATH_ROOT: str = "."
PATH_ERROR_MSG: str = "{}/shmc_api_classes/xdata/error.yaml"
PATH_APP_INFO: str = "{}/shmc_api_classes/xdata/shmc.yaml"
PATH_STATIC_FROM: str = "public"
PATH_STATIC_TO: str = "/"
NECESSARY_DIRECTORIES: list = ["./images", "./documentation", "./documents", "./log"]
# Log settings:
LOG_FORMAT: str = "%(asctime)s [%(levelname)8s]: %(message)s"
LOG_LEVEL: str = "DEBUG" # NOTSET=0, DEBUG=10, INFO=20, WARNING=30, ERROR=40, CRITICAL=50
LOG_PATH: str = "{}/log/"
LOG_FILENAME: str = "{}srvr-shmc{}.log" # location of logfile. 1st {} = ROOT_PATH, 2nd {} timestamp
LOG_TIMED: bool = False # True: new log file created - stamp in name, False: no stamp, file overwritten
LOG_TIMEFORMAT: str = "%y%m%d %H:%M:%S"
# App settings:
APP_ID: str = "shmc"
APP_PATH: str = "/app"
APP_IS_PROCESS_RUNNING: bool = True
# ---------------------------------------------------------------------------------------------------
# SERVER build-up - START -
# ---------------------------------------------------------------------------------------------------
# Configure your Server.
# List necessary Routers here.
# Routers are passed as dictionary items.
# Routers receive the following parameters passed on startup:
'''
{
<name>: # name of the router - key
{ "use": bool, # if current router instance is used
"prefix": str, # path prefix for current router
"arguments": {
"ip": str[xx.xx.xx.xx], # ip address
"port": int, # Engine's DB access port
"zmq_port": int, # if socket comm. allowed to engine, use this port
}, # dict of {param: arg} pairs for current router instance
"module": str ["xxx.xxx"], # module out of which "router" obj is instantiated
"description": "Information regarding router",
"externalDocs": {
"description": "find additional info under: sziller.eu",
"url": "http://sziller.eu"
},
<name-02>:
{},
... }
'''
APP_ROUTER_INFO = {
'authorization': {
"use": True,
"prefix": "/auth",
"args": {"ip": 'localhost', # fill in your IP
"port": 0, # fill in your PORT
"zmq_port": 0}, # fill in your PORT
"module": "shmc_routers.AuthRouter_class",
"description": "Information regarding Authorization",
"externalDocs": {
"description": "find additional info under: sziller.eu",
"url": "https://shmc.sziller.eu"}},
'wallet': {
"use": False,
"prefix": "/wllt",
"args": {"ip": '192.168.01.wlt', # fill in your IP
"port": 0, # fill in your PORT
"zmq_port": 0}, # fill in your PORT
"module": "shmc_routers.WalletRouter_class",
"description": "If you run a Wallet instance in the SHMC framework - use these endpoints. "
"Instance name matches the path-prefix assigned to Router. "
"ATTENTION: you need authentication to access the Background Engine!",
"externalDocs": {
"description": "or visit the git repo: _rasp_wallet",
"url": "https://github.com/sziller"}},
"aquaponics": {
"use": True,
"prefix": "/aqua",
"args": {"ip": '192.168.01.aqu', # fill in your IP
"port": 0, # fill in your PORT
"zmq_port": 0}, # fill in your PORT
"module": "shmc_routers.AquaRouter_class",
"description": "If you run an Aquaponics Engine instance in the SHMC framework - use these endpoints. "
"Instance name matches the path-prefix assigned to Router. "
"ATTENTION: you need authentication to access the Background Engine!",
"externalDocs": {
"description": "or visit the git repo: _rasp_aquaponics",
"url": "https://github.com/sziller"}},
"observatory": {
"use": True,
"prefix": "/obsr",
"args": {"ip": '192.168.01.obs', # fill in your IP
"port": 0, # fill in your PORT
"zmq_port": 0}, # fill in your PORT
"module": "shmc_routers.ObsrRouter_class",
"description": "If you run an Observatory Engine instance in the SHMC framework - use these endpoints. "
"Instance name matches the path-prefix assigned to Router. "
"ATTENTION: you need authentication to access the Background Engine!",
"externalDocs": {
"description": "or visit the git repo: _rasp_observatory",
"url": "https://github.com/sziller"}},
"kidsroom": {
"use": True,
"prefix": "/r_ks",
"args": {"ip": '192.168.01.rks', # fill in your IP
"port": 0, # fill in your PORT
"zmq_port": 0}, # fill in your PORT
"module": "shmc_routers.RoomRouter_class", # probably 'room' only!
"description": "If you run a RoomManager Engine instance in the SHMC framework - use these endpoints. "
"Instance name matches the path-prefix assigned to Router. "
"ATTENTION: you need authentication to access the Background Engine!",
"externalDocs": {
"description": "or visit the git repo: _rasp_roommanager",
"url": "https://github.com/sziller"}},
"floroom": {
"use": False,
"prefix": "/r_fl",
"args": {"ip": '192.168.01.rfl', # fill in your IP
"port": 0, # fill in your PORT
"zmq_port": 0}, # fill in your PORT
"module": "shmc_routers.RoomRouter_class",
"description": "If you run a RoomManager Engine instance in the SHMC framework - use these endpoints. "
"Instance name matches the path-prefix assigned to Router. "
"ATTENTION: you need authentication to access the Background Engine!",
"externalDocs": {
"description": "or visit the git repo: _rasp_roommanager",
"url": "https://github.com/sziller"}}
}
# ---------------------------------------------------------------------------------------------------
# SERVER build-up - ENDED -
# ---------------------------------------------------------------------------------------------------