mirror of
https://github.com/bunny-lab-io/Borealis.git
synced 2025-10-26 13:21:57 -06:00
Fix Engine static root fallback for legacy WebUI
This commit is contained in:
@@ -114,10 +114,15 @@ def _resolve_static_root(project_root: Path) -> Path:
|
||||
candidates = (
|
||||
project_root / "Engine" / "web-interface" / "build",
|
||||
project_root / "Engine" / "web-interface" / "dist",
|
||||
project_root / "Engine" / "web-interface",
|
||||
project_root / "Data" / "Engine" / "WebUI" / "build",
|
||||
project_root / "Data" / "Engine" / "WebUI",
|
||||
project_root / "Data" / "Server" / "web-interface" / "build",
|
||||
project_root / "Data" / "Server" / "web-interface",
|
||||
project_root / "Data" / "Server" / "WebUI" / "build",
|
||||
project_root / "Data" / "Server" / "WebUI",
|
||||
project_root / "Data" / "WebUI" / "build",
|
||||
project_root / "Data" / "WebUI",
|
||||
)
|
||||
for path in candidates:
|
||||
resolved = path.resolve()
|
||||
|
||||
@@ -42,3 +42,20 @@ def test_static_root_env_override(tmp_path, monkeypatch):
|
||||
|
||||
monkeypatch.delenv("BOREALIS_STATIC_ROOT", raising=False)
|
||||
monkeypatch.delenv("BOREALIS_ROOT", raising=False)
|
||||
|
||||
|
||||
def test_static_root_falls_back_to_legacy_source(tmp_path, monkeypatch):
|
||||
"""Legacy WebUI source should be served when no build assets exist."""
|
||||
|
||||
legacy_source = tmp_path / "Data" / "Server" / "WebUI"
|
||||
legacy_source.mkdir(parents=True)
|
||||
(legacy_source / "index.html").write_text("<html></html>", encoding="utf-8")
|
||||
|
||||
monkeypatch.setenv("BOREALIS_ROOT", str(tmp_path))
|
||||
monkeypatch.delenv("BOREALIS_STATIC_ROOT", raising=False)
|
||||
|
||||
settings = load_environment()
|
||||
|
||||
assert settings.flask.static_root == legacy_source.resolve()
|
||||
|
||||
monkeypatch.delenv("BOREALIS_ROOT", raising=False)
|
||||
|
||||
Reference in New Issue
Block a user