fix: bind Forgejo HTTP to IPv4 so Woodpecker CI can clone #124
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-platform!124
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "121-forgejo-ipv4-binding"
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?
Summary
Forgejo defaults to listening on
[::]:80(IPv6 only). Woodpecker pipeline pods connect via IPv4 to the ClusterIP, causingconnection refusedon every CI clone step. This addsHTTP_ADDR = "0.0.0.0"to the Forgejo Helm values so the server accepts IPv4 connections.Changes
terraform/main.tf-- AddedHTTP_ADDR = "0.0.0.0"togitea.config.serverblock in the Forgejo Helm release values (line 630)tofu plan Output
No other drift detected. Only the Forgejo Helm release is affected.
Deployment note: This is a stateful service (Forgejo). The Helm release update will trigger a pod restart. The change is safe -- it only adds an IPv4 bind address to the existing IPv6 listener. No data migration, no schema change, no volume impact. Expect ~30s of Forgejo downtime during pod restart.
Blast radius (positive): Also fixes blackbox probe reliability and Woodpecker-to-Forgejo API connectivity for all repos (basketball-api, westside-app, etc.).
Test Plan
kubectl get pods -n forgejo)kubectl exec -n forgejo forgejo-0 -- cat /proc/net/tcpshows LISTEN on port 80Review Checklist
tofu fmtcleantofu validatepassestofu plan -lock=falseshows only expected changeRelated
plan-pal-e-platformReview: LGTM
Diff: 1 file changed, 1 insertion, 0 deletions. Minimal and surgical.
Correctness:
HTTP_ADDR = "0.0.0.0"is the correct Gitea/Forgejoapp.inisetting to bind the HTTP server to all IPv4 interfaces. This is placed in thegitea.config.serverblock which the Forgejo Helm chart templates intoapp.iniunder[server]. The setting is well-documented in the Forgejo/Gitea config cheat sheet.Placement: The new key is correctly placed inside the existing
serverblock alongsideDOMAIN,ROOT_URL, andSSH_DOMAIN. Alignment uses consistent spacing.No regressions: Binding to
0.0.0.0does not disable IPv6 -- Forgejo will continue to accept IPv6 connections. This is purely additive.tofu plan verified: Plan output confirms only
helm_release.forgejochanges, with the singleHTTP_ADDRaddition. No drift on any other resource.No issues found. Ready for merge.
PR #124 Review
DOMAIN REVIEW
Tech stack: OpenTofu / Helm provider / Forgejo Helm chart (Terraform/k8s domain).
Change: Single line addition in
terraform/main.tf(line 630) -- addsHTTP_ADDR = "0.0.0.0"to thegitea.config.serverblock of the Forgejo Helm release.Analysis:
Correctness: Forgejo (Gitea fork) defaults
HTTP_ADDRto0.0.0.0in its own configuration, but the Forgejo Helm chart overrides this with::(IPv6 only) in itsapp.initemplate. On k3s with IPv4 ClusterIP services, this means pod-to-pod traffic over IPv4 getsconnection refused. Explicitly settingHTTP_ADDR = "0.0.0.0"restores IPv4 binding. This is the correct fix for the root cause described in issue #121.Blast radius: The
tofu planoutput confirms onlyhelm_release.forgejois affected with an in-place update. No other resources change. The deployment note correctly identifies a ~30s Forgejo restart window.Terraform style: The value aligns with existing key spacing in the
serverblock (DOMAIN,ROOT_URL,SSH_DOMAIN,HTTP_ADDRall use consistent alignment).tofu fmtcompliance is claimed and the formatting looks correct.k8s security: Binding to
0.0.0.0inside a container is standard practice -- the container is already behind aClusterIPservice (service.http.type = "ClusterIP"at line 645). Network-level access control is handled by the Kubernetes service + any NetworkPolicies, not by the bind address inside the container.Secrets handling: No secrets introduced. All existing secrets in the Forgejo Helm release remain properly wired through
var.*references andset_sensitiveblocks.State safety: In-place update only. No resource recreation, no state migration needed.
Consistency with existing patterns: Woodpecker already connects to Forgejo via
http://forgejo-http.forgejo.svc.cluster.local:80(line 721), and blackbox probes use the same internal URL (line 410). All IPv4. This fix makes the server-side binding match what all consumers already expect.No dual-stack concern: Setting
HTTP_ADDR = "0.0.0.0"means IPv4 only. If IPv6 connectivity were needed, the value would need to be empty string or::. Given the cluster is IPv4-only (k3s default), this is correct and intentional.BLOCKERS
None.
This is an infrastructure configuration fix. There is no new application functionality being added, so the "new functionality must have tests" blocker does not apply. The test plan correctly describes post-apply verification steps (pod health, IPv4 listen confirmation, CI clone validation). No secrets, no unvalidated input, no DRY violations.
NITS
None. Single-line targeted fix with clean formatting.
SOP COMPLIANCE
121-forgejo-ipv4-bindingreferences issue #121plan-pal-e-platformreferenced0.0.0.0bind address addedfix: bind Forgejo HTTP to IPv4 so Woodpecker CI can clonetofu planoutput included per repo PR conventionstofu fmtandtofu validateclaimed cleanPROCESS OBSERVATIONS
HTTP_ADDRis set could prevent future maintainers from removing it. Not blocking.VERDICT: APPROVED