route runner build container clones via public URL with CF Access
The Gitea Actions runners on Legion need build containers to be able to clone repos. They run with network: host so they can't resolve gitea.git.svc.cluster.local — they have to use the public URL. The public URL sits behind Cloudflare Access, which is why the previous naive switch (#3) had to be reverted. This change keeps the runner daemon registered against the in-cluster URL (no CF Access on the polling loop) but rewrites http://gitea.git.svc.cluster.local:3000/ to https://git.neuralplatform.ai/ inside the build container, with the CF Access service-token headers injected via git extraHeader. The redirect script is sourced before every job step via BASH_ENV; the CF Access credentials reach the build container through act_runner's container.env, which we now populate from the new gitea-runner-cf-access Vault path that PR #5's Terraform writes. Known limitation documented in the init script: actions/checkout's per-job auth header is keyed to the in-cluster URL and gets dropped after the insteadOf rewrite. Public repos work; private repos that need that token will need a follow-up.
This commit is contained in:
@@ -85,3 +85,15 @@ RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends gh \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Cloudflare Access bootstrap for git clones to git.neuralplatform.ai.
|
||||
# This script is sourced by bash in build containers via BASH_ENV (set by
|
||||
# act_runner's container.env in deployment.yaml) so it runs before every
|
||||
# step. It configures git insteadOf + CF Access extraHeaders from
|
||||
# CF_ACCESS_CLIENT_ID / CF_ACCESS_CLIENT_SECRET env vars.
|
||||
#
|
||||
# We deliberately don't set ENTRYPOINT / CMD here — act_runner spawns
|
||||
# build containers with its own entrypoint to keep them alive between
|
||||
# steps, and overriding it breaks job execution.
|
||||
COPY git-cf-access-init.sh /usr/local/bin/git-cf-access-init.sh
|
||||
RUN chmod +x /usr/local/bin/git-cf-access-init.sh
|
||||
|
||||
Reference in New Issue
Block a user