From e873632f9507096932247d69d5dbcba408eb9004 Mon Sep 17 00:00:00 2001 From: Chuck Date: Sat, 30 May 2026 20:46:04 -0400 Subject: [PATCH] fix(pages_v3): add ledmatrix- prefix fallback for plugin_id in web-ui route Mirror PluginManager's ledmatrix- directory fallback in the serve_plugin_web_ui route, so plugins installed under either naming convention (e.g. 'flights' on-disk as 'ledmatrix-flights') are served correctly. Addresses coderabbit review comment. Co-Authored-By: Claude Sonnet 4.6 --- web_interface/blueprints/pages_v3.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/web_interface/blueprints/pages_v3.py b/web_interface/blueprints/pages_v3.py index f4c0ba68..03f009a8 100644 --- a/web_interface/blueprints/pages_v3.py +++ b/web_interface/blueprints/pages_v3.py @@ -129,6 +129,16 @@ def serve_plugin_web_ui(plugin_id, filename): # Path containment guard — plugin_dir must be inside plugins base _plugin_dir.relative_to(_plugins_base) + # Mirror PluginManager's ledmatrix- prefix fallback so both naming + # conventions (e.g. "flights" installed as "ledmatrix-flights") work. + if not _plugin_dir.exists(): + _alt = (_plugins_base / f'ledmatrix-{plugin_id}').resolve() + try: + _alt.relative_to(_plugins_base) + _plugin_dir = _alt + except ValueError: + pass # alt path escaped base — ignore + web_ui_path = (_plugin_dir / 'web_ui' / filename).resolve() # Second containment guard — must stay inside the plugin's web_ui dir web_ui_path.relative_to(_plugin_dir / 'web_ui')