-
-
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
Support SSH for go get #12192
Comments
I don't think |
It does. We use it in production. The meta tag should look as following: <meta name="go-import" content="git.company.com/organization/private git ssh://git@git.company.com/organization/private">
|
Interesting! Thanks for the information. |
It's quite useful for private internal git modules :) |
OK looking at: https://github.com/golang/go/blob/95e1ea4598175a3461f40d00ce47a51e5fa6e5ea/src/cmd/go/internal/get/discovery.go#L36-L64 I think we could even have a second go-import tag which would save yet another setting... |
Actually looking on - I think that might not work: Sigh. |
OK I think this is going to need (yet) another setting. The ideal would be a global setting and a per repository setting. Simply because every time we do this we're causing a change of schema - I think we need a generic settings system and I'm opening an issue for that. |
This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions. |
Why don't you solve this, this is very useful for private repositories HTTPS access requires a username and password, while SSH is not required In my Jenkins I can only use git, not https, because I can't type in usernames and passwords 为什么这个不解决呢, 这个对私有仓库很有用啊 https 访问方式,需要用户名和密码, 而 git 可以不用 在我的 jenkins 中我只能用 git, 不能用 https, 因为我不可能去输用户名和密码啊 |
Here is : https://github.com/go-gitea/gitea/blob/main/CODE_OF_CONDUCT.md Before asking "Why don't you solve this", please ask: could you write some code to help the open-source projects? Complaining doesn't help anything. Being constructive and respectful |
@wxiaoguang 你说的很对, 我来解决这个问题 |
I send a pull request for this; 补丁好不好不说, 反正我提供了 |
Awesome, thank you very much. I did a quick review, I think the PR is high quality. Before approving, there are only a few nits (I can vote my approval, it needs at least 2 approvals to be merged, other maintainers will also review) |
fix #12192 Support SSH for go get --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: mfk <mfk@hengwei.com.cn> Co-authored-by: silverwind <me@silverwind.io>
[x]
):Description
We have a private gitea repository containing a go module. When we want to
go get git.company.com/organization/private
, gitea returns only the HTTPS link of the repository, not the SSH one.To reproduce, one can simply open a link in the browser:
https://git.company.com/organization/private?go-get=1
and examine the returned HTML:
Here are the relevant source code locations:
One can see in these files/lines that only the HTTPS path is ever returned. We expected that this can be at least configured to either return the SSH or HTTPS one. When disabling HTTPS for the repo, the returned links still stayed the same.
The text was updated successfully, but these errors were encountered: