Git Product home page Git Product logo

proxyman's Introduction

ProxyMan Gitter chat

Configuring proxy made so simple on Linux (releases)

v3 is ready with new features, necessary improvements, updates, restructured code and much better experience. ๐ŸŽ‰

How to use it

asciicast

  • Download and install with single-step process. ./install

Proxyman is now available in your path. Open a new terminal window and start playing.

  • Set proxy proxyman set

  • Save your settings for later use.

  • View your saved configs proxyman configs

  • Load your previously saved config - say you saved it by the name point4. proxyman load point4

What's new?

  • Saved configs made more organized and works flawlessly.
  • Installation script makes it available in your path. Just call the command proxyman, no cd to your downloads.
  • Lots of issues got closed.
  • Restructured codebase with better code quality than before - easier to maintain.

Why still a release candidate?

If you find any bugs/edge-cases not taken care of ๐Ÿ™ˆ, feel free to open an issue. :smiley:

DISCLAIMER

Please don't save your passwords on public machines. Instead use proxyman without providing password and log-in from the browser.

proxyman's People

Contributors

akspi avatar danielchesters avatar himanshub16 avatar kavishdahekar avatar ruben-vv-next avatar skulltech avatar yasn77 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

proxyman's Issues

Unset proxies in /etc/environment

Great script, but Please include functionality to remove/delete proxy configuration from /etc/variables file that have been set manually. Also for unseting ftp

Set proper configuration files on MacOS.

MacOS has some different configuration files for environment variables. The script be able to determine the OS and act accordingly.
The details about the files are available here.

Script throws some errors

sumit@sumit-HP-Pavilion-Notebook:~/Coding/ProxyMan$ ./main.sh 


ProxyMan
=========
Tool to set up system wide proxy settings on Linux.
๐ŸŒŸ Star it  :  https://github.com/himanshub16/ProxyMan 

 The following options are available : 
 set     :  Set proxy settings 
 unset   :  Unset proxy settings 
 list    :  List current settings 


 Enter your choice : unset

 Enter targets where you want to modify settings : 
 | 1 | All of them ... Don't bother me
 | 2 | Terminal / Bash (current user) 
 | 3 | Environment variables (/etc/environment)
 | 4 | apt/dnf (package manager)
 | 5 | Desktop settings (GNOME/Ubuntu)
 | 6 | npm
 | 7 | Dropbox
 | 8 | Git

 Enter your choices ( separate multiple choices by a space  ) 
 ? 1

Someone wants to unset all
[sudo] password for sumit: 
GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.

Done! Thanks for using :)
sumit@sumit-HP-Pavilion-Notebook:~/Coding/ProxyMan$ 

~/.gitconfig proxy setting is not cleaned

When we run proxyman unset, the lines in ~/.gitconfig

[http]
	proxy = https://172.31.2.4:8080/
[https]
	proxy = https://172.31.2.4:8080/

turn into

[http]
[https]

On setting the proxy later on, these lines persist i.e. the gitconfig file becomes

[http]
[https]
[http]
	proxy = http://172.31.2.4:8080/
[https]
	proxy = https://172.31.2.4:8080/

This results in many of these lines over time

proxyman version v3.1.2 on Ubuntu 18.04

Add more support

  1. all_proxy is needed for some applications
  2. socks is also not supported
  3. If you can add support for bower if would be nice ๐Ÿ˜„
  4. Doesnt work on arch linux as well

Use .bash_profile instead of .bashrc if the user has a login shell.

Many times the user has a login shell instead of a normal shell, like MacOS, servers. In that case, the environment variables are available in .bash_profile instead of .bashrc.
A fix is required around this, by checking which of those two files already exist and try to change settings for that only.

add support for linux mint driver manager

Hi,
first of all - nice work - this is THE BEST solution for proxy. Thanks man.

Can you please add support for linux mint driver manager as it doesn't work.
Thanks in advance.

p.s.:
maybe this will be helpfull?

Add proxy for bower

Allow option for adding proxy in the .bowerrc file.

{
"proxy":"http://<host>:<port>",
"https-proxy":"http://<host>:<port>"
}

Implement user-specific config in `~/.proxymanrc` for bash, zsh

There have been certain issues wrt to shell environment variables.
As of now, bash settings are stored as variables in .bashrc. However, they become pretty useless for other shells like zsh ( #10 ), and login shells.
MacOS uses .bash_profile and not .bashrc ( #7 ).

A solution to this could be saving the variables to a file, say ~/.proxymanrc and have

source ~/.proxymanrc

in .bashrc or .zshrc.

This would require following things to be done:

  • Saving intermediate bash_config.tmp to .proxymanrc and modifying source in .bashrc or .zshrc when change is required.

TLS handshake error on sudo apt update

Screenshot_20190316_214551
Getting TLS handshake error on sudo apt update. Was not able to add some ppa repositories.
After some searching found out that the extra s in https://

echo "Acquire::Https::Proxy \"https://${stmt}${https_host}:${https_port}\";" \
         >> "$CONF_FILE"

of the apt.sh was creating the problem.
Screenshot_20190316_215134

Found the problem via this answer : https://askubuntu.com/questions/1014973/apt-update-could-not-handshake-an-unexpected-tls-packet-was-received/1014978

My OS is Kubuntu 18.04 not sure whether other Linux OS's will face the same problem or not.

Support systems without sudo (Debian)

In Debian, sudo is not installed by default.
Is it possible to implement a way to use it without sudo?
Maybe checking first and then requiring to be logged in as root?

special character support - bug

With special characters in the password, I can use the encoding (@ = %40), but this doesn't work for all the targets.
The typing should happen in the standard way (typing @) and the scripts should take care of encoding special characters if necessary.

EDIT:
The bug was: I used encoding (%40) but apt gave a proxy authentication error. With non-encoding it works.

Create wiki about proxy configuration and management

The following could be the content of the wiki :

  • Educating about what is proxy and how it works
  • How is proxy configured on different platforms (GNOME/KDE/OSX/Windows)
  • How applications use proxy settings to communicate over network
  • How one has to configure proxy if he/she wants to do it manually
  • What is the state of some popular applications on proxy settings and how do they handle it

This is a really nice resource: https://wiki.archlinux.org/index.php/proxy_settings

Proxy issue in npm

Currently this is written in .npmrc file:

proxy=http://<host>:<port>/
https-proxy=https://<host>:<port>

But this is the correct thing to do:

proxy=http://<host>:<port>/
https-proxy=http://<host>:<port>

Notice the s missing in https-proxy. :)

Refactoring required

Following changes to the codebase would be helpful.

  • Replacing colour codes and other formatting codes with string variables.
  • Restructuring main.sh to reduce the number of lines in switch-case by coupling operations into functions.

Setting/un-setting environment variables for proxy not working

I tried to install the latest version in my Manjaro 18.0.4 XFCE. To install it successfully, I had to add "$HOME/.local/bin" to $PATH. After installation, when I tried to unset the proxy (I use proxy by editing "/etc/environment" file), it showed this error:
bash: environment.sh: No such file or directory
When I checked $HOME/.proxyman/, indeed there was no environment.sh file. How do I resolve this?
I have been using ProxyMan 2.5 for quite some time, never faced this problem there.

EDIT: Adding screenshot of the same
Screenshot_2019-03-13_16-12-17

Create tests to check before merging any PR

Suggestions and discussions on methodology are welcome.
Requirement: To run a script/test and get to know if the proxy is getting set at required locations or not. Also, the test should tell which locations did it check and which not, so that nothing gets escaped.

Questions & feedback

Thanks for contributing this utility!

Some questions:

  • why is the tool manipulating entries with "github.com" in environment such as sed -i '/github\.com/d' ~/.bashrc ?
  • why does the manual instruct to use "bash main.sh" instead of just "main.sh" since there is the associated #/bin/bash bang header ?

And some feedback:

  • in my case, I need only http proxy to be set and not ftp or socks proxy. What would be the best way to adapt the tool ?
  • I'd feel safer if backups of the edited files would be saved (e.g. -i[SUFFIX] sed option such as -i.old)

Thanks,

Guillaume.

ProxyMan, single command?

Hi everyone,

is there a way to configure ProxyMan with a single command that doesn't need additional information? I'd like it because i need to use something like ProxyMan for a background use.

Thanks

Add support for config file

We could add support for a config file (maybe in INI format) which would contain the proxy settings, to be used when we set proxy. That way the user wouldn't have to enter the proxy server, port etc again and again.

git https proxy setting

Hi,

git proxy settings :
http http://proxyurl:8080/
https https://proxyurl:8080/

I need to be set

git proxy settings :
http http://proxyurl:8080/
https http://proxyurl:8080/

Is that for everyone working? Or should be there a if statement like:

   if [ "$USE_HTTP_PROXY_FOR_HTTPS" = "true" ]; then
        git config --global http.proxy "http://${stmt}${http_host}:${http_port}/"
        git config --global https.proxy "http://${stmt}${https_host}:${https_port}/"
    else
        git config --global http.proxy "http://${stmt}${http_host}:${http_port}/"
        git config --global https.proxy "https://${stmt}${https_host}:${https_port}/"
    fi

Colors don't display on unsupported terminals.

The default terminal/bash in MacOS does not support colours, which makes the terminal display the colour codes adjoining the exact statement. This could even happen on old terminal emulators which don't support colour. (not tested yet)
The solution is to have some workaround this, by having a separate script without any such colour codes and executing that if things start to fail.

Issues with `/etc/environment`

There has been an issue persisting for long due to setting of proxy in /etc/environment.
This file is read at user login and stays in the display manager's shell. Thus, to reload this file wherever it is being used requires log out and then re-login.
Also, there have been observations on apt overriding /etc/apt/apt.conf for /etc/environment for proxy variables, hence the decision.

Also, there does not seem to be any major impact of dropping default support for `/etc/environment'.
If anyone has any issue with the same, comment below.

Observed on: Ubuntu

ProxyMan (GUI) privilege issues

The GUI has issues with setting proxy settings for places where elevated privileges are required, like /etc/environment, /etc/apt/apt.conf. The current solution for privilege escalation is pkexec, using which is added to the subprocess which executes the respective script with proper arguments. However, it's easy to execute scripts with sudo permission from Terminal, but GUI should give some kind of out of the box experience.

Alternative solutions are welcome.
Any fix will be greatly appreciated.

P.S. Code is available if GUI branch

Drop ProxyMan support for applications using `http_proxy` environment variable

The major motivation behind creating ProxyMan was handling the cases when applications were not able to function properly, primarily due to

  • Not using http_proxy environment variable.
  • Not being launched from shell, so variables are set.
  • Not using system's proxy settings (depending on OS).

However, as of now, almost all tools like git, npm, yarn (#46 ), bower (#40 ), maven (#47 ), etc. work well with http_proxy, the need to configure them manually becomes insignificant. There's just one kind of use case where you'd require a different proxy for git and http_proxy, which is a very rare use-case.

I would like to have feedback on if there shall be cleanup in ProxyMan to expect applications to pick up http_proxy as most of them do.

https://github.com/himanshub16/ProxyMan/tree/v3#how-this-is-going-to-be-different-from-v2

proxy does not unset

Hi there,
when I want to disable proxy recently I face this problem :
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
Proxy Disabled
and in fact it is not disabled and my internet does not work .
P.S: I am using Ubuntu
Thanks

Add feature to set proxy settings temporarily.

This is something to be carefully figured out. The aim is to reset old settings on logout.
It is required when the user is on a public terminal/computer lab, where there are chances to forget removing values, and sometimes passwords.

Add ProxyMan in AUR repository

First of all I want to thank you for making ProxyMan. It would be perfect if ProxyMan could be installed directly from the Arch Linux AUR repository. Thank you.

Firefox not obeying proxy settings

hello sir! first of all my humble thanks to you for creating this wonder full tool for saving my time .but, small error is still arising .when i try to use internet in firefox ,its not working.please see this issue
Thanks in advance

[Elementary OS] Error after setting proxy

The default .bashrc doesn't have a newline at the end. So, after ProxyMan edits the file, the settings are written adjoining the end of switch case as stated below.

esachttp_proxy='''''....

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.