mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-22 06:22:16 +00:00
config refactor
This commit is contained in:
26
scripts/http_host/http_host_lib/config.py
Normal file
26
scripts/http_host/http_host_lib/config.py
Normal 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()
|
||||
Reference in New Issue
Block a user