From 142d8a03d1244c25a21c8aff03f6ded670e4f606 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sat, 7 Oct 2023 17:17:26 +0200 Subject: [PATCH] admins: actions: one token can register multiple runners See https://codeberg.org/forgejo/forgejo/commit/9b698362a333de2c388499f1a64d39545b0263bd Also remove the token line from the .runner file. It is confusing and difficult to explain because it is different from the registration token. It really is a shared secret between the runner and the Forgejo instance that has a purpose which is entirely different. --- docs/admin/actions.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/admin/actions.md b/docs/admin/actions.md index 69632c99..a81bfb98 100644 --- a/docs/admin/actions.md +++ b/docs/admin/actions.md @@ -179,6 +179,7 @@ environment. They need to be installed and configured independently. The `Forgejo runner` needs to connect to a `Forgejo` instance and must be registered before doing so. It will give it permission to read the repositories and send back information to `Forgejo` such as the logs or its status. - Online registration + A special kind of token is needed and can be obtained from the `Create new runner` button: - in `/admin/actions/runners` to accept workflows from all repositories. @@ -191,7 +192,7 @@ The `Forgejo runner` needs to connect to a `Forgejo` instance and must be regist For instance, using a token obtained for a test repository from `next.forgejo.org`: ```shell - forgejo-runner register --no-interactive --token {TOKEN} --name runner --instance https://next.forgejo.org --labels docker:docker://node:16-bullseye,self-hosted + forgejo-runner register --no-interactive --token {TOKEN} --name runner --instance https://next.forgejo.org INFO Registering runner, arch=amd64, os=linux, version=3.0.0. INFO Runner registered successfully. ``` @@ -204,13 +205,15 @@ The `Forgejo runner` needs to connect to a `Forgejo` instance and must be regist "id": 6, "uuid": "fcd0095a-291c-420c-9de7-965e2ebaa3e8", "name": "runner", - "token": "{TOKEN}", - "address": "https://next.forgejo.org", - "labels": ["docker:docker://node:16-bullseye", "self-hosted"] + "address": "https://next.forgejo.org" } ``` + The same token can be used multiple times to register any number of + runners, independent of each other. + - Offline registration + When Infrastructure as Code (Ansible, kubernetes, etc.) is used to deploy and configure both Forgejo and the Forgejo runner, it may be more convenient for it to generate a secret and share it with both.