Skip to content

fix(scripts): keep a self-hosted GitLab token on its own host - #20

Merged
agent-kit-startup merged 2 commits into
mainfrom
fix/export-gitlab-host
Nov 30, 2026
Merged

agent-kit-startup merged 2 commits into
mainfrom
fix/export-gitlab-host

Conversation

@agent-kit-startup

@agent-kit-startup agent-kit-startup commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

runner-ctl.sh loads $MINIRUNNER_HOME/mini-runner.env with ., so a GITLAB_HOST set there without
export (as mini-runner.env.example does) stayed in the control script's shell. start runs
check-repo.sh as a child process, which then fell back to gitlab.com. With a self-hosted GitLab the
project check asked the wrong server, and on the curl path it sent the self-hosted GITLAB_TOKEN to
gitlab.com whenever that token was in the environment.

runner-ctl.sh now exports GITLAB_HOST right after loading the env file when it is set, so the check
asks the server named there. gh-runners-ctl.sh is unchanged: it only checks GitHub repositories.

check-repo.sh no longer sends GITLAB_TOKEN to a default host. On the curl path (no glab), the token is
sent only to a host named in GITLAB_HOST, gitlab.com included; with the token and no GITLAB_HOST, a
GitLab target is reported UNVERIFIED (exit 3) and no request is made. The glab path is unchanged, since
glab keeps its own login per --hostname. The script header, the env example and docs/public-repos.md
state the rule, and the check-repo wrapper in the README and the env example no longer says the control
scripts do not pass GITLAB_HOST on.

Tests: the host from the env file reaches a fake curl and a fake glab started by runner-ctl.sh, the
token without GITLAB_HOST is never sent, and with GITLAB_HOST set the token goes only to that host.

runner-ctl.sh loads $MINIRUNNER_HOME/mini-runner.env with `.`, so a GITLAB_HOST set there without
`export` (as mini-runner.env.example does) stayed in the control script's shell. start runs
check-repo.sh as a child process, which then fell back to gitlab.com. With a self-hosted GitLab the
project check asked the wrong server, and on the curl path it sent the self-hosted GITLAB_TOKEN to
gitlab.com whenever that token was in the environment.

runner-ctl.sh now exports GITLAB_HOST right after loading the env file when it is set, so the check
asks the server named there. gh-runners-ctl.sh is unchanged: it only checks GitHub repositories.

check-repo.sh no longer sends GITLAB_TOKEN to a default host. On the curl path (no glab), the token is
sent only to a host named in GITLAB_HOST, gitlab.com included; with the token and no GITLAB_HOST, a
GitLab target is reported UNVERIFIED (exit 3) and no request is made. The glab path is unchanged, since
glab keeps its own login per --hostname. The script header, the env example and docs/public-repos.md
state the rule.

Tests: the host from the env file reaches a fake curl and a fake glab started by runner-ctl.sh, the
token without GITLAB_HOST is never sent, and with GITLAB_HOST set the token goes only to that host.
# Conflicts:
#	docs/public-repos.md
#	scripts/mini-runner.env.example
@agent-kit-startup
agent-kit-startup merged commit 9b9c359 into main Nov 30, 2026
3 checks passed
@agent-kit-startup
agent-kit-startup deleted the fix/export-gitlab-host branch November 30, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant