feat: configure Forgejo ROOT_URL for /forge/ subpath routing #1080
Labels
No labels
action
backlog
blocked
bug-report
cannot-reproduce
in-progress
in-triage
needs-triage
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
rejected
reproduced
tech-debt
underspecified
vision
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#1080
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
/forge/*subpath routing returns 404 because Forgejo is configured withROOT_URL = http://forgejo:3000/(no subpath). Forgejo doesn't know requests arrive under/forge/so its internal route table misses. Configure Forgejo with a subpath-awareROOT_URLand verify the Caddyfile handle block cooperates (no prefix strip needed — Forgejo handles the prefix natively when ROOT_URL is set).Evidence
Live probe on 2026-04-20:
Forgejo container env (verified via
docker exec disinto-forgejo env):Should be:
Forgejo's app.ini mirrors this as
ROOT_URL = http://forgejo:3000/forge/.The fix
Set
FORGEJO__server__ROOT_URLto include the/forge/suffix in the compose service env. The generator atlib/generators.shemits this value; update so it produces the subpath form whenEDGE_TUNNEL_FQDNis set (existing logic atbin/disinto:842-847mentioned in #1025 body may already cover part of this — verify).Also verify the Caddyfile
handle /forge/*block does not strip the prefix (unlike staging #NNNN). Forgejo needs the full/forge/...path to arrive so its own router recognizes it.Acceptance criteria
FORGEJO__server__ROOT_URLset to include/forge/subpath when subpath routing is activedocker exec disinto-forgejo env | grep ROOT_URLcurl http://localhost/forge/returns 200 with Forgejo landing page HTML (not 404)curl -L http://localhost/forge/user/loginreturns a 200 with the login form/forge/prefix (grep the response forhref="/)/ci/end-to-end)tests/smoke-edge-subpath.shTest 2 and Test 3 pass against live edge/ci/stays 200)Affected files
lib/generators.sh— FORGEJO__server__ROOT_URL emission (and WOODPECKER_HOST if analogous)docker-compose.yml(if ROOT_URL is hardcoded there instead of generated)tests/smoke-edge-subpath.sh— no change expected; already covers this pathNotes
Forgejo subpath has known upstream quirks (asset paths, avatar URLs, OAuth callback URLs). The sprint pitch for #623 (
edge-subpath-chat) explicitly flagged this as a risk and documented a fallback plan atdocs/edge-routing-fallback.md— if subpath routing has intractable issues after this fix, pivot to per-service subdomains per that plan.Related
/staging/strip_prefix fix