-
Notifications
You must be signed in to change notification settings - Fork 264
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
Proxy support and ability to disable using BITS #85
Conversation
bump |
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.
Fix HTTPS download
@@ -23,10 +23,17 @@ if exist "%filename%" goto exit0 | |||
echo ==^> Downloading "%WGET_URL%" to "%filename%" | |||
|
|||
:powershell | |||
if defined http_proxy ( | |||
powershell -Command "$wc = (New-Object System.Net.WebClient); $wc.proxy = (new-object System.Net.WebProxy('%http_proxy%')) ; $wc.proxy.BypassList = (('%no_proxy%').split(',')) ; $wc.DownloadFile('%WGET_URL%', '%filename%')" >nul |
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 configuration works if you download a file over HTTP but not over HTTPS. It fails with the first download of wget with my proxy and it works if I use %https_proxy%
.
|
||
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%url%', '%filename%')" <NUL | ||
if defined http_proxy ( | ||
powershell -Command "$wc = (New-Object System.Net.WebClient); $wc.proxy = (new-object System.Net.WebProxy('%http_proxy%')) ; $wc.proxy.BypassList = (('%no_proxy%').split(',')) ; $wc.DownloadFile('%url%', '%filename%')" >nul |
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.
Same here with HTTPS
Any news on this? |
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 was facing the same problem. In my case behind a corporate proxy, where the authentication does not correspond to the username and password of the user of the machine. I solved it by including this line before the DownloadFile statement in floppy/_download.cmd and floppy/01-install-wget.cmd:
$wc.proxy.Credentials = (New-Object System.Net.NetworkCredential('%cr_user%', '%cr_pass%')) ;
and editing the floppy/_packer_config.cmd accordingly:
set proxy=yourproxyurl:port
set auth_proxy=true
if defined proxy (
echo ==^> Setting HTTP Proxy....
echo ==^> HTTP Proxy Set to %proxy%
set http_proxy=http://%proxy%
set https_proxy=http://%proxy%
set no_proxy=noproxy.domain.com,noproxy2.domain.com
if defined auth_proxy (
set cr_user=yourusername
set cr_pass=yourpassword
)
)
Hope it helps :)
@2xyo Sorry, but I'm not really involved with this project at this point. We (Chef) moved our windows image development over to our bento project at https://github.com/chef/bento/ |
Similar this as I mentioned in here: #87 (comment) @tas50 I just checked your repository and see that you have very clean and small packer scripts. But they also lack a lot of the different image types, only windows 7, 10, etc. (no 8). I'd really love to see some a project with solid security principles, clean layout, clean scripts and almost as flexible as boxcutter's version. Hoping we might be able to squeeze this one into shape. :) |
See #179 as a replacement. |
Configure proxy support and add optional ability to disable use of bits for downloading files in floppy/_packer_config.cmd