I created repository A and B. In repository A I created submodule pointing to repository B with using ssh://gitea@DOMAIN:3333/test/B.git
url. As you can see I am running gitea ssh service on custom port.
Now when I browse in web interface repository A I see link to repository B. This link points to https://DOMAIN/3333/test/B
. Instead it should be https://DOMAIN/test/B
. Having ssh port number 3333 in URL opens 404 page.
I'm using gitea 1.1.0 with git 2.12.2 on ArchLinux. Gitea is using SQLite database.
I'm not sure how we could even do a link here TBH. If someone adds a ssh-backed submodule, how would gitea know where the website is? Or if there even is one.
IMO we should not have a link at all if the submodule points to SSH
Yes, for generic ssh-backed submodules I would be fine to skip the URL rendering. But for the ones hosted on the same gitea instance it should be pretty easy to determine http(s) url from ssh url.
@mmozeiko How do we know if they are hosted on gitea?
If you open any repository in gitea, you can see it's ssh URL on top/right side. So when trying to render URL, just check if it matches one of the existing URL's. It should be pretty simple.
The way how gitea constructs this url is ssh://RUN_USER@SSH_DOMAIN:SSH_PORT/USER/REPO.git
where RUN_USER, SSH_DOMAIN and SSH_PORT are settings from conf.ini
file, and USER and REPO are username and repository name. So check if submodule URL matches this pattern. If it does, then check if first three settings matches values in app.ini file, and USER is existing user, and REPO existing repository name. If everything matches, that means this submodule is hosted on same gitea instance. If this would not be true, then I would not be able to clone using ssh link provided in each repo page.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
I think this is fixed in latest version, if not please reopen
@lafriks Please reopen, My gitea ssh port number is 10022. submodule use ssh link, but webUI not found 404 error. webUI open link like it: https://my.domian/10022/xxx/zzz
@cjy37 can you give example of exact ssh link sample (with replaced sensitive info) used in submodule?
I also seem to run into this problem if i use
ssh://[email protected]:10022/user/zzz.git as git
the link will go to
https://my.domian/10022/user/zzz
it seems gitea is not parsing the url for ssh:// correctly as in
https://git-scm.com/docs/git-clone#_git_urls_a_id_urls_a
I see issue here, and will work on a fix for this
Most helpful comment
If you open any repository in gitea, you can see it's ssh URL on top/right side. So when trying to render URL, just check if it matches one of the existing URL's. It should be pretty simple.
The way how gitea constructs this url is
ssh://RUN_USER@SSH_DOMAIN:SSH_PORT/USER/REPO.git
where RUN_USER, SSH_DOMAIN and SSH_PORT are settings fromconf.ini
file, and USER and REPO are username and repository name. So check if submodule URL matches this pattern. If it does, then check if first three settings matches values in app.ini file, and USER is existing user, and REPO existing repository name. If everything matches, that means this submodule is hosted on same gitea instance. If this would not be true, then I would not be able to clone using ssh link provided in each repo page.