adding rest of docker files

This commit is contained in:
2023-12-03 10:18:20 -08:00
parent 618fd1c4bb
commit 71dbd5eab7
8 changed files with 1144 additions and 0 deletions

40
src/__init__.py Normal file
View File

@@ -0,0 +1,40 @@
from server import server
from util import (
create_ssl_cert,
init_mssql_db,
init_mysql_db,
load_conf,
create_web_config,
check_existing_token,
load_db_conn,
)
def main():
cfg = load_conf()
if cfg["useSSL"]:
create_ssl_cert([cfg["backendIP"]])
if cfg["dbMode"] and cfg["sqlDatabase"] and cfg["sqlPassword"] and cfg["sqlServerIP"] and cfg["sqlUsername"]:
print("Using " + cfg["dbMode"] + " DB")
try:
conn = load_db_conn()[0]
if cfg["dbMode"] == "mssql":
init_mssql_db(conn)
elif cfg["dbMode"] == "mysql":
init_mysql_db(conn)
else:
print("Error! No valid db mode found. Please use mssql or mysql")
except Exception as e:
print(e)
else:
print("No db mode set.")
check_existing_token()
create_web_config()
server()
if __name__ == "__main__":
main()