[feature suggest]ssh support for go get while using private repo #1431

Closed
opened 2025-11-02 04:00:32 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @szyhf on GitHub (Jan 8, 2018).

Description

While using go get for gitea.mydomain.com/owner/repo, the go will request for https://gitea.mydomain.com/owner/repo?go-get=1 and check meta from go-import

<meta name="go-import" content="gitea.mydomain.com/owner/repo git https://gitea.mydomain.com/owner/repo.git">

When using private repo clone for https:// will always ask for UserName and Password, but usually we use go get or some third tool like glide to checkout for every repo depended by current repo, its very un convenience if current repo depend on lots of private repo (Its normally in business and CI/CD pipline) .

Mostly we use 'ssh key'(maybe user key or deploy key) to clone repo with authenticated easily. So if gitea may add a setting option like Go.UseSSHImport, while this option is set true, visit https://gitea.mydomain.com/owner/repo?go-get=1 will get mate date looks like below:

<meta  name='go-import' content='gitea.mydomain.com/owner/repo git ssh://git@gitea.mydomain.com/owner/repo.git'>

For support sub-packages, go get gitea.mydomain.com/owner/repo/subpkg?go-get=1 will has the same meta too.

Then when using go get, will automatically use clone for ssh:// and use the ssh key.

That will be more convenience for private repo using in go.

I can implement this feature all by myself and make a pr to develop if needed.
...

Originally created by @szyhf on GitHub (Jan 8, 2018). ## Description While using `go get` for `gitea.mydomain.com/owner/repo`, the go will request for `https://gitea.mydomain.com/owner/repo?go-get=1` and check meta from `go-import` ``` <meta name="go-import" content="gitea.mydomain.com/owner/repo git https://gitea.mydomain.com/owner/repo.git"> ``` When using private repo clone for `https://` will always ask for `UserName` and `Password`, but usually we use `go get` or some third tool like `glide` to checkout for every repo depended by current repo, its very un convenience if current repo depend on lots of private repo (Its normally in business and CI/CD pipline) . Mostly we use 'ssh key'(maybe user key or deploy key) to clone repo with authenticated easily. So if `gitea` may add a setting option like `Go.UseSSHImport`, while this option is set `true`, visit `https://gitea.mydomain.com/owner/repo?go-get=1` will get mate date looks like below: ``` <meta name='go-import' content='gitea.mydomain.com/owner/repo git ssh://git@gitea.mydomain.com/owner/repo.git'> ``` For support sub-packages, `go get gitea.mydomain.com/owner/repo/subpkg?go-get=1` will has the same meta too. Then when using `go get`, will automatically use clone for `ssh://` and use the `ssh key`. That will be more convenience for private repo using in `go`. I can implement this feature all by myself and make a pr to develop if needed. ...
GiteaMirror added the type/feature label 2025-11-02 04:00:32 -06:00
Author
Owner

@bkcsoft commented on GitHub (Jan 8, 2018):

Not possible on giteas side. It's a limitation in go get: https://github.com/golang/go/issues/6968

@bkcsoft commented on GitHub (Jan 8, 2018): Not possible on giteas side. It's a limitation in `go get`: https://github.com/golang/go/issues/6968
Author
Owner

@szyhf commented on GitHub (Jan 9, 2018):

I don't think so.

It does help a lot, it's no other solution easier than this one, it's doesn't matter any other user who didn't use go.

So it's a limitation and we don't have to do it.

All right, I did respect for your opinion.

@szyhf commented on GitHub (Jan 9, 2018): I don't think so. It does help a lot, it's no other solution easier than this one, it's doesn't matter any other user who didn't use `go`. So it's a limitation and we don't have to do it. All right, I did respect for your opinion.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1431