fix(webui): security hardening + launch theme crash; add CI - #249
fix(webui): security hardening + launch theme crash; add CI#249WODE25500 wants to merge 4 commits into
Conversation
- Default bind 127.0.0.1 (was 0.0.0.0); warn to stderr on a non-localhost bind. - Move gradio theme onto gr.Blocks (fixes a launch crash: launch() has no theme param). - Guard empty out_dir in scan_outputs. - Add .github/workflows/ci.yml (test py 3.10/3.11/3.12 + docs mkdocs --strict).
|
Thanks — the localhost default, empty-output guard, and CI setup are useful. One supported-version compatibility issue blocks this as written.
Please either make theme placement runtime-compatible with each supported Gradio API ( |
Address maintainer review on microsoft#249: - Place the gradio theme on Blocks for Gradio <=5 and on launch() for Gradio 6, detected via the installed major, so the WebUI works on any supported version without an ignored-argument warning or a TypeError. - Add a real Gradio build/launch smoke test (skips without the webui extra) asserting the theme is actually applied and no error is raised.
Verified against real Gradio 4.44, 5.50, and 6.25 (built sequentially to avoid conflicting pins): - build_ui() succeeds on all three; theme is placed on Blocks for <6 and on launch() for >=6 (no TypeError / ignored-arg warning). - The launch smoke skips cleanly when a headless/sandboxed environment blocks localhost (not a compatibility bug), and asserts theme application when it launches.
|
Yifan Yang (@Yif-Yang) — thank you for the thorough review and guidance! I've addressed the feedback:
Thanks again for the detailed review! |
Security/robustness hardening for the Gradio WebUI, plus a first CI workflow.
Note: the pre-existing WebUI scan_outputs path traversal (arbitrary typed path) is intentionally left as-is; the localhost default is the mitigation.