-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Submodule links not recognized by web ui when SSH_DOMAIN is used #12747
Comments
I just noticed that this is a duplicate of #9756, any news regarding this? |
@MartB I think it is similar or related ... throu I think we can keep both open |
there was done some work on submodule recognizion in the master branch some time ago , so it has to be checked if this is still present on master ... |
@MartB could you confirm that this is present on try? |
@zeripath I don't think you can check this on try because it doesn't use a different domain name for SSH_HOST and DOMAIN The issue is that we use AppUrl as the urlPrefix value here: gitea/modules/git/submodule.go Line 42 in ad2bf37
So this will never match: gitea/modules/git/submodule.go Line 79 in ad2bf37
Because they use a different hostname in the submodule file that matches the separate hostname they have used for SSH_DOMAIN. So our logic thinks this is hosted elsewhere but really it is still the same copy of Gitea just with a different hostname for SSH_DOMAIN. I think the issue here is that we need to also check if the hostname found in the submodule file matches the SSH_DOMAIN value and then create the link with the AppUrl instead. |
Right now we only compare the hostname from a submodule with the prefixURL it is viewed from to check if the submodule is hosted on the same Gitea instance. This adds an additional check to compare it against SSH_DOMAIN as well since the same Gitea instance might have a different hostname for SSH and if the submodule uses that hostname we should also detect that and link to the proper DOMAIN value. Fixes go-gitea#12747, go-gitea#9756
Right now we only compare the hostname from a submodule with the prefixURL it is viewed from to check if the submodule is hosted on the same Gitea instance. This adds an additional check to compare it against SSH_DOMAIN as well since the same Gitea instance might have a different hostname for SSH and if the submodule uses that hostname we should also detect that and link to the proper DOMAIN value. Fixes #12747, #9756
Thanks for looking into that! |
Description
When using a different domain for ssh access, submodules links are not correct within the gitea web interface.
Having a
.gitmodules
set up like this:and a gitea instance set up with https://git.martb.eu/ with its
SSH_DOMAIN
set tossh.martb.eu
leads to ssh. being used as a http href instead of gitea translating it to the "known" git. domain.Affected lines
gitea/templates/repo/view_list.tmpl
Line 50 in 332dbe7
Screenshots
The text was updated successfully, but these errors were encountered: