Skip to content

Commit f764b8a

Browse files
author
Himanshu Shekhar
committed
First Release
0 parents  commit f764b8a

File tree

9 files changed

+481
-0
lines changed

9 files changed

+481
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
ProxyMan (for Linux)
2+
Author : Himanshu Shekhar < https://github.com/himanshushekharb16/ProxyMan/ >
3+
The version number is mentioned in the main.sh file.
4+
CLI Tool to set up and manage proxy settings for Debian/Ubuntu Linux distributions.
5+
6+
Additionally, script proxy_check.sh is provided to check your current proxy settings.
7+
This helps much in debugging and observing the behaviour of proxy configuration tools.
8+
9+
Licensed under GNU GPL v2
10+
11+
How to use this tool?
12+
=====================
13+
Browse to the directory containing this tool and the following commands would help you out.
14+
bash main.sh : To set up/unset proxy settings
15+
bash proxy_check.sh : To check your current proxy settings
16+
17+
What does it requires on?
18+
=========================
19+
Perhaps, nothing in a modern day GNU/Linux distribution.
20+
The entire script is written in bash and uses common GNU components. It is specifically written for distros having the following components :
21+
gsettings, apt, bash
22+
Tools used in the bash script are : sed, grep, regex.
23+
24+
Why this tool?
25+
==============
26+
The options for configuring proxy settings in desktop environment (as observed in distros as Debian, Ubuntu) set proxy for the Desktop Environment (technically speaking gsettings), but they were observed not work well for other locations as bash and apt.
27+
The major problem arises in the case of authenticated proxies, where the "Apply System Wide" option, does not sets up authentication for the proxy.
28+
This tool is a way of manually setting up proxy individually to Desktop Environment, Package Manager, and the Shell, i.e. gsettings, bash and apt.

apt_config.bak

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Acquire::Http::Proxy "http://<USERID>:<PASSWORD>@<HOST>:<PORT>/";
2+
Acquire::Https::Proxy "https://<USERID>:<PASSWORD>@<HOST>:<PORT>/";
3+
Acquire::Ftp::Proxy "ftp://<USERID>:<PASSWORD>@<HOST>:<PORT>/";
4+
Acquire::Socks::Proxy "socks://<USERID>:<PASSWORD>@<HOST>:<PORT>/";

bash_set.bak

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Lines added through ProxyMan v1.1
2+
# Author : Himanshu Shekhar < https://github.com/himanshushekharb16/ProxyMan >
3+
# Methodology credit Alan Pope, via https://wiki.archlinux.org/index.php/Proxy_settings
4+
no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com";
5+
http_proxy="http://<PROXY>";
6+
https_proxy="https://<PROXY>";
7+
ftp_proxy="ftp://<PROXY>";
8+
socks_proxy="socks://<PROXY>";
9+
rsync_proxy="rsync://<PROXY>";
10+
http_proxy="http://<PROXY>";
11+
HTTP="http://<PROXY>";
12+
HTTPS="https://<PROXY>";
13+
FTP="ftp://<PROXY>";
14+
SOCKS="socks://<PROXY>";
15+
RSYNC_PROXY="rsync://<PROXY>";
16+
# end of proxy settings for CLI

changelog.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ProxyMan changelog
2+
===============================================================
3+
4+
## v1.1 : First release : December 31, 2015
5+
---------------------------------------------------------------
6+
* bash_set.conf had no eol, causing warnings from bash on Elementary OS Freya.
7+
* Added semicolon to the end of each line of bash proxy settings
8+
* apt.conf generated had missing semicolon in each line, causing errors. Fixed now.
9+
* gsettings_config.* files are useless, thus removed.
10+
* bash_unset.bak file is useless, thus removed.
11+
12+
13+
## v1.0 : Initial launch (pre-release) : December 30, 2015
14+
---------------------------------------------------------------
15+
* The initial version of the script published.
16+
* Worked fine as tested on Debian Jessie.

foofile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
if [[ -e "bash_set.bak" && -e "apt_config.bak" ]]; then
2+
echo "Things are okay."
3+
else
4+
echo "Things are not okay."
5+
fi

gsettings_config.bak

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Configuration for gsettings
2+
# For Debian, Ubuntu and related distros which rely on gsettings
3+
4+
gsettings set org.gnome.system.proxy use-same-proxy <USE-SAME>
5+
gsettings set org.gnome.system.proxy mode 'manual'
6+
gsettings set org.gnome.system.proxy autoconfig-url ''
7+
gsettings set org.gnome.system.proxy ignore-hosts ['localhost', '127.0.0.0/8', '::1']
8+
gsettings set org.gnome.system.proxy.ftp host '<HOST>'
9+
gsettings set org.gnome.system.proxy.ftp port <PORT>
10+
gsettings set org.gnome.system.proxy.socks host '<HOST>'
11+
gsettings set org.gnome.system.proxy.socks port <PORT>
12+
gsettings set org.gnome.system.proxy.http host '<HOST>'
13+
gsettings set org.gnome.system.proxy.http port <PORT>
14+
gsettings set org.gnome.system.proxy.http use-authentication <USE-AUTH>
15+
gsettings set org.gnome.system.proxy.http authentication-password '<AUTH-PASSWORD>'
16+
gsettings set org.gnome.system.proxy.http authentication-user '<AUTH-USER>'
17+
gsettings set org.gnome.system.proxy.http enabled <HTTP-ENABLED>
18+
gsettings set org.gnome.system.proxy.https host '<HOST>'
19+
gsettings set org.gnome.system.proxy.https port <PORT>

gsettings_config.conf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Configuration for gsettings
2+
# For Debian, Ubuntu and related distros which rely on gsettings
3+
4+
gsettings set org.gnome.system.proxy use-same-proxy <USE-SAME>
5+
gsettings set org.gnome.system.proxy mode 'manual'
6+
gsettings set org.gnome.system.proxy autoconfig-url ''
7+
gsettings set org.gnome.system.proxy ignore-hosts ['localhost', '127.0.0.0/8', '::1']
8+
gsettings set org.gnome.system.proxy.ftp host '<HOST>'
9+
gsettings set org.gnome.system.proxy.ftp port <PORT>
10+
gsettings set org.gnome.system.proxy.socks host '<HOST>'
11+
gsettings set org.gnome.system.proxy.socks port <PORT>
12+
gsettings set org.gnome.system.proxy.http host '<HOST>'
13+
gsettings set org.gnome.system.proxy.http port <PORT>
14+
gsettings set org.gnome.system.proxy.http use-authentication <USE-AUTH>
15+
gsettings set org.gnome.system.proxy.http authentication-password '<AUTH-PASSWORD>'
16+
gsettings set org.gnome.system.proxy.http authentication-user '<AUTH-USER>'
17+
gsettings set org.gnome.system.proxy.http enabled <HTTP-ENABLED>
18+
gsettings set org.gnome.system.proxy.https host '<HOST>'
19+
gsettings set org.gnome.system.proxy.https port <PORT>

0 commit comments

Comments
 (0)