-
Notifications
You must be signed in to change notification settings - Fork 505
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
Proposal: Add redirect support like gopkg.in #1282
Comments
Could this not be handled by a vanity url approach? Something like this could do a trick: https://github.com/GoogleCloudPlatform/govanityurls We have a custom implementation in place that basically allows Athens <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="go-import" content="example.com/cool_project/common git https://git.internal.example.com/cool_project/common">
</head>
<body>
Nothing to see
</body>
</html> This naturally means that Athens should still be able to access git.internal.example.com and have correct credentials, etc. You could swap to This might not be ideal but this could work I think. I'm also not sure if one would want to mix this or similar functionality with what Athens does today. I can also foresee some weird situations where transformed module file will not be exactly what you expect current local version to be when working and rules are updated. |
I think this would be a good candidate for a vanity url server, but I'd love to see the functionality of a vanity url server supported by Athens. This way there isn't yet another service to deploy, monitor, maintain etc. If we bought a url such as myurl.com, and a module hosted there at mymodule, if I could redirect all requests to Athens and have Athens generate a meta tag for me based on some url -> VCS mapping, I think that would be huge. |
For big company has many developers, go get from github is slow and duplicate. A solution is mirroring github repo(eg. https://github.com/kubernetes/api) Athens act as a rewrite proxy without persist(inner gitlab act as a backend storage) Use git server as storage backend for Athens is better. |
I Implement this feature in https://github.com/Xuanwo/go-mod-redirect |
@Xuanwo that's great! Thank you for letting us know |
It looks like we have two valid solutions, go-mod-redirect and govanityurls. I'm going to close this issue now. |
Is your feature request related to a problem? Please describe.
Our gitlab looks like:
git.internal.example.com
, and the repo url is something like:git.internal.example.com/cool_project/common-go
. The project could be long history or complex so that we can't name it likecool_project/common
which make them hard to import.We tried to import all golang package in the same way like:
Currently, we have to replace them in every modules.
Describe the solution you'd like
Add config for goproxy level redirect/replace like
gopkg.in
do but without version suffix, we just redirect to correct VCS or next proxy (already implemented).git.internal.example.com/cool_project/common-go => example.com/cool_project/common
git.internal.example.com => example.com
Additional context
golang/go#26334 discussed
GOPROXY=proxy1,proxy2,proxy3
andGONOPROXY
support on thego get
side.The text was updated successfully, but these errors were encountered: