From 76a9c58dbf9fcc17f7ab7a61b00f6f04675d504a Mon Sep 17 00:00:00 2001 From: agentbox Date: Thu, 5 Nov 2026 13:04:28 +0000 Subject: [PATCH] Pass runner registration token into act_runner --- .env.example | 3 +++ README.md | 35 ++++++++++++++++++++++++++++------- docker-compose.yml | 2 ++ 3 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..96b3756 --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +# Copy to .env for initial runner registration. +GITEA_RUNNER_REGISTRATION_TOKEN= +GITEA_RUNNER_NAME=gvisor-runner diff --git a/README.md b/README.md index ad90e77..ec87aac 100644 --- a/README.md +++ b/README.md @@ -110,16 +110,37 @@ docker compose logs -f runner - `config.yaml` — act_runner configuration (included here). - `.runner` — registration state, created on first registration. -If the runner has not been registered yet, provide a registration token on the -first boot. One way is to add this to the `runner` service temporarily: +The Compose file passes `GITEA_RUNNER_REGISTRATION_TOKEN` into the runner +container. On first boot, put the token in `.env`: -```yaml -environment: - GITEA_RUNNER_REGISTRATION_TOKEN: +```bash +cp .env.example .env +# edit GITEA_RUNNER_REGISTRATION_TOKEN +docker compose up -d runner ``` -Then start the runner once, confirm `./runner/.runner` exists, and remove the -token from the Compose environment again. +Then confirm registration: + +```bash +docker compose logs -f runner +# look for: Runner registered successfully +ls -l runner/.runner +``` + +Remove the token from `.env` after `.runner` exists if you prefer. If a stale +or invalid `./runner/.runner` exists, remove it before retrying: + +```bash +rm -f runner/.runner +docker compose up -d --force-recreate runner +``` + +If the public URL is not reachable from inside the runner container, use the +internal Gitea address instead: + +```yaml +GITEA_INSTANCE_URL: http://gitea:3000 +``` The public Gitea instance is expected at: diff --git a/docker-compose.yml b/docker-compose.yml index 4a4b9d8..b786940 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -51,5 +51,7 @@ services: environment: CONFIG_FILE: /data/config.yaml GITEA_INSTANCE_URL: https://gitea.ct.cozytren.ch + GITEA_RUNNER_REGISTRATION_TOKEN: ${GITEA_RUNNER_REGISTRATION_TOKEN:-} + GITEA_RUNNER_NAME: ${GITEA_RUNNER_NAME:-} volumes: - ./runner:/data