mirror of
https://gitea.com/gitea/docs.git
synced 2026-06-29 23:55:23 +00:00
Document for GITEA_RUNNER_REGISTRATION_TOKEN env (#132)
Co-authored-by: Lunny Xiao <lunny@noreply.gitea.com> Reviewed-on: https://gitea.com/gitea/docs/pulls/132 Reviewed-by: Lunny Xiao <lunny@noreply.gitea.com> Co-authored-by: Zettat123 <zettat123@gmail.com> Co-committed-by: Zettat123 <zettat123@gmail.com>
This commit is contained in:
@@ -62,6 +62,16 @@ A registration token can also be obtained from the gitea [command-line interface
|
||||
gitea --config /etc/gitea/app.ini actions generate-runner-token
|
||||
```
|
||||
|
||||
You can also use `GITEA_RUNNER_REGISTRATION_TOKEN`/`GITEA_RUNNER_REGISTRATION_TOKEN_FILE` environment variable to set a global runner registration token when Gitea starts, for example:
|
||||
|
||||
```
|
||||
openssl rand -hex 24 > /some-dir/runner-token
|
||||
export GITEA_RUNNER_REGISTRATION_TOKEN_FILE=/some-dir/runner-token
|
||||
./gitea --config ...
|
||||
```
|
||||
|
||||
The token from environment is valid until you reset the token (re-create a new one) via web UI or API.
|
||||
|
||||
Tokens are valid for registering multiple runners, until they are revoked and replaced by a new token using the token reset link in the web interface.
|
||||
|
||||
### Configuration
|
||||
|
||||
@@ -106,6 +106,22 @@ Runner级别决定了从哪里获取注册令牌。
|
||||
|
||||
注册令牌也可以通过 Gitea 的 [命令行](../../administration/command-line.md#actions-generate-runner-token) 获得:
|
||||
|
||||
```
|
||||
gitea --config /etc/gitea/app.ini actions generate-runner-token
|
||||
```
|
||||
|
||||
用户也可以使用 `GITEA_RUNNER_REGISTRATION_TOKEN` 或 `GITEA_RUNNER_REGISTRATION_TOKEN_FILE` 环境变量以在 Gitea 启动时设置全局的注册令牌,例如:
|
||||
|
||||
```
|
||||
openssl rand -hex 24 > /some-dir/runner-token
|
||||
export GITEA_RUNNER_REGISTRATION_TOKEN_FILE=/some-dir/runner-token
|
||||
./gitea --config ...
|
||||
```
|
||||
|
||||
来自环境变量的令牌在通过 Web 界面或 API 重置(重新创建新令牌)前将一直有效。
|
||||
|
||||
令牌可用于注册多个 Runner,直到使用 Web 界面中的令牌重置链接将其撤销并替换为新令牌。
|
||||
|
||||
### 注册Runner
|
||||
|
||||
可以通过运行以下命令来注册Act Runner:
|
||||
|
||||
Reference in New Issue
Block a user