tmatilai / vagrant-proxyconf

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

Unable to remove svn proxy #115

Closed westonruter closed 5 years ago

westonruter commented 9 years ago

We have a Vagrantfile that detects whether the user is on a corporate network that needs a proxy, and when so it sets config.svn_proxy.http as required. When connecting outside the corporate network, however, the proxy needs to be cleared out. At first I was attempting this in the Vagrantfile with:

config.proxy.http     = false
config.proxy.https    = false
config.svn_proxy.http = false

This would result in a /etc/subversion/servers that contained:

[global]
http-proxy-host=
http-proxy-port=
http-proxy-username=
http-proxy-password=
http-proxy-exceptions=

But unfortunately, when the SVN proxy is configured in this way with empty proxy configs, at least in 1.7.9, it fails to connect:

svn: E175002: Unable to connect to a repository at URL 'http://core.svn.wordpress.org/trunk'
svn: E175002: OPTIONS of 'http://core.svn.wordpress.org/trunk': Could not resolve hostname `': No address associated with hostname (http://core.svn.wordpress.org)

I also tried:

config.svn_proxy.http = nil

But this had no effect on the existing SVN config (as noted in the README).

In order to restore SVN connectivity, the following command has to be run to forcibly remove the entries:

cat /etc/subversion/servers | grep -v http-proxy | sudo tee /etc/subversion/servers > /dev/null

But the next time that Vagrant reloads, vagrant-proxyconf will restore these empty values and the manual command will have to be re-run.

So when config.svn_proxy.http is false, please have the http-proxy-* SVN configs be removed entirely instead of outputting empty values.

codylane commented 5 years ago

This has been addressed 2.0.0. I'm going to close this.

Please open a new issue if not resolved after upgrading to to 2.0.0