Avoid creating new action runner token after each update #323

Open
opened 2023-08-03 10:56:21 +00:00 by TheZoker · 6 comments

Every time I update my gitea act runner, the runner can’t connect to the gitea instance anymore, because the token has already been used.

I use docker compose to run the runner:

version: '3.8'
services:
  gitea_runner:
    image: gitea/act_runner
    container_name: GiteaRunner
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - GITEA_RUNNER_NAME=Gitea Runner
      - GITEA_INSTANCE_URL=<my-url>
      - GITEA_RUNNER_REGISTRATION_TOKEN=<my-token>
Every time I update my gitea act runner, the runner can’t connect to the gitea instance anymore, because the token has already been used. I use docker compose to run the runner: ```yaml version: '3.8' services: gitea_runner: image: gitea/act_runner container_name: GiteaRunner restart: always volumes: - /var/run/docker.sock:/var/run/docker.sock environment: - GITEA_RUNNER_NAME=Gitea Runner - GITEA_INSTANCE_URL=<my-url> - GITEA_RUNNER_REGISTRATION_TOKEN=<my-token> ```
sillyguodong added the
kind
proposal
label 2023-08-03 10:57:37 +00:00
Member

Maybe a reusable register token can resolve it.

Maybe a reusable register token can resolve it.
Contributor

Or preserve the volume of the .runner file

- gitea-runner-data:/data
version: '3.8'
services:
  gitea_runner:
    image: gitea/act_runner
    container_name: GiteaRunner
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - gitea-runner-data:/data
    environment:
      - GITEA_RUNNER_NAME=Gitea Runner
      - GITEA_INSTANCE_URL=<my-url>
      - GITEA_RUNNER_REGISTRATION_TOKEN=<my-token>
Or preserve the volume of the `.runner` file ```yaml - gitea-runner-data:/data ``` ```yaml version: '3.8' services: gitea_runner: image: gitea/act_runner container_name: GiteaRunner restart: always volumes: - /var/run/docker.sock:/var/run/docker.sock - gitea-runner-data:/data environment: - GITEA_RUNNER_NAME=Gitea Runner - GITEA_INSTANCE_URL=<my-url> - GITEA_RUNNER_REGISTRATION_TOKEN=<my-token> ```
Author

@ChristopherHX Thanks for the hint! Maybe this should be added to the README file, so others know about this (I think there is no scenario, where someone does not want this) 🤔

@ChristopherHX Thanks for the hint! Maybe this should be added to the README file, so others know about this (I think there is no scenario, where someone does not want this) 🤔

It is mentioned in the docker example and the docker compose example. Though less explicitly in the second one.

It is mentioned in the [docker example](https://gitea.com/gitea/act_runner/src/branch/main/examples/docker) and the [docker compose example](https://gitea.com/gitea/act_runner/src/branch/main/examples/docker-compose). Though less explicitly in the second one.
lunny added
kind
docs
and removed
kind
proposal
labels 2023-08-03 14:41:06 +00:00
Contributor
@TheZoker Maybe you need https://docs.gitea.com/next/usage/actions/act-runner#%E4%BD%BF%E7%94%A8-docker-compose-%E8%BF%90%E8%A1%8C-runner
Contributor

And #118 (comment)

volume /data save .runner config file
volume /root/.cache save actcache and actions cache

docker run -e GITEA_INSTANCE_URL=***                    \
           -e GITEA_RUNNER_REGISTRATION_TOKEN=***       \
           -e GITEA_RUNNER_NAME=***                     \
           -v /var/run/docker.sock:/var/run/docker.sock \
           -v /root/act_runner/data:/data               \
           -v /root/act_runner/cache:/root/.cache       \
           gitea/act_runner
And https://gitea.com/gitea/act_runner/pulls/118#issue-193685 > volume `/data` save `.runner` config file > volume `/root/.cache` save actcache and actions cache ```sh docker run -e GITEA_INSTANCE_URL=*** \ -e GITEA_RUNNER_REGISTRATION_TOKEN=*** \ -e GITEA_RUNNER_NAME=*** \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /root/act_runner/data:/data \ -v /root/act_runner/cache:/root/.cache \ gitea/act_runner ```
Sign in to join this conversation.
No Milestone
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/act_runner#323
No description provided.