Skip to content

Conversation

@Sainan
Copy link

@Sainan Sainan commented Nov 4, 2025

With the previous default, ACME certificates and accounts would be lost upon restarting the container because only the /data folder is bound to a (writable) volume in the suggested docker-compose.yml from the docs.

Closes https://gitea.com/gitea/docs/issues/292

With the previous default, ACME certificates and accounts would be lost upon restarting the container because only the /data folder is bound to a (writable) volume in the suggested docker-compose.yml from the docs.
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 4, 2025
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Nov 5, 2025

Like #35854 (review) and our discord discussion, I think we need to have a complete solution but not add more patches.

The directory problem is a general problem for all users, but not only Docker users.

There are already enough legacy problems, if we keep adding patches, after many years the new users would still complain: why that decision was made.

@Sainan
Copy link
Author

Sainan commented Nov 5, 2025

I understand not wanting to merge #35854, but this one is a brutal issue that affects only Docker users, and I think should be merged, even you think there's a long-term better solution.

@wxiaoguang
Copy link
Contributor

but this one is a brutal issue that affects only Docker users,

All users are affected. It shouldn't use WORK_PATH, see the discord discussion: if the Gitea binary is put into /usr/local/bin and run it there, it is not able to (and shouldn't) create /usr/local/bin/https

@Sainan
Copy link
Author

Sainan commented Nov 5, 2025

But it's not using WORK_PATH? If it were https relative to the WORK_PATH, then in my case it would be /data/gitea/https, which clearly isn't the folder it's using.

Also, do you have an issue number tracking the work on the 'proper' breaking change?

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Nov 5, 2025

But it's not using WORK_PATH? If it were https relative to the WORK_PATH, then in my case it would be /data/gitea/https, which clearly isn't the folder it's using.

It is more complicated than that. To "guess" a work path, see modules/setting/path.go and its tests.

Also, do you have an issue number tracking the work on the 'proper' breaking change?

No from my side at the moment.

@Sainan
Copy link
Author

Sainan commented Nov 5, 2025

Then I'm going to keep this PR open because exceeding the Let's Encrypt rate-limit just from restarting Gitea a few times is a stupid problem to have.

@TheFox0x7
Copy link
Contributor

Actually.. would the proper fix be a breaking change? If you have ACME enabled it should just pull new certs into (now proper) directory. If you don't there's no impact and if you used a custom dir the fixed default won't apply?

@Sainan
Copy link
Author

Sainan commented Nov 5, 2025

Hmm, good point. It would require reissuing new certificates for existing instances (with default ACME_DIRECTORY) but I guess that's about it.

@wxiaoguang
Copy link
Contributor

OK, let me break the legacy buggy behavior ..... will make some changes in this PR

@wxiaoguang wxiaoguang marked this pull request as draft November 5, 2025 09:11
@wxiaoguang wxiaoguang self-assigned this Nov 5, 2025
@Sainan
Copy link
Author

Sainan commented Nov 5, 2025

No need to reuse my branch/PR haha

@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/cli PR changes something on the CLI, i.e. gitea doctor or gitea admin docs-update-needed The document needs to be updated synchronously and removed modifies/internal labels Nov 5, 2025
@wxiaoguang
Copy link
Contributor

No need to reuse my branch/PR haha

I just think we don't need to open too many PRs.

If you'd like to close this one, feel free to close it, and then I will open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-update-needed The document needs to be updated synchronously lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/cli PR changes something on the CLI, i.e. gitea doctor or gitea admin modifies/go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants