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

Minirepo behind a proxy #8

Closed
sbchand opened this issue Sep 11, 2019 · 3 comments
Closed

Minirepo behind a proxy #8

sbchand opened this issue Sep 11, 2019 · 3 comments

Comments

@sbchand
Copy link

sbchand commented Sep 11, 2019

Hello,

I wish to run Minirepo behind a proxy server and use it as a local cache / hex mirror.

With direct internet connectivity (without a proxy server), minirepo starts and automatically fetches packages. However, if minirepo is behind a proxy, it is not able to reach / fetch packages. I tried setting environment variables - e.g. "https_proxy" and "HTTPS_PROXY"; however, I felt the environment variables were ignored.

Am I missing anything? If yes, could you please provide appropriate pointers?

Regards
Bala

@wojtekmach
Copy link
Owner

Yes, these environment variables are ignored.

MiniRepo.Mirror uses hex_core to fetch data from the upstream repository. hex_core ships with a built-in, httpc-based adapter which you can configure like this:

:httpc.set_options([proxy: {{'proxy.mycompany.com, 8000}, ['localhost']}])

This uses proxy.mycompany.com:8000 as proxy except for requests towards localhost. I'd suggest putting this code in MiniRepo.Application before starting the supervision tree. Let me know if this solves the problem.

A long term solution would be to allow configuring hex_core via mirror configuration, and configuring proxy via hex_core configuration.

@sbchand
Copy link
Author

sbchand commented Sep 11, 2019

I tried your proposal and it works great.

Thanks very much for your quick and prompt response; highly appreciate it.

Regards
Bala

@wojtekmach
Copy link
Owner

Since this is tracked in hex_core, I'm gonna close it.

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

No branches or pull requests

2 participants