diff --git a/web/app/routers/setup.py b/web/app/routers/setup.py index 8dc0124..37da3a3 100644 --- a/web/app/routers/setup.py +++ b/web/app/routers/setup.py @@ -61,9 +61,11 @@ async def setup_page( "reconfiguring": existing is not None and has_users, "forgejo_base_url": existing.forgejo_base_url if existing else "", "forgejo_oauth_client_id": existing.forgejo_oauth_client_id if existing else "", - "firebreak_public_base_url": existing.firebreak_public_base_url - if existing - else "", + # Pre-fill with the request's own base URL so the field is never + # accidentally left blank: an empty value only works while the caller + # is browsing the same origin that Forgejo redirects back to, and any + # generated share link needs an externally resolvable address. + "firebreak_public_base_url": public_base, "oauth_callback_url": f"{public_base}/auth/callback/forgejo", } return templates.TemplateResponse(request, "setup.html", ctx) diff --git a/web/app/templates/setup.html b/web/app/templates/setup.html index e1fbdd6..a2b1a93 100644 --- a/web/app/templates/setup.html +++ b/web/app/templates/setup.html @@ -112,16 +112,17 @@

- Your production domain for OAuth redirects. Leave blank on localhost — Firebreak will use http://localhost:8000 automatically. + The address Forgejo redirects back to after sign-in, and the origin + share links point at. Pre-filled from how you reached this page + — change it to your real domain once Firebreak is deployed.