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

Proxy support and ability to disable using BITS #85

Closed
wants to merge 4 commits into from

Conversation

daxgames
Copy link
Contributor

@daxgames daxgames commented Nov 12, 2016

Configure proxy support and add optional ability to disable use of bits for downloading files in floppy/_packer_config.cmd

@daxgames
Copy link
Contributor Author

daxgames commented Dec 8, 2016

bump

@2xyo 2xyo mentioned this pull request Jul 26, 2017
Copy link

@2xyo 2xyo left a 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
Copy link

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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here with HTTPS

@fduranti
Copy link

Any news on this?

Copy link

@Ishalon Ishalon left a 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
Copy link

2xyo commented Jul 5, 2018

Hi @tas50, could you please have a look at this PR ?

This feature proposed by @daxgames is really interesting as proxies are so common in corporate environment.

@tas50
Copy link
Contributor

tas50 commented Jul 5, 2018

@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/

@dragetd
Copy link

dragetd commented Feb 27, 2019

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. :)

@daxgames daxgames closed this Mar 21, 2019
@daxgames
Copy link
Contributor Author

See #179 as a replacement.

@daxgames daxgames mentioned this pull request Mar 21, 2019
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

Successfully merging this pull request may close these issues.

6 participants