Scope server routes by base path

This commit is contained in:
Jage9
2026-03-08 22:24:32 -04:00
parent bd0ec1b01e
commit 54a7a3085b
14 changed files with 113 additions and 47 deletions

View File

@@ -57,6 +57,7 @@ except ModuleNotFoundError: # pragma: no cover - compatibility fallback
config_path = Path(sys.argv[1])
host = "127.0.0.1"
port = 8765
base_path = "/"
if config_path.exists():
with config_path.open("rb") as fp:
data = tomllib.load(fp)
@@ -72,7 +73,9 @@ if config_path.exists():
port = int(server.get("port", port))
except (TypeError, ValueError):
port = 8765
print(f"http://{host}:{port}/auth/session/check")
raw_base_path = str(server.get("base_path", base_path)).strip() or "/"
base_path = "/" if raw_base_path == "/" else f"/{raw_base_path.strip('/')}/"
print(f"http://{host}:{port}{base_path}auth/session/check")
PY
)"
escaped_host_origin=${CHGRID_HOST_ORIGIN//\\/\\\\}