dragon2fly / vpngate-with-proxy Goto Github PK
View Code? Open in Web Editor NEWvpn gate client for linux, be able to connect to open vpn server through proxy
License: GNU General Public License v2.0
vpn gate client for linux, be able to connect to open vpn server through proxy
License: GNU General Public License v2.0
Unfortunately, It's only Debian client, not linux :( It does not work on fedora :( and request at least resolvconf to be installed (Debial package)
Vpn command: Traceback (most recent call last): ↑↓ page: 1/6
File "vpn_indicator.py", line 317, in change_focus
call(['wmctrl', '-a', 'vpngate-with-proxy'])
File "/usr/lib/python2.7/subprocess.py", line 168, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
errread, errwrite)leted 1
File "/usr/lib/python2.7/subprocess.py", line 1025, in _execute_child
raise child_exceptionpngate.net
OSError: [Errno 2] No such file or directory
No any process named vpngate-with-proxy
sudo ps -aux | grep vpn*
8458 0.0 0.0 14372 28 pts/0 S 11:37 0:00 /bin/bash /home/virgosun/Documents/vpngate-with-proxy/run
root 8460 0.0 0.4 647504 9228 pts/0 Sl 11:37 0:12 python vpn_indicator.py
root 10247 0.0 0.1 60704 2644 pts/0 S+ 19:22 0:00 sudo /home/virgosun/Documents/vpngate-with-proxy/run
root 10251 0.0 0.1 14372 2204 pts/0 S+ 19:22 0:00 /bin/bash /home/virgosun/Documents/vpngate-with-proxy/run
root 10262 0.0 0.1 60704 2652 pts/0 S+ 19:22 0:00 sudo python vpnproxy_tui.py /home/virgosun
root 10266 0.7 2.5 1118156 46744 pts/0 Sl+ 19:22 0:01 python vpnproxy_tui.py /home/virgosun
I'm not sure that it's easy and possible, but, maybe, it will be a nice idea to add some automatic connection possibility to vpngate-with-proxy
?
How I see this:
At rc.local
we add sq qvpn -c "/path/to/run cli --auto ON --country NL --sort uptime"
Then at each reboot the system will automatically connect to VPN with specified settings from the command line. If there will be no settings and only --auto on
then the script can use default settings from config.ini
.
Maybe the problem: How to get the current state and show it on the screen when user run the script manually from console if vpn already connected? sq qvpn -c "/path/to/run cli"
? Maybe write status and openvpn pid to the file? And if pid at the top
exists and it's openvpn
this means that we are already connected and need to show "Ctrl-C dialog" to disconnect and choose another VPN.
What do you think about that?
After changing the DNS values (successfully) and initiated connection, I get this error.
(see image)
https://anonimage.net/image/oEirzH1BUu
I should add that this error does not occur when I keep the default DNS list.
Please advise
Thanks
Marco
lucas@pc:~/vpngate-with-proxy$ ./run tui
Traceback (most recent call last):
File "vpnproxy_tui.py", line 1082, in
screen.run()
File "vpnproxy_tui.py", line 1018, in run
self.loop.run()
File "/usr/lib/python2.7/dist-packages/urwid/main_loop.py", line 278, in run
self._run()
File "/usr/lib/python2.7/dist-packages/urwid/main_loop.py", line 376, in _run
self.event_loop.run()
File "/usr/lib/python2.7/dist-packages/urwid/main_loop.py", line 682, in run
self._loop()
File "/usr/lib/python2.7/dist-packages/urwid/main_loop.py", line 715, in _loop
alarm_callback()
File "/usr/lib/python2.7/dist-packages/urwid/main_loop.py", line 164, in cb
callback(self, user_data)
File "vpnproxy_tui.py", line 665, in periodic_checker
self.status(self.ovpn.messages)
File "vpnproxy_tui.py", line 957, in status
log.write(m + '\n')
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe0' in position 59274: ordinal not in range(128)
Up, Down, PgUp, PgDown keys do not work.
https://i.imgur.com/kmByVnn.png
Maybe duplicate the keys to ASDW or JKLI or KL:O ?
Currently, I use dnsmasq to forward all domain with TLD .dev to my local ip 127.0.0.1, everything is working fine. But when I connect to a VPN, I cannot open my domain.dev, please help me to config it.
Same issue as #35
Tried using a proxy - terminal pings it and gets [alive], but still fails to fetch the list (vpngate.net is blocked for me)
I can manually download the list, how should I save it (and does it need re-formatting?)?
App also asked me to install KDE Wallet which I cancelled, is it crucial for the app to work?
Please add SOCKS5 Proxy support to enable using Tor's local SOCKS5 Proxy at 127.0.0.1:9050 to route the VPN connection over Tor.
Occurs when I try to connect to a server:
31 76.69 19 days 2weeks 1447316 tcp 995
Vpn command: user_script.sh: line 28: hostname: command not found 1/5
Error calling command line “dbus-launch --autolaunch=70c2c43711774be2b6238f1e2da3db0
failed to negotiate cipher with server. Add the server's cipher
('AES-128-CBC') to --data-ciphers (currently 'AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305') if you
want to connect to this server.
OS: Arch Linux;
Hi Dragon2fly,
First, thank you for providing this for everyone. I found this in the link below:
(http://www.webupd8.org/2017/02/easily-use-free-vpn-servers-from-vpn.html)
I tried this out on my Linux Mint KDE 17.3 system today, and it worked great. Nice touch with having the DNS option as well. I tested it with "ipleak.net".
Question(s):
Feature Requests:
A desktop GUI front-end application so that it does not need to run from the console terminal prompt window. (perhaps in QT or a Python GUI).
Auto-reconnect option?
Packaging an installer as a ".deb" file, or ".appimage", etc...
Thank you again...
Have a great day !
Phil
phd21
After starting vpngate, vpn_indicator informs the status of the vpn connected. But a misspelling has catched my eyes. It is "Season:" maybe for "Session:"
To fix it, at first terminate vpn-gate, and open & edit indicator_config file, ~/vpngate-with-proxy/vpn_indicator.py.
Substitute "Season:" -> "Session:"
That's it :)
(vpn_indicator.py:17228): Gdk-CRITICAL **: 13:28:51.754: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed
Traceback (most recent call last):
File "vpnproxy_tui.py", line 1090, in
screen = Display(vpn_connect)
File "vpnproxy_tui.py", line 605, in init
self.table = self.make_GUI() # list of lines, urwid.columns
File "vpnproxy_tui.py", line 801, in make_GUI
self.Udata.append(deepcopy(Ulabel))
File "/usr/lib/python2.7/copy.py", line 190, in deepcopy
y = _reconstruct(x, rv, 1, memo)
File "/usr/lib/python2.7/copy.py", line 334, in _reconstruct
state = deepcopy(state, memo)
File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
y = copier(x, memo)
File "/usr/lib/python2.7/copy.py", line 257, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib/python2.7/copy.py", line 190, in deepcopy
y = _reconstruct(x, rv, 1, memo)
File "/usr/lib/python2.7/copy.py", line 352, in _reconstruct
y.append(item)
File "/usr/local/lib/python2.7/dist-packages/urwid/monitored_list.py", line 384, in append
rval = super(MonitoredFocusList, self).append(item)
File "/usr/local/lib/python2.7/dist-packages/urwid/monitored_list.py", line 30, in call_modified_wrapper
self._modified()
File "/usr/local/lib/python2.7/dist-packages/urwid/container.py", line 1816, in _contents_modified
self._selectable = any(w.selectable() for w, o in self.contents)
File "/usr/local/lib/python2.7/dist-packages/urwid/container.py", line 1906, in _get_contents
return self._contents
AttributeError: 'Columns' object has no attribute '_contents'
Hi Dragon2fly and evadogstar,
I hope both of you and yours are doing well.
A couple of things:
1.) If you try to connect to a country VPN server that is not there, you get a lot errors that mess up the console text display. Could you please change the error routine for "country VPN not found" to send the errors to a text file with a date and time stamp, and perhaps reset the country code option to "all" and auto refresh? I have to hit "ctrl-c" to exit, then restart this to get a normal text display again...
2.) I like the "tui" interface, can you please add the listed VPN server IP addresses to its display too?
3.) I would still like a GUI front-end to this whenever you get a chance, let me know...
4.) When I run "python --version" from the console terminal prompt, the results is "Python 2.7.12", yet I do have python version 3 installed as well? If I type "python3 --version", the results is "Python 3.5.2". I assume that any applications will automatically look for an use whichever version they need, is this a false assumption? Or, is there some console terminal command to set a default for priority preference for python?
Thank you again for a wonderful vpngate application.
Best regards to you and yours...
Phil
how to support a proxy-list
Unfortunately, configs stored at root folder, because of sudo :( , but expected to find them at user folder with user permissions :( I was confused, before I look at the code and found that ~/
will be root
home :)
At user folder who call ./run
script. I think the most correct way will be to get user at ./run
with USER=$(whoami)
then transfer it to python vpn_gate_script as an variable (or maybe better to get $USERFOLDER at run script and transfer it. Then change ~/
to $USERFOLDER
p.s. But root folder at my OS always clean after each reboot and I loose user_script.sh
and config
:( It's really better to score configs at user folder who call the script as all programs do :)
Sorry, it was my suggestion about storing configs at user home and this add a lot of unexpected work :(
I'm doing neither ./run [arg] nor ./vpnproxy_tui.py and ./vpnproxy_cli.py has error. Thank you
File "vpnproxy_cli.py", line 95
print ctext('Warning: ', 'yB'),
^
SyntaxError: invalid syntax
File "vpnproxy_tui.py", line 167
print '\n' + '_' * 12 + ctext(' First time config ', 'gB') + '_' * 12 + '\n'
^
SyntaxError: invalid syntax
Hi Dragon2fly,
I hope you and yours are doing well.
Not sure what is going on, but recently the list of vpngate servers seems confused? When I select a server like one in the US, it sometimes shows Japan when I check it through "ipleak.net", yet I can select another US server and it works? This did not happen before a couple weeks ago? This is using the "vpngate with proxy" not the "vpnwp_v2". Does the "vpnwp_v2" have a gui interface?
Is this because of the vpngate system, retrieved server lists, vpngate with proxy, or something from my system?
Best regards,
Phil
[email protected]
nice set of scripts, thanks !
it would be useful to have an option to setup iptables rules that guard traffic against non-VPN leakage. See https://github.com/sjakthol/vpngate-client/blob/master/vpngate-client , line 34 ff.
(i am still considering to use user_script.sh for this purpose, yet i see an issue with that too. That is, as i understand it, case "down" gets executed on both "VPN terminated" AND "VPN broken", so flushing iptables here is not what we want. We want it to be flushed on termination but exactly not in the event the VPN connection breaks.)
vpngate.net is blocked by my ISP. There are mirror sites which can be accessible by my browser but I can't connect with vpngate-with-proxy. Here is the log of vpn.
Sat Feb 5 20:27:05 2022: Vpngate with proxy is started
using gate: http://www.vpngate.net
ConnectionTimeout
Connection to gate http://www.vpngate.net failed
using gate: http://213.136.92.167:13182
ConnectionError
Connection to gate http://213.136.92.167:13182 failed
using gate: http://78.142.193.246:33304
ConnectionError
Connection to gate http://78.142.193.246:33304 failed
using gate: http://172.107.219.42:32685
ConnectionError
Connection to gate http://172.107.219.42:32685 failed
using gate: http://222.255.11.117:54621
ConnectionError
Connection to gate http://222.255.11.117:54621 failed
using gate: http://i118-27-48-67.vpngate-sv.d.rspnet.jp:7458
ConnectionError
Connection to gate http://i118-27-48-67.vpngate-sv.d.rspnet.jp:7458 failed
using gate: http://118.105.213.20:23041
ConnectionError
Connection to gate http://118.105.213.20:23041 failed
Failed to get VPN servers data
Check your network setting and proxy
When the remote VPN host is closed, the traffic goes directly from my PC. The sense of using VPN disappears.
Hi Dragon2fly,
First let me tell you I love this handy tool!
Also really waiting for the implementation of softether for it!
Anyway at the moment I am running into a little issue:
user@acer:~/vpngate-with-proxy$ `./run tui`
Traceback (most recent call last):
File "vpnproxy_tui.py", line 21, in <module>
from vpn_indicator import InfoClient
File "/home/user/vpngate-with-proxy/vpn_indicator.py", line 22, in <module>
gi.require_version('Notify', '0.7')
File "/usr/lib/python2.7/dist-packages/gi/__init__.py", line 100, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Notify not available
user@acer:~/vpngate-with-proxy$
and here is the line in question; I commented it as a quick workaround but can you suggest anything better?
#gi.require_version('Notify', '0.7')
then I can ./run tui
, but after the initial configuration I click Enter, an rerun it, I get
`Lack of Gtk related modules! VPN indicator will not run!
You should try "sudo apt-get install gir1.2-appindicator3-0.1 python-gobject`
althought these dependencies are met!
(my distro = BunsenLab, latest version, always kept up to date; it is based on Debian Jessie
Thanks a lot
After connection done user see "Changed DNS" and "VPN tunnel established".
I suggest to add a lot of more information: Country connected to, IP. It's already available at the top, but need to scroll. But not a big problem :)
Please consider making aur of this package I use manjaro
Filter servers by protocol tcp/udp
I found that server config downloaded from vpngate servers AES-128-CBC not supported by newer versions of OpenVPN.
to fix this I changed 207 line of _cli.py to
command = ['openvpn', '--config', ovpn, '--data-ciphers', 'AES-128-CBC']
error picture:
http://wuguowei18508.com/Lychee/uploads/big/4c40997eb19f9f9095408064885a83a3.png
PS:I am a user from china,Does it matter?
Sorry for misunderstanding you. So you need the DNS **appeared** in the `user_script.sh` so that you can inform your **firewall** to **allow connections** to them. It is better not to change the source code of main program since other people don't have that need. Instead, let do entire job within `user_script.sh` only. The below code will parse DNS from `config.ini`, remove `,` and store the result in `dns` variable.
dns=$(cat config.ini | grep -o -P '(?<=^dns = ).*')
dns="${dns//,/}"
echo $dns
Then, just use your dns
to do what ever needed with your firewall.
Perhaps, you should write about your use-case somewhere for other people to follow.
Thanks :)
Originally posted by @Dragon2fly in #2 (comment)
I'm trying to achieve the same thing as this person here, but having issues. I think my issue might be slightly different however as I am using Debian VM rather than Fedora VM.
I am able to get a connection, however other App VM's connecting through the vpn can't get web browser access. Does you're script create a .ovpn config file? As I need to add the setting of "redirect-gateway def1" to it somehow.
Where would I go about doing that? Many thanks
Hi Dragon2fly,
It would also be nice to have the ip address (and or name) of the VPN servers displayed in the console terminal output menu screen. This way we can determine which VPN server(s) we may have used before, or that we have tried and work better. Of course maybe recording the connection history of server ip addresses to a text file (or database file) and providing a quick compare to currently available servers option with a visual indicator (some character or symbol) showing which servers (if any) have been used before would help users as well?
FYI: I also tried this in my Linux Mint 18.1 KDE system and it works well there as well. :)
Thank you again for providing this very useful tool.
Have a great day and night ...
Best regards to you and yours,
Phil
phd21
It is a wrapper on top of openvpn.
Plus it breaks more than it works.
Hi Dragon2fly,
Me again, the problem I'm facing now is the script needs to be run as qvpn user to get through the dns on the system... I tried adding
command = ['sg qvpn -c openvpn', '--config', ovpn]
but it failed.
Where can I preappend sg qvpn -c to the openvpn command? Thanks
Hello, Thank you!
Previous python2 version worked up for many-many years ( 4 years, wow!) to the present moment before fedora 32 drop python2 support. As soon as I found that it no longer works.... I begin thinking about inventing bicycle, but thank you again I visit your repo and found new python3 version based on previous release and it's works fine after some minor changes for my system :-)
p.s. I run it not as root, but as other user to prevent leaks, because of this I change "run" file each time + user_script.sh
👍
After changing country at cli (5 option) and begin searching for servers vpngate-with-proxy exit with the following error.
Also question related to the 5 option. Is it possible to add opportunity to use country list at step 5 ( "jp, kr, us") as value ?
File "vpnproxy_cli.py", line 485, in <module>
sort_by = cfg.sort.values()[0]
TypeError: 'dict_values' object is not subscriptable
@Dragon2fly Hello, can you please check. Can you connect to any VPN? It seems that something changed on servers and now server request tls connection with verified tls certificate. My current OpenSSL 3.0.5 5 version.... no possible to connect anymore anywhere, can find any workaround......
Noticed this today.
Or maybe something with Let's Encrypt servers and openvpn can not make request to it to verify?
2022-12-18 05:23:15 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
2022-12-18 05:23:17 VERIFY ERROR: depth=1, error=unable to get local issuer certificate: C=US, O=Let's Encrypt, CN=R3, serial=192961496339968674994309121183282847578
2022-12-18 05:23:17 OpenSSL: error:0A000086:SSL routines::certificate verify failed
2022-12-18 05:23:17 TLS_ERROR: BIO read tls_read_plaintext error
2022-12-18 05:23:17 TLS Error: TLS object -> incoming plaintext read error
2022-12-18 05:23:17 TLS Error: TLS handshake failed
2022-12-18 05:23:17 Fatal TLS error (check_tls_errors_co), restarting
Hello,
I installed all the dependencies on archlinux - I can't seem to connect. I have tried various methods of connecting (including trying to do this manually via openvpn) however I cannot connect. Your app is the first one that gave me the error message. Please see below:
I want to connect to Russian Servers to play LostArk.
Hello,
I suggest to move config.ini
and user_script.sh
to ~/.config/vpngate-with-proxy
directory.
It's for easy script update (simple delete directory and clone new version), because cloning will remove current user_script.sh
What do you think about that?
Soon current cipher will be deprecated in new openvpn version. Maybe, replace it in config for better cipher? Or make an option to choose by the user (to support old openvpn, but unsure). I see that downloaded config support some better ciphers + improve security.
DEPRECATED OPTION: --cipher set to 'AES-128-CBC' but missing in --data-ciphers (AES-256-GCM:AES-128-GCM). Future OpenVPN version will ignore --cipher for cipher negotiations. Add 'AES-128-CBC' to --data-ciphers or change --cipher 'AES-128-CBC' to --data-ciphers-fallback 'AES-128-CBC' to silence this warning.
OS shutdown must be correctly handled by the script. Right now script interrupt when openvnp closed as requested by OS, then (as I can understand) script restart openvpn, but it must END his job too.
Need to add SIGTERM
handler. I'm not sure how to do this, but maybe to add at the start of the program something like this:
`def sigterm_handler(_signo, _stack_frame):
# close open vpn instances if they are connected.
sys.exit(0)
signal.signal(signal.SIGTERM, sigterm_handler)
signal.signal(signal.SIGKILL, sigterm_handler)`
p.s. and SIGKILL
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.