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

Docker installation failing when using INTERNAL_TOKEN_URI #21666

Closed
whois-marvin-42 opened this issue Nov 2, 2022 · 3 comments · Fixed by #21669
Closed

Docker installation failing when using INTERNAL_TOKEN_URI #21666

whois-marvin-42 opened this issue Nov 2, 2022 · 3 comments · Fixed by #21669
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented issue/workaround it is or has a workaround type/bug
Milestone

Comments

@whois-marvin-42
Copy link

whois-marvin-42 commented Nov 2, 2022

Description

Docker install process generates an INTERNAL_TOKEN while variable INTERNAL_TOKEN_URI was set in docker-compose.yml ... which leaves us with an app.ini having both of them set ... terminating the container due to an invalid configuration ... and raising an error accordingly :

(...) Cannot specify both INTERNAL_TOKEN_URI and INTERNAL_TOKEN

Gitea Version

1.18.0-rc0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.githubusercontent.com/whois-marvin-42/7409ea57866a18b9695357457d02e221/raw/902e430a07f69e5d13a94897a802ae2ffa89004a/gistfile1.txt

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Using a pretty straightforward docker-compose.yml with your latest docker (rootless) image.
Trying to use Docker secrets feature when needed/possible for sensitive data = setting required variables (aka INTERNAL_TOKEN_URI being one of those) according to your documentation

Database

SQLite

@wxiaoguang
Copy link
Contributor

Caused by #19663

The install.go should not generate new token if the token file exists.

@wxiaoguang wxiaoguang added this to the 1.18.0 milestone Nov 3, 2022
@wxiaoguang wxiaoguang added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Nov 3, 2022
@wxiaoguang
Copy link
Contributor

The fix: #21669

Workaround:

  • Remove the INTERNAL_TOKEN after installation.
  • Or, prepare the whole app.ini with INSTALL_LOCK=true and skip the installation page.

@whois-marvin-42
Copy link
Author

Hi. Thanks for your answer. Since I was testing your RC, I filled the issue hoping a fix could be part of the next milestone (or at least update / make a note on the documentation) making it easier for those who are using secrets. Now generating the configuration from our own template/process. Thanks again for this great product 🙇‍♂️

zeripath pushed a commit that referenced this issue Nov 3, 2022
Backport #21669

Fix #21666
Caused by #19663

Before: when install, the INTERNAL_TOKEN was always generated and saved.
But the internal token may be already there by INTERNAL_TOKEN_URI

After: INTERNAL_TOKEN_URI file must be non-empty. When install, skip
internal token generation if the token exists.
zeripath pushed a commit that referenced this issue Nov 3, 2022
Fix #21666
Caused by #19663

Before: when install, the INTERNAL_TOKEN was always generated and saved.
But the internal token may be already there by INTERNAL_TOKEN_URI

After: INTERNAL_TOKEN_URI file must be non-empty. When install, skip
internal token generation if the token exists.
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented issue/workaround it is or has a workaround type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants