diff --git a/app/components/ui_switcher.py b/app/components/ui_switcher.py index 2fb4a02..8526e6b 100644 --- a/app/components/ui_switcher.py +++ b/app/components/ui_switcher.py @@ -32,6 +32,13 @@ _DEMO_MODE = os.environ.get("DEMO_MODE", "").lower() in ("1", "true", "yes") # Example: PEREGRINE_VUE_URL=http://localhost:8506 _VUE_URL = os.environ.get("PEREGRINE_VUE_URL", "").strip().rstrip("/") +# When True, a window.location.reload() after setting prgn_ui=vue will be +# intercepted by Caddy and routed to the Vue SPA. When False (no Caddy in the +# traffic path — e.g. test instances, direct Docker exposure), reloading just +# comes back to Streamlit and creates an infinite loop. Only set this in +# production/staging compose files where Caddy is actually in front. +_CADDY_PROXY = os.environ.get("PEREGRINE_CADDY_PROXY", "").lower() in ("1", "true", "yes") + _COOKIE_JS = """