-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add support for global *_proxy
environment variables
#6
Conversation
Nice idea! Also, I like that you wrote the docs first :) |
@patcon Thanks! I hate writing docs, but in this case I wanted to start with planning the syntax etc. And even secretly hoped there would be some other opinions. ;) Speaking of documentation, please feel free to fix the language and typos. I'm far from a native English speaker as you should have noticed. |
Sigh, I have some spike code lying in my local repo. Hope to find time and motivation to clean it up and push it out soonish. |
👍 for this PR :-) |
@tknerr: I agree that using |
@tmatilai I'm 👍 for 'VAGRANT_ENV_HTTP_PROXY', see comment in the gist |
OK, now there is a seemingly working implementation. There is now a lot of duplication (and no tests) in the Action classes, but I would like to get this feature out sooner than later. =) The capability is now available only on Linuxes. But I think at least Free&OpenBSD have the profile.d included by default. Have to take a look... Anyway, all testing welcome! |
Cool stuff! I did some basic testing and it all looks good:
|
@tknerr Thanks a lot for testing! All improvements to the README are highly welcome. Documentation is not my best skill. ;) |
@tmatilai no worries the docs are fine, it was just me not reading carefully ;-) |
I'll merge this now. Action classes will get some refactoring love in #14. |
Add support for global `*_proxy` environment variables
👍 thanks! :-) |
Sorry for the "absence" (I was on vacations for the last week) but this looks good :) I'm planning to finally try out the plugin this weekend and I'll let u guys know how it goes :D |
@tmatilai re: unsetting the proxy Might be a misunderstanding in the README, or a small bug:
I would have expected that the latter worked as well. Is this as intended? |
A bit further testing reveals that The |
@tknerr Which shell are you using? Some c shell? In Posix shells (e.g. bash) |
Oh, this was on windows... should have mentioned that ;-) |
Ha ha, sorry, I should have guessed that. =) It been more than 10 years that I last scripted or even used Windows, but doesn't |
You must be a happy man, I still have to use Windows at work... ;-) AFAIK there is no I'm on vacation now, but I can debug a bit more on my windows system when I'm back. In the meantime |
Well, this page says:
That would confirm your experience. You can test it with something like: ruby -e "puts ENV.fetch('VAGRANT_HTTP_PROXY', 'not set').inspect" |
@tmatilai you are totally right, that explains it. Thanks for the clarification! :-) |
I want to point out that in the readme.md it does say that this does work with wget but confusion may arrise for some using the example variables. For example, it says
You instead need If I may recommend, putting in a comment about this in the readme.md would be immensly helpful for those like me who are confused as to why wget wasn't working. |
Hi @hak8or, Maybe I'm missing something, but the readme already has
The only place where it has been possible to drop the schema is the If you have concrete suggestions how to improve the readme, I'm all ears. Documentation (especially in foreign language) is not my strongest skill. =) The readme in general is bloated and should be split. Have to think a bit... |
I have utterly no idea what happened, you are indeed correct. Terribly sorry for wasting your time on this post, I think I started seeing things from lack of sleep or something, hah. I do agree, it is somewhat convoluted. I think that maybe it is worth it to make a wiki page and put the less common usage scenario examples in it. Quick Start could be moved into Usage. I feel that Possible value's are pretty much identical across all three sections, they might be able to be merged into one easily. Environment variables are also capable of being merged across the various sections. Going further with the wiki page, I would recommend that you combine the Like this,
and if you want to enable the plugin only if it is installed
I feel that users should be able to figure pretty much all usage cases from that alone, with you being able to put all the rest of your readme including specifics like possible values for environment variables, into the wiki. This way your readme would be shortened drastically while still giving users the exact info they need to get up and running, and if they need more information then just click on the wiki link and viola. Hopefully this helps and makes up for me overlooking how all of them already have http in front! |
@hak8or not a problem at all, and thanks a lot for the ideas! Thinking of it, I guess we could even deprecate the The downside of using wiki is that it's not in sync with code nor releases. So I would prefer having the documentation still generated from master either to github pages or somewhere else. This way the documentation changes can also be committed with code PRs. |
@tmatilai I would actually probably be a great candidate for writing the wiki if you want me to take a stab at it? Since we have an unfortunate situation with our corporate proxies I have a lot of extensive documentation (and patterns we use) that I am sure would be extremely helpful. I literally probably have every single edge case that you could throw at me (internal mirrors for aptitude, requirements for GitHub Enterprise, github.com, MITM SSL issues, etc). |
I'll slam out some examples and throw them into a PR. |
Oh, wiki is perfect for examples, edge cases and war stories. And we can always pick things from there to the "official" documentation. So go ahead! |
You guys are all awesome! Edge cases and more examples in the wiki all sound like fantastic ideas, all of which I feel is the way to go. Maybe at the bottom of a wiki include a small note like "Checked for relevance at Version XX" and then someone like myself can always do a quick test of various examples to see if they need updating, with a successful test bumping the version checked with up to the current one. |
Take a look at this Wiki entry. I will expand on it a little bit more this afternoon but it gives you a general idea of how I am composing together environment values. |
Many programs (wget, curl, yum, etc.) can be configured to use proxies with
<protocol>_proxy
or<PROTOCOL>_PROXY
environment variables. Based on the same environment variables on the host and Vagranfile configuration we'll generate /etc/profile.d/proxy.sh that will be evaluated by most shells.All comments welcome!