tmatilai / vagrant-proxyconf

Vagrant plugin that configures the virtual machine to use proxies
MIT License
531 stars 74 forks source link

Escaping $ in proxy passwords #113

Closed ovidiubuligan closed 8 years ago

ovidiubuligan commented 9 years ago

there seams to be a problem with $ sign in passwords. I have a proxy url like http://foo:B$R@myhost:123 and after boot the proxyes are set up correctly for apt but not for environment variables . if i do a printenv | grep i get http://foo:B$@myhost:123 I think they need to be escaped somehow .

Escaping with \\ like so http://foo:B\\$R@myhost:123 will make environment variables work but not apt. Can I work around this somehow ?

otahi commented 9 years ago

Hi @ovidiubuligan,

Just a work around.

Escaping with \ like so http://foo:B\$R@myhost:123 will make environment variables work but not apt.

I have not tested on my environment, but how about following work around.

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.proxy.http  = "http://foo:B\\$R@myhost:123/"
  config.proxy.https = "http://foo:B\\$R@myhost:123/"
  config.apt_proxy.http = "http://foo:B$R@myhost:123/"
  config.apt_proxy.https = "http://foo:B$R@myhost:123/"
end

You can override proxy servers for apt. See Configurable applications

ovidiubuligan commented 9 years ago

Yes , it seams to be enough . Thank you !

otahi commented 8 years ago

This is solved. Ref #130.