inital v4

This commit is contained in:
TutorialsGHG
2026-05-25 20:46:00 +02:00
parent fca54607cb
commit 1adec1b88f
42 changed files with 56666 additions and 0 deletions

29
v4/server/app/config.py Normal file
View File

@@ -0,0 +1,29 @@
from __future__ import annotations
import os
from pathlib import Path
class Config:
host: str = os.getenv("NP4_HOST", "0.0.0.0")
port: int = int(os.getenv("NP4_PORT", "8080"))
api_token: str = os.getenv("NP4_API_TOKEN", "").strip()
data_dir: Path = Path(os.getenv("NP4_DATA_DIR", "./v4_data")).resolve()
ui_dir: Path = Path(
os.getenv(
"NP4_UI_DIR",
str((Path(__file__).resolve().parents[3] / "ui").resolve()),
)
)
pwa_dir: Path = Path(
os.getenv(
"NP4_PWA_DIR",
str((Path(__file__).resolve().parents[3] / "pwa").resolve()),
)
)
@classmethod
def ensure_dirs(cls) -> None:
cls.data_dir.mkdir(parents=True, exist_ok=True)