Work increment

This commit is contained in:
Wojciech Janota 2022-10-26 17:40:08 +02:00
parent 8988f12a14
commit 42cd900638
6 changed files with 21 additions and 0 deletions

2
config.yaml.example Normal file
View File

@ -0,0 +1,2 @@
server_name: "valhalla"
server_port: 8088

View File

@ -10,4 +10,5 @@ class Server(host, port, name, access_password, version):
@app.route("/client/register") @app.route("/client/register")
def register_new_client_to_database(self): def register_new_client_to_database(self):
# TODO: implement # TODO: implement

1
utils/config/__init__.py Normal file
View File

@ -0,0 +1 @@
from utils.config import ServerConfig

16
utils/config/config.py Normal file
View File

@ -0,0 +1,16 @@
import os
import yaml
class ServerConfig:
config_file = {}
with open("~/.config/orchestrator/config.yml", "r") as stream:
try:
config_file = yaml.safe_load(stream)
except Exception as e:
print(e)
config = config_file
server_name_override = os.environ.get("VALHALLA_SERVER_NAME")
server_port_override = os.environ.get("VALHALLA_SERVER_PORT")

View File

View File

@ -0,0 +1 @@
from simplesqlite import SimpleSQLite