More generally than the post described here: Using bash functionality in rc files
I would like to set an appropriate proxy configuration for all/multiple applications including but not limited to: snap/apt/cpan/pip/wget/curl. Moreover, I would like to avoid having my proxy password displayed anywhere in plaintext. How/is it possible to achieve this?
This post implies that every system process will be configured for proxy via /etc/environment
. I have not had such success (see EDIT), so I am currently under the assumption that all proxy configurations must be made per application. Regarding the linked post, and the use of secret-tool
, it seems to me that this assumes the file defining the proxy configuration(s) can evaluate bash expressions (which hasn't been my experience with the .curlrc
/.wgetrc
files).
EDIT:
With the contents of etc/environment
equal to:
http_proxy=http://user:[email protected]:80
https_proxy=http://user:[email protected]:80
and the contents of my .curlrc
file equal to:
proxy=http://user:[email protected]:80
I can run:
curl https://unix.stackexchange.com/posts/752654/edit --output test.html
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 70115 0 70115 0 0 99k 0 --:--:-- --:--:-- --:--:-- 99k
which generates test.html
as expected.
Without changing the contents of /etc/environment
and removing the .curlrc
file, the download hangs indefinitely:
curl https://unix.stackexchange.com/posts/752654/edit --output test.html
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:25 --:--:-- 0
I'm using RHEL on WSL.
/etc/environment
? If yes, why do the parameters (in/etc/environment
above not work [in the absence of .curlrc/.wgetrc having the same parameters]) to e.g. successfully download a file with wget or curl?