Fix --config option not being respected, fixes #172
This commit is contained in:
parent
944b80129b
commit
d1048694d4
@ -1,7 +1,5 @@
|
|||||||
from core.config import CoreConfig
|
from core.config import CoreConfig
|
||||||
from core.allnet import AllnetServlet, BillingServlet
|
|
||||||
from core.aimedb import AimedbServlette
|
from core.aimedb import AimedbServlette
|
||||||
from core.title import TitleServlet
|
from core.title import TitleServlet
|
||||||
from core.utils import Utils
|
from core.utils import Utils
|
||||||
from core.mucha import MuchaServlet
|
from core.mucha import MuchaServlet
|
||||||
from core.frontend import FrontendServlet
|
|
||||||
|
@ -9,7 +9,8 @@ from starlette.responses import PlainTextResponse
|
|||||||
from os import environ, path, mkdir, W_OK, access
|
from os import environ, path, mkdir, W_OK, access
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from core import CoreConfig, TitleServlet, MuchaServlet, AllnetServlet, BillingServlet, AimedbServlette
|
from core import CoreConfig, TitleServlet, MuchaServlet
|
||||||
|
from core.allnet import AllnetServlet, BillingServlet
|
||||||
from core.frontend import FrontendServlet
|
from core.frontend import FrontendServlet
|
||||||
|
|
||||||
async def dummy_rt(request: Request):
|
async def dummy_rt(request: Request):
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import argparse
|
import argparse
|
||||||
import logging
|
import logging
|
||||||
from os import mkdir, path, access, W_OK
|
from os import mkdir, path, access, W_OK, environ
|
||||||
import yaml
|
import yaml
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
@ -25,10 +25,11 @@ if __name__ == "__main__":
|
|||||||
parser.add_argument("action", type=str, help="create, upgrade, downgrade, create-owner, migrate, create-revision, create-autorevision")
|
parser.add_argument("action", type=str, help="create, upgrade, downgrade, create-owner, migrate, create-revision, create-autorevision")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
environ["ARTEMIS_CFG_DIR"] = args.config
|
||||||
|
|
||||||
cfg = CoreConfig()
|
cfg = CoreConfig()
|
||||||
if path.exists(f"{args.config}/core.yaml"):
|
if path.exists(f"{args.config}/core.yaml"):
|
||||||
cfg_dict = yaml.safe_load(open(f"{args.config}/core.yaml"))
|
cfg_dict = yaml.safe_load(open(f"{args.config}/core.yaml"))
|
||||||
cfg_dict.get("database", {})["loglevel"] = "info"
|
|
||||||
cfg.update(cfg_dict)
|
cfg.update(cfg_dict)
|
||||||
|
|
||||||
if not path.exists(cfg.server.log_dir):
|
if not path.exists(cfg.server.log_dir):
|
||||||
|
3
index.py
3
index.py
@ -6,7 +6,8 @@ import uvicorn
|
|||||||
import logging
|
import logging
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
from core import CoreConfig, AimedbServlette
|
from core.config import CoreConfig
|
||||||
|
from core.aimedb import AimedbServlette
|
||||||
|
|
||||||
async def launch_main(cfg: CoreConfig, ssl: bool) -> None:
|
async def launch_main(cfg: CoreConfig, ssl: bool) -> None:
|
||||||
if ssl:
|
if ssl:
|
||||||
|
Loading…
Reference in New Issue
Block a user