Tahaan / proxymanager

Tool to enable or disable the configured proxy server for a wide range of programs
GNU General Public License v3.0
8 stars 5 forks source link

Set and unset https instead of git protocol. #27

Open gitfineon opened 8 years ago

gitfineon commented 8 years ago

Most of the proxies do not allow the dedicated port (9418), using https instead does not need another port. But it doesn't work, if only git protocol is allowed by the server and there is no https option ... then you may need something to tunnel the port.

Tahaan commented 8 years ago

Firstly ProxyManager doesn't "revert". "ON" case is to set the config for each program to use the currently specified proxy. "OFF" case is to set the config for each program to use no proxy at all. There is no "REVERT" case, and previous configuration is not backed up.

The problem is the "unset" which has got an RE in the OFF case. (The RE is constructed using the current ProxyManager configuration). It may fail to unset anything if the user changed the Proxy Server (Because The RE will not match any settings in the GIT global config)

Consider the following for line 24: git config --global --unset http.proxy or possibly git config --global --unset http.proxy http:

Tahaan commented 8 years ago

This demonstrates the problem:

tahaan@Komputer:~$ cat /etc/proxymanager.conf 
PM_INSTALL_DIR=/usr/local/proxymanager
PM_USERNAME=${SUDO_USER:-$USER}
PM_USERHOME=`eval echo ~$PM_USERNAME`
PM_PROXY_HOST=localhost
#PM_PROXY_PORT=3128
#PM_PROXY_PORT=3333
#PM_PROXY_PORT=8123
PM_PROXY_PORT=5050

tahaan@Komputer:~$ /usr/local/proxymanager//proxymanager check
[sudo] password for tahaan: 
Root Wget: On
Android SDK: On
Git: On
Youtube-dl: On
tahaan@Komputer:~$ git config --global --unset http.proxy http://invalid.com:1234
tahaan@Komputer:~$ /usr/local/proxymanager//proxymanager check
Root Wget: On
Android SDK: On
Git: **On**
Youtube-dl: On
tahaan@Komputer:~$ git config --global --unset http.proxy http://localhost:5050
tahaan@Komputer:~$ /usr/local/proxymanager//proxymanager check                                      
Root Wget: On                                                                                                                           
Android SDK: On                                                                                                                         
Git: **Off**                                                                                                                        
Youtube-dl: On                                                                                                                          
tahaan@Komputer:~$ `