-
Notifications
You must be signed in to change notification settings - Fork 139
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 basic proxy auth #99
Add basic proxy auth #99
Conversation
$proxy.Credentials = New-Object System.Management.Automation.PSCredential ("<% @proxy_username -%>", $passwd); | ||
$downloader.UseDefaultCredentials = $true | ||
<%- end -%> | ||
$downloader.Proxy = $proxy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very similar to what I just released at https://github.com/chocolatey/choco/blob/2fbecf671dd6a2bfc54ee2c6a97bb152649d340c/src/chocolatey.resources/helpers/functions/Get-WebFile.ps1#L40-L52
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm slightly confused about this. I thought that this was for strictly installing chocolatey itself via the puppet module. It looks like the link you sent was setting the proxy within chocolatey for packages to be installed via "choco install" correct? I did take this from https://github.com/chocolatey/choco/wiki/Proxy-Settings-for-Chocolatey and then just put it in the template file with some if statements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@as0bu no worries, this was an FYI. It looks basically like what was implemented in chocolatey itself for installing packages and software.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ferventcoder Oh ok I see!
fwiw - i really like this PR. |
@rismoney agreed. :) |
I'm not sure what I did with my original comment, but @as0bu please add specs for this. This is great so far! |
Will do. Just give me a bit since I'm currently traveling back from a long distance client location. I hope to have that done Monday or Tuesday. |
@as0bu do you have time to finish this PR? |
@as0bu Ping - I know this was awhile ago. This would be a good addition to what you can pass, so if you can get those specs added and rebase this we can move forward! |
@ferventcoder I plan to do this during this week at PuppetConf. |
So after looking at this some more I think that commit e4c5f09 takes care of this. While the credentials aren't specified via Puppet, I think they're pulled from the operating system. @ferventcoder Could you confirm this? |
I think it may. We could always close this for now and if you see a need to pick this up in the future, we could do it then? |
Sounds like a plan! |
Closing for now. |
I think this should be reopened as System.Net.WebClient will only pick up proxy settings from Internet Explorer and these are rather tricky to set automatically (requires calling WinInet in the Win32 API). A way to pass in an explicit proxy, either as a Puppet parameter or from an environment variable like the install script from chocolatey.org would be extremely useful. |
At the same time, it would be interesting to be able to use the same level of complexity that are often in place (for example, at my place, we have complex proxy settings, all managed by the proxy.pac file. It is rather difficult for us to work with only one server / one port. |
@hbuckle @tardich explicit proxy would be great. However why don't we have you open an issue at https://tickets.puppet.com/browse/MODULES for the Puppet supported module - https://github.com/puppetlabs/chocolatey (so puppetlabs/chocolatey instead of chocolatey/chocolatey)? This issue is not an issue at all, it is a pull request. If you think this would be good to look at with chocolatey/chocolatey, then open an issue here to address. |
It does look like #142 was opened on this. You can comment/ subscribe to that issue. |
…r/remove-rake-lines (MAINT) Remove unnecessary lines from Rakefile.
This allows the user to specify proxies during the chocolatey install.