config refactor

This commit is contained in:
Zsolt Ero
2024-08-29 01:40:21 +02:00
parent 2fc91aa470
commit 939b782830
7 changed files with 59 additions and 61 deletions

View File

@@ -0,0 +1,26 @@
import json
from pathlib import Path
class Configuration:
http_host_dir = Path('/data/ofm/http_host')
nginx_dir = Path(__file__).parent / 'nginx'
default_runs_dir = http_host_dir / 'runs'
default_assets_dir = http_host_dir / 'assets'
mnt_dir = Path('/mnt/ofm')
ofm_config_dir = Path('/data/ofm/config')
http_host_bin = http_host_dir / 'bin'
certs_dir = Path('/data/nginx/certs')
try:
with open('/data/ofm/config/http_host.json') as fp:
host_config = json.load(fp)
except Exception:
host_config = {}
config = Configuration()