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

wrong url for submodule when using reverse proxy in 1.11 and newer #12345

Closed
2 of 7 tasks
shenlijun opened this issue Jul 28, 2020 · 6 comments · Fixed by #12477
Closed
2 of 7 tasks

wrong url for submodule when using reverse proxy in 1.11 and newer #12345

shenlijun opened this issue Jul 28, 2020 · 6 comments · Fixed by #12477
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail

Comments

@shenlijun
Copy link

shenlijun commented Jul 28, 2020

  • Gitea version (or commit ref): 1.11 and newer
  • Git version: 2.18.4
  • Operating system: CentOS 8
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I have a gitea with base URL https://xxxx.yyy/git, using Nginx as a reverse proxy

same repository, when using 1.11 and newer, the submodule URL will be https://xxxx.yyy/git/git/zzz, click it just give me 404 because duplicated “git”

but 1.10 works fine, just https://xxxx.yyy/git/zzz
...

Screenshots

@shenlijun
Copy link
Author

@zeripath
Copy link
Contributor

zeripath commented Aug 3, 2020

Please tell us what git thinks the submodule is and then we can work out how to fix this.

The mapping of submodules to urls is complex and extremely fiddly - it's really very complex and our problem is that we don't have good testcases for any of this.

@shenlijun
Copy link
Author

Please tell us what git thinks the submodule is and then we can work out how to fix this.

The mapping of submodules to urls is complex and extremely fiddly - it's really very complex and our problem is that we don't have good testcases for any of this.

That just different behavior between 1.10 and newer,so I think a code comparison would fix it out @zeripath

@lunny
Copy link
Member

lunny commented Aug 12, 2020

Could you provide your submodule file example.

@lunny lunny added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Aug 12, 2020
@shenlijun
Copy link
Author

Could you provide your submodule file example.

只是浏览器打开的时候url有问题,Git和仓库本身行为没有异常
如果客户端用命令行git clone --recursive或者git pull的话是正常的

1.11之后开始出现这个现象,可能问题只出在web interface相关的代码改动?

一个废弃仓库实例,不要在意代码水平,哇哈哈

ProofProxyClassic.zip

@zeripath
Copy link
Contributor

Please tell us what git thinks the submodule is and then we can work out how to fix this.
The mapping of submodules to urls is complex and extremely fiddly - it's really very complex and our problem is that we don't have good testcases for any of this.

That just different behavior between 1.10 and newer,so I think a code comparison would fix it out @zeripath

No because the 1.10 code was also incorrect so just reverting to the old code is no more correct than the new code.

Looking at your provided zip it appears that the git url for the submodule is:

https://www.micro-visions.org/git/MiRA/MiraDatabase-Proto.git

Presumably you are hosting gitea on https://www.micro-visions.org/git/

and when you try to click on the submodule you get linked to:

https://www.micro-visions.org/git/git/MiRA/MiraDatabase-Proto

zeripath added a commit to zeripath/gitea that referenced this issue Aug 12, 2020
Fix go-gitea#12345

Signed-off-by: Andrew Thornton <art27@cantab.net>
techknowlogick pushed a commit that referenced this issue Aug 13, 2020
Fix #12345

Signed-off-by: Andrew Thornton <art27@cantab.net>
techknowlogick pushed a commit to techknowlogick/gitea that referenced this issue Aug 13, 2020
Fix go-gitea#12345

Signed-off-by: Andrew Thornton <art27@cantab.net>
techknowlogick added a commit that referenced this issue Aug 13, 2020
Fix #12345

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: zeripath <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants