web_server: Fix locating SVG icons on production setup

Tests:

- On a development setup, loading the home page and a few other pages works
without errors. FreedomBox icon in the navbar (and other icons) are shown.

- On a testing setup, without development mode, loading the home page and a few
other pages works without errors. FreedomBox icon in the navbar (and other
icons) are shown. Without the patch no page loads.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2026-03-25 22:10:32 -07:00 committed by James Valleroy
parent ab8d87e71d
commit 8cd1fbc6b9
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -210,4 +210,4 @@ def resolve_static_path(url: str) -> pathlib.Path:
return static_dir / '/'.join(url_parts[1:]) return static_dir / '/'.join(url_parts[1:])
return pathlib.Path(__file__).parent.parent / 'static' / url return pathlib.Path(cfg.file_root) / 'static' / url