Skip to content
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

Proxying sumdb behind a proxy or upstream #1468

Open
wayjam opened this issue Nov 21, 2019 · 4 comments · May be fixed by #1723
Open

Proxying sumdb behind a proxy or upstream #1468

wayjam opened this issue Nov 21, 2019 · 4 comments · May be fixed by #1723

Comments

@wayjam
Copy link

wayjam commented Nov 21, 2019

Describe the solution you'd like
Now SumDBs will proxy sumdb direct to the accually sumdb server insteads of behine the value of GlobalEndpoint

SumDBs = ["https://sum.golang.org"]  => the sumdb id is sum.golang.org
SumDBs = ["https://goproxy.cn/sumdb/sum.golang.org"]  => the sumdb id is goproxy.cn

Describe alternatives you've considered

What 's the best way to describe?

  1. if the SumDB match https://(?<proxyHost>.*)/sumdb/(?<sumdb id>.*), use id sumdb id
  2. all sumdb will try if upstream server support, then proxy to upstream/sumdb/id
@arschles
Copy link
Member

arschles commented Dec 3, 2019

@wayjam if Athens is proxying to a sum DB, would you want it to cache results locally?

@wayjam
Copy link
Author

wayjam commented Dec 3, 2019

@arschles I think just a reverse proxy or a middleware with cache are both fine. And if athens can provide two options ideally.

@arschles
Copy link
Member

arschles commented Dec 4, 2019

@wayjam I see. That sounds like it could work! We would never have to expire the cache either, which makes this a lot easier.

Would you like to prototype this? No pressure at all if you don't. Just let me know

@will-beta
Copy link

@arschles Does it mean the Athens could not utilize GOSUMDB in the ATHENS_GO_BINARY_ENV_VARS?

https://sum.golang.org is not accessible in China apparently.

Just ran the server with the config.dev.toml and the envs below:

"ATHENS_LOG_LEVEL":"trace",
"ATHENS_DOWNLOAD_MODE":"async_redirect",
"ATHENS_DOWNLOAD_URL":"https://goproxy.cn",
"ATHENS_SUM_DBS":"https://sum.golang.org",
"ATHENS_GO_BINARY_ENV_VARS":"GOPROXY=https://goproxy.cn,direct; GOSUMDB=sum.golang.google.cn",

Got the error messages on the client side when I ran go get golang.org/x/tools/gopls@v0.7.0 :

go get: golang.org/x/tools/gopls@v0.7.0: verifying module: golang.org/x/tools/gopls@v0.7.0: initializing sumdb.Client: checking tree#5772989: reading http://127.0.0.1:3000/sumdb/sum.golang.org/tile/8/2/000.p/88: 502 Bad Gateway

@jan4984 jan4984 linked a pull request Jul 8, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants