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

Make the GoGet middleware configurable #44

Closed
arschles opened this issue Mar 8, 2018 · 4 comments
Closed

Make the GoGet middleware configurable #44

arschles opened this issue Mar 8, 2018 · 4 comments
Labels
good first issue Great issues for new Athenians to work on!

Comments

@arschles
Copy link
Member

arschles commented Mar 8, 2018

You should be able to configure it to redirect to any DNS name or IP - including the proxy IP/name, if running in proxy mode. Right now, it's hard-coded to gomods.io

@arschles arschles added the good first issue Great issues for new Athenians to work on! label Mar 8, 2018
@bketelsen
Copy link
Contributor

I have some thoughts here, I need to formalize, I think there's more to this.

@arschles
Copy link
Member Author

arschles commented Mar 8, 2018

Continuing conversation on slack, @bketelsen you formalized all (we think) of the possible CLI workflows (copied to here). The question that remains is whether 2.i will cause vgo to hit the http://athensproxywhatever//githublcim/bketelsen/captainhook/@v/... endpoints directly, or still go through the ?go-get=1 flow.

If it's the former, this doesn't matter as much. Otherwise, we need this so the server knows where to redirect

@bketelsen
Copy link
Contributor

bketelsen commented Mar 8, 2018

here's the code from vgo:

func (p *proxyRepo) Versions(prefix string) ([]string, error) {
	var data []byte
	err := web.Get(p.url+"/@v/list", web.ReadAllBody(&data))
	if err != nil {
		return nil, err
	}

zip, and other implementations are the same, they expect to call the proxy with the url.
also the proxy code has the concept of a base url and path:
gomods.io/proxy could be the "endpoint" for the proxy, which would result in a web request like:
https://gomods.io/proxy/github.com/bketelsen/captainhook/@v/list

@arschles
Copy link
Member Author

arschles commented Mar 9, 2018

thanks @bketelsen - confirms my understanding too. reading the code cemented it too - good idea :)

the GoGet middleware still needs to be configurable for registry use, but not for proxy usage

arschles added a commit that referenced this issue Mar 9, 2018
bketelsen pushed a commit that referenced this issue Mar 9, 2018
* Using the CDN getter in the GoGet middleware

Fixes #44

* Adding a fake CDN getter

For use in stubbing and testing

* Passing the CDN Getter into the GoGet middleware

* Fixing template render
michalpristas pushed a commit that referenced this issue Mar 10, 2018
* Using the CDN getter in the GoGet middleware

Fixes #44

* Adding a fake CDN getter

For use in stubbing and testing

* Passing the CDN Getter into the GoGet middleware

* Fixing template render
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Great issues for new Athenians to work on!
Projects
None yet
Development

No branches or pull requests

2 participants