fix: route Woodpecker-to-Forgejo API via cluster-internal URL #108
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!108
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "107-fix-woodpecker-tls-clone-internal-url"
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
WOODPECKER_FORGEJO_URLto the cluster-internal Forgejo service and addedWOODPECKER_EXPERT_FORGE_OAUTH_HOSTto preserve browser OAuth redirectsWOODPECKER_FORGEJO_CLONE_URLenv var that was silently ignored by WoodpeckerChanges
terraform/main.tf: ChangedWOODPECKER_FORGEJO_URLfromhttps://forgejo.tail5b443a.ts.nettohttp://forgejo-http.forgejo.svc.cluster.local:80so all server-side API calls stay cluster-internalterraform/main.tf: Replaced invalidWOODPECKER_FORGEJO_CLONE_URLwithWOODPECKER_EXPERT_FORGE_OAUTH_HOSTset to the external URL, preserving browser-facing OAuth login flowterraform/main.tf: Column-aligned all env var assignments for readabilityTest Plan
kubectl logs -n woodpecker woodpecker-server-0and confirm no EOF errors onforgejo.tail5b443a.ts.netAPI callshttps://woodpecker.tail5b443a.ts.net(browser redirect uses external URL via WOODPECKER_EXPERT_FORGE_OAUTH_HOST)Review Checklist
tofu validatepassestofu fmtcleantofu planshows expected 1 resource change (helm_release.woodpecker)Related
plan-pal-e-platformReview
Result: PASS -- no issues found.
Verified
WOODPECKER_FORGEJO_URLcorrectly points to cluster-internal Forgejo service (http://forgejo-http.forgejo.svc.cluster.local:80), matching the URL already used by the blackbox exporter and DORA exporter in this same fileWOODPECKER_EXPERT_FORGE_OAUTH_HOSTis a documented Woodpecker env var (maps toforge.OAuthHost->forgejo.Opts.OAuth2URL), confirmed in Woodpecker v3 source codeWOODPECKER_FORGEJO_CLONE_URLis confirmed invalid -- not present in Woodpecker CLI flags, source code, or documentationtofu validatepasses,tofu fmtcleanScope note
Clone steps will still fetch from the external Tailscale funnel URL (Forgejo reports clone URLs based on its
ROOT_URL). The clone plugin has built-in retry (5 attempts, 5s backoff). If clone TLS failures persist after this fix, a follow-up issue could explore CoreDNS rewrite or a custom clone step override.PR #108 Review
DOMAIN REVIEW
Tech stack: Terraform / Helm values (Woodpecker CI Helm chart v3.5.1)
Internal service URL validation: The new
WOODPECKER_FORGEJO_URLvaluehttp://forgejo-http.forgejo.svc.cluster.local:80is correct. This matches:forgejo-httpin namespaceforgejo, port 80) defined at line 679 ofterraform/main.tf*.svc.cluster.localreferences in the same file following the same{service}.{namespace}.svc.cluster.local:{port}conventionOAuth host separation:
WOODPECKER_EXPERT_FORGE_OAUTH_HOSTis the correct Woodpecker env var for overriding the browser-facing OAuth redirect host when the server-side API URL differs. Setting it tohttps://forgejo.${var.tailscale_domain}preserves the external OAuth login flow while routing all server-side API calls (token refresh, PR status, repo sync) through the cluster network.WOODPECKER_FORGEJO_CLONE_URL removal: This env var is not a recognized Woodpecker server configuration option. It was silently ignored. Removing it eliminates dead config. Woodpecker's clone step in pipeline containers uses
WOODPECKER_FORGEJO_URL(now pointing to the internal service), which is correct because pipeline pods also run inside the cluster.Secrets handling: No new secrets introduced. Existing
WOODPECKER_FORGEJO_CLIENT,WOODPECKER_FORGEJO_SECRET, andWOODPECKER_AGENT_SECRETremain properly handled viaset_sensitiveblocks (lines 760-774). No credentials in the diff.Column alignment: The whitespace changes (re-aligning
=signs) are consistent and improve readability. No functional impact.BLOCKERS
None.
NITS
None. The change is minimal, focused, and correct.
SOP COMPLIANCE
107-fix-woodpecker-tls-clone-internal-url)plan-pal-e-platformand closes #107tofu validateandtofu fmtconfirmed in checklistPROCESS OBSERVATIONS
VERDICT: APPROVED