1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-03 09:07:19 +00:00

Use env GITEA_RUNNER_REGISTRATION_TOKEN as global runner token (#32946)

Fix #23703

When Gitea starts, it reads GITEA_RUNNER_REGISTRATION_TOKEN
or GITEA_RUNNER_REGISTRATION_TOKEN_FILE to add registration token.
This commit is contained in:
wxiaoguang
2024-12-23 17:59:16 +08:00
committed by GitHub
parent bd5d1341d4
commit 7553ae1a57
8 changed files with 152 additions and 18 deletions

View File

@ -136,9 +136,8 @@ func RunnerResetRegistrationToken(ctx *context.Context, ownerID, repoID int64, r
ctx.ServerError("ResetRunnerRegistrationToken", err)
return
}
ctx.Flash.Success(ctx.Tr("actions.runners.reset_registration_token_success"))
ctx.Redirect(redirectTo)
ctx.JSONRedirect(redirectTo)
}
// RunnerDeletePost response for deleting a runner

View File

@ -463,7 +463,7 @@ func registerRoutes(m *web.Router) {
m.Combo("/{runnerid}").Get(repo_setting.RunnersEdit).
Post(web.Bind(forms.EditRunnerForm{}), repo_setting.RunnersEditPost)
m.Post("/{runnerid}/delete", repo_setting.RunnerDeletePost)
m.Get("/reset_registration_token", repo_setting.ResetRunnerRegistrationToken)
m.Post("/reset_registration_token", repo_setting.ResetRunnerRegistrationToken)
})
}