Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use env GITEA_RUNNER_REGISTRATION_TOKEN as global runner token #32946

Merged
merged 5 commits into from
Dec 23, 2024

Conversation

wxiaoguang
Copy link
Contributor

@wxiaoguang wxiaoguang commented Dec 22, 2024

fix #23703

Now when Gitea start, it reads GITEA_RUNNER_REGISTRATION_TOKEN/GITEA_RUNNER_REGISTRATION_TOKEN_FILE to use that value as global runner token.

If users would like to deploy stateless Gitea/Runner instances, they could simply do this:

openssl rand -hex 24 > /some-dir/runner-token
export GITEA_RUNNER_REGISTRATION_TOKEN_FILE=/some-dir/runner-token
./gitea
export GITEA_RUNNER_REGISTRATION_TOKEN_FILE=/some-dir/runner-token
./act_runner

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 22, 2024
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 22, 2024
@wxiaoguang wxiaoguang added backport/v1.23 This PR should be backported to Gitea 1.23 and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 22, 2024
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Dec 22, 2024
@wxiaoguang
Copy link
Contributor Author

wxiaoguang commented Dec 22, 2024

⚠️ DOCUMENT ⚠️

Please remember to update the documents and example https://gitea.com/gitea/act_runner/src/branch/main/examples

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Dec 22, 2024
@wxiaoguang wxiaoguang requested a review from Zettat123 December 23, 2024 03:08
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Dec 23, 2024
@github-actions github-actions bot added modifies/translation modifies/templates This PR modifies the template files labels Dec 23, 2024
@wxiaoguang wxiaoguang enabled auto-merge (squash) December 23, 2024 09:52
@wxiaoguang
Copy link
Contributor Author

@lunny @Zettat123 would you like to update the document and examples?

@wxiaoguang wxiaoguang added the docs-update-needed The document needs to be updated synchronously label Dec 23, 2024
@wxiaoguang wxiaoguang merged commit 7553ae1 into go-gitea:main Dec 23, 2024
26 checks passed
@GiteaBot GiteaBot added this to the 1.24.0 milestone Dec 23, 2024
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Dec 23, 2024
…tea#32946)

Fix go-gitea#23703

When Gitea starts, it reads GITEA_RUNNER_REGISTRATION_TOKEN
or GITEA_RUNNER_REGISTRATION_TOKEN_FILE to add registration token.
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label Dec 23, 2024
@Zettat123
Copy link
Contributor

@lunny @Zettat123 would you like to update the document and examples?

Yes. I'll do that later.

wxiaoguang added a commit that referenced this pull request Dec 23, 2024
… (#32964)

Backport #32946 by wxiaoguang

Fix #23703

When Gitea starts, it reads GITEA_RUNNER_REGISTRATION_TOKEN
or GITEA_RUNNER_REGISTRATION_TOKEN_FILE to add registration token.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Dec 24, 2024
* giteaofficial/main:
  Add sub issue list support (go-gitea#32940)
  [skip ci] Updated translations via Crowdin
  Use env GITEA_RUNNER_REGISTRATION_TOKEN as global runner token (go-gitea#32946)
  Fix commit range paging (go-gitea#32944)
  Fix outdated tmpl code (go-gitea#32953)
@wxiaoguang wxiaoguang deleted the fix-runner-token branch December 24, 2024 04:38
@Zettat123
Copy link
Contributor

Zettat123 commented Dec 24, 2024

@lunny @Zettat123 would you like to update the document and examples?

project-mirrors-bot-tu bot pushed a commit to project-mirrors/gitea-act-runner that referenced this pull request Jan 23, 2025
For go-gitea/gitea#32946

Reviewed-on: https://gitea.com/gitea/act_runner/pulls/630
Reviewed-by: Lunny Xiao <lunny@noreply.gitea.com>
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-committed-by: Zettat123 <zettat123@gmail.com>
project-mirrors-bot-tu bot pushed a commit to project-mirrors/forgejo-as-gitea-fork that referenced this pull request Jan 26, 2025
…gitea#33280)

Move the main logic of `generateTaskContext` and `findTaskNeeds` to the
`services` layer.

This is a part of go-gitea#32751, since we need the git context and `needs` to
parse the concurrency expressions.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit d0962ce)

Conflicts:
	routers/api/actions/runner/main_test.go
	routers/api/actions/runner/utils.go
	services/actions/context_test.go
	services/actions/init_test.go
	tests/integration/actions_job_test.go
  simple conflicts related to

  ref_type":          string(refName.RefType()),                            // string, The type of ref that triggered the workflow run. Valid values are branch or tag.

  Use env GITEA_RUNNER_REGISTRATION_TOKEN as global runner token (go-gitea#32946)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/done All backports for this PR have been created backport/v1.23 This PR should be backported to Gitea 1.23 docs-update-needed The document needs to be updated synchronously lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/translation size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve Config Management/Stateless Runner Deploy Workflows
4 participants