Skip to content

Fix duplicate sub-path for avatars #31365

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

Merged
merged 6 commits into from
Jun 15, 2024
Merged

Conversation

wxiaoguang
Copy link
Contributor

@wxiaoguang wxiaoguang commented Jun 14, 2024

Fix #31361, and add tests

And this PR introduces an undocumented & debug-purpose-only config option: USE_SUB_URL_PATH. It does nothing for end users, it only helps the development of sub-path related problems.

And also fix #31366

Co-authored-by: @ExplodingDragon

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 14, 2024
@wxiaoguang wxiaoguang added type/bug backport/v1.22 This PR should be backported to Gitea 1.22 labels Jun 14, 2024
@github-actions github-actions bot added modifies/go Pull requests that update Go code and removed type/bug backport/v1.22 This PR should be backported to Gitea 1.22 labels Jun 14, 2024
@github-actions github-actions bot added the modifies/api This PR adds API routes or modifies them label Jun 14, 2024
@wxiaoguang wxiaoguang added type/bug backport/v1.22 This PR should be backported to Gitea 1.22 labels Jun 14, 2024
@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 Jun 14, 2024
@wxiaoguang wxiaoguang added backport/done All backports for this PR have been created backport/manual No power to the bots! Create your backport yourself! labels Jun 14, 2024
@silverwind
Copy link
Member

silverwind commented Jun 14, 2024

It's not clear to me what USE_SUB_URL_PATH based on the app.ini description. Even if it is a dev-only option, it needs a proper description what it does. "For development purpose only." is not a description.

@wxiaoguang
Copy link
Contributor Author

It's not clear to me what USE_SUB_URL_PATH based on the app.ini description. Even if it is a dev-only option, it needs a proper description what it does. "For development purpose only." is not a description.

It has been documented in the source code, if a developer really needs it.

image

@silverwind
Copy link
Member

Also, I recommend adding a development section to app.ini, e.g. dev.USE_SUB_URL_PATH. Properly describe it there and also add it to config cheat sheet which should be a exact mirror of all app.ini settings.

@wxiaoguang
Copy link
Contributor Author

wxiaoguang commented Jun 14, 2024

Also, I recommend adding a development section to app.ini, e.g. dev.USE_SUB_URL_PATH. Properly describe it there and also add it to config cheat sheet which should be a exact mirror of all app.ini settings.

This option does belong to [server] and is related to ROOT_URL, so putting them together is fine.

And it is not publicly documented, so we always have the chance to rename/move it in the future

@silverwind
Copy link
Member

Is my understanding correct that this option routes single level sub-path /foo to / even when gitea is not configured for sub-path routing?

Why even have it at all? Can't developers just configure a sub path using the documented options?

@wxiaoguang
Copy link
Contributor Author

Is my understanding correct that this option routes single level sub-path /foo to / even when gitea is not configured for sub-path routing?

Gitea was never able to do sub-path routing, it was never able to handle sub-path

Why even have it at all? Can't developers just configure a sub path using the documented options?

Then you need to setup a separate reverse proxy like nginx.

@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 Jun 14, 2024
@wxiaoguang wxiaoguang merged commit 84cbb6c into go-gitea:main Jun 15, 2024
26 checks passed
@GiteaBot GiteaBot added this to the 1.23.0 milestone Jun 15, 2024
@wxiaoguang wxiaoguang deleted the fix-sub-path branch June 15, 2024 03:44
wxiaoguang added a commit that referenced this pull request Jun 15, 2024
Backport #31365, only backport necessary changes.
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jun 16, 2024
* giteaofficial/main:
  Fix JS error when creating new issue (go-gitea#31383)
  [skip ci] Updated translations via Crowdin
  Rename repo_model.SearchOrderByMap to repo_model.OrderByMap (go-gitea#31359)
  rm const do inline (go-gitea#31360)
  Allow downloading attachments of draft releases (go-gitea#31369)
  Fix duplicate sub-path for avatars (go-gitea#31365)
  [skip ci] Updated translations via Crowdin
  Add tag protection via rest api go-gitea#17862 (go-gitea#31295)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Sep 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created backport/manual No power to the bots! Create your backport yourself! backport/v1.22 This PR should be backported to Gitea 1.22 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate sub-path for user avatar in the mention list
5 participants