Posted on 04-13-2011 11:22 AM
Hi all,
An earlier e-mail reminded me of something that's been bugging me.
How do you set the proxy that "terminal" uses?
My new environment has 1 proxy that uses NTLM & another that just logs.
Users use the NTLM one, but servers etc use the other.
Thing I've found is that whilst a proxy is set via system prefs... Terminal doesn't seem to respect it.
Any ideas?
(this may help the issue of the jamf binary not respecting proxies too)
Regards,
Ben.
Posted on 04-13-2011 12:25 AM
The jamf binary uses curl to check for updates. Curl knows nothing about Mac OS X proxies; only the environment variables (such as http_proxy).
Posted on 04-13-2011 11:42 AM
http_proxy=http://your.proxy.server:port/
Export http_proxy
j
--
Jared F. Nichols
Desktop Engineer, Client Services
Information Services Department
MIT Lincoln Laboratory
244 Wood Street
Lexington, Massachusetts 02420
781.981.5436
Posted on 04-13-2011 02:35 PM
Something like below?
/usr/sbin/networksetup -setautoproxyurl $networkinterface $proxyURL
where variables could be
networkinterface="ethernet"
proxyURL=http://blahablah.url:port or a_script_path
Posted on 04-13-2011 03:02 PM
Well, that would set the Mac OS X proxies, but it would not set the proxies that are used by terminal-based programs like curl. You'd need to use something like this:
export http_proxy=http://your.proxy.server:port/
And you'd have to use it in the shell where you run the jamf binary, sometime before calling the binary. Or you could set it globally by adding it to some files in /etc, but when I tried that, it seemed to mess other things up.
Posted on 04-14-2011 10:11 AM
Thanks all i didn't have a chance to look at it today... I had issues creating a cs5 pkg... But now I've realised the proxy was probably the issue!
Regards,
Ben.
Posted on 04-14-2011 02:39 PM
You are right, that would not do it for terminal. Although 'curl' already has params that can be used to give it proxy I know that's not your point. So, this is how I was able to make curl work:
echo "export HTTP_PROXY='http://myproxy:port'" >>/etc/profile
echo "export http_proxy='http://myproxy:port'" >>/etc/profile
Interestingly exporting http_proxy alone did not do it for me...
Adil
Posted on 04-14-2011 02:46 PM
So you can't set it globally?
Regards,
Ben.
Posted on 04-14-2011 02:56 PM
Actually, that's not what I am saying. I think below might be what you need to set it globally as /etc/profile seems to be read by all other profiles.
Adil
Posted on 04-14-2011 03:01 PM
Thankyou!
I'll test tomorrow.
Regards,
Ben.
Posted on 04-14-2011 04:13 PM
Indeed, /etc/profile is read by all shells when they load, for every user (even in single-user mode, I think). This is the best place to put any environment variables that need to be truly global. That's why $PATH is set in there.
Posted on 04-15-2011 01:45 AM
well i made the change but no joy.
will keep trying..
Posted on 04-15-2011 01:48 AM
fyi.. i've been testing this by trying to download instadmg (svn checkout http://instadmg.googlecode.com/svn/trunk instadmg) & when on LAN it cannot connect... on ADSL it works fine.
Posted on 04-15-2011 02:15 AM
looks like you also need to do the same for /etc/bashrc as it is used for non-login terminal windows.. so this is what i had to do..:
echo "export HTTP_PROXY="http://10.1.2.108:8080"" >>/etc/profile
echo "export http_proxy="http://10.1.2.108:8080"" >>/etc/profile
echo "export https_proxy="http://10.1.2.108:8080"" >>/etc/profile
echo "export HTTPS_PROXY="http://10.1.2.108:8080"" >>/etc/profile
echo "export https_proxy="http://10.1.2.108:8080"" >> /etc/bashrc
echo "export http_proxy="http://10.1.2.108:8080"" >> /etc/bashrc
echo "export HTTP_PROXY="http://10.1.2.108:8080"" >> /etc/bashrc
echo "export HTTPS_PROXY="http://10.1.2.108:8080"" >> /etc/bashrc
that seems to work for pinging www.apple.com, but looks like redirection does not work (so apple.com doesn't work neither does
svn checkout http://instadmg.googlecode.com/svn/trunk instadmg).
Posted on 04-15-2011 01:43 PM
The proxy environment variables are commonly supported by command-line tools, but they are not enforced in any way. It is up to each software developer to write code to check them.
On Apr 15, 2011, at 4:15 AM, Ben Toms wrote:
In the case of Subversion, the proxy must be set in its configuration file - the env vars are not consulted. See http://subversion.apache.org/faq.html#proxy
-- Ben
Posted on 09-10-2012 09:08 AM
Can someone please explain how to do this?
I have looked on the url and this is not helpful. I wish to know how to add this to the configuration file but which configuration file and where?
I am trying to download InstaDMG behind a proxy and i also have a developer that wishes to use the commandline to install these two apps but experiencing problems because of the proxy
I have a direcory ~/.subversion if that helps
Thanks