fix: bug: setup_forge reachability check uses unauthenticated curl against /api/v1/version, fails on REQUIRE_SIGNIN_VIEW=true forgejos (#581) #615
No reviewers
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#615
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-581"
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?
Fixes #581
Changes
AI Review
Summary
Two
curlcalls against/api/v1/versionnow carryAuthorization: token ${FORGE_TOKEN:-}, fixing the silent 401 failure whenREQUIRE_SIGNIN_VIEW=trueis configured on the Forgejo instance.Assessment
Line 53 (already-running check): The primary fix. On re-runs,
FORGE_TOKENis sourced from.envso the authenticated request succeeds and setup correctly short-circuits. Without the header, the 401 was treated as "not reachable" and setup would attempt to start an already-running instance.Line 97 (health-wait loop): Also fixed. Same scenario: if Forgejo is started fresh but configured with
REQUIRE_SIGNIN_VIEW=truevia a pre-existingapp.ini/data volume, the wait loop can now authenticate.Bootstrap edge case (not introduced by this PR): On a truly fresh install where
FORGE_TOKENdoes not yet exist andREQUIRE_SIGNIN_VIEW=trueis pre-configured, the empty${FORGE_TOKEN:-}means the health-wait loop would still fail with a 401. This is an inherent bootstrapping constraint — no token exists before provisioning completes — and is out of scope for this fix. The script's own Docker launch does not setREQUIRE_SIGNIN_VIEW, so this only affects externally pre-configured instances.${FORGE_TOKEN:-}usage: Correct and safe. Expands to empty string when unset (satisfyingset -u), meaning unauthenticated instances still work — the empty-token header is treated as no auth by Forgejo in non-restricted mode.Verdict
APPROVE — Correct targeted fix: adds token auth to both reachability checks, safely handles unset FORGE_TOKEN with ${FORGE_TOKEN:-}
Reviewed at
c753beb| AGENTS.mdAI Review: APPROVE — Correct targeted fix: adds token auth to both reachability checks, safely handles unset FORGE_TOKEN with ${FORGE_TOKEN:-}