Jump to content
Not connected, Your IP: 34.234.207.100
hemulin

Airvpn inside SSL tunnel "toggler" for Linux [Github project]

Recommended Posts

Hi guys,
 

I've subscribed to the Airvpn service about 4 months ago and I'm very happy with it.
Nevertheless, as a Linux user (currently Lubuntu 16.04) which isn't using the client option, it was becoming somewhat annoying to turn on and turn off the openvpn and the stunnel in different terminals every time.

Few days ago I sat and wrote a small CLI script in python, that is automating the process of connecting and disconnecting to the Airvpn service.

 

The script can be found here:
https://github.com/hemulin/airvpn_toggler

 

Simply put, what it does is:

 

When turning on - 
1) Scanning the configs files folder and asking you from which country you wish to exit

2) After you choose a country, it turns on the stunnel as a background process and waiting for it to finish the initialization

3) After the stunnel init has finished, it turns on the openvpn as a background process and waiting for it to finish init.

4) After the openvpn has finished its init, the script validates that the external IP has changed and if yes, adding a system tray indicator to show it is connected.

 

When turning off - 

1) Killing the system tray indicator, the openvpn and the stunnel processes.

2) Validating that the external IP has changed.

 

Currently it is working well for me, but I still consider it to be a "work in progress", so (1) I still improves it and (2) Feel free to ask for features (and of course, forks and pull requests are welcome).

 

 

Cheers,
Hemulin

Share this post


Link to post

Hey

Thanks... sounds pretty cool

I'm going to try it out Arch Linux - Gnome 3.20.2

I'll report back.

Share this post


Link to post

I like the thinking that you've put into this, but I'm afraid I'm a bit of a "monkey see, monkey do" kind of learner, but hey it works albeit slowly.   I am running OpenSUSE Leap 42.1and following your instructions precisely, I've successfully gotten to the point where I am to install the requirements.txt file and this is what I get, and I don't understand it.  Hoping you can advise.

 

linux-lnew:/home/nullvier/AirVPN # pip install -r requirements.txt
Collecting pkg-resources==0.0.0 (from -r requirements.txt (line 1))
  Could not find a version that satisfies the requirement pkg-resources==0.0.0 (from -r requirements.txt (line 1)) (from versions: )
No matching distribution found for pkg-resources==0.0.0 (from -r requirements.txt (line 1))

linux-lnew:/home/nullvier/AirVPN #

                                     

Share this post


Link to post

Odd... Lubuntu 16.04 here as well and no issue(s) whatsoever with the Eddie client...


"I don't see myself as a hero because what I'm doing is self-interested: I don't want to live in a world where there's no privacy and therefore no room for intellectual exploration and creativity." - Edward Snowden

"The Internet is by the people, for the people." - Kim Dotcom

Share this post


Link to post

@Dosenfleisch,
I would answer later more in details but apparently you've stumbled onto an existing issue with pip on the *buntu 16.04 distros.
(see here unanswered question regarding the same issue, or here for perhaps related problem with solution).

Long story short, when you issue 

pip install -r requirements.txt

you're asking pip (python package manager) to install all the modules in the requirements.txt file.

The error you receive is because pip fails to find candidates for installing the pkg-resources,  version 0.0.0 module.

You can either try to solve it by yourself by going over the few needed modules in the requirements.txt file (not very critical but pay attention that I've updated the repository and removed the tqdm module dependency), and installing them manually (sudo pip install <module_name_here>).

Also, given that it is not really clear why the pkg-resources is there in this form to begin with, you can try playing with it and remove it from the requirements and see if its playing well without it.

Alternatively, wait a few days and I will test it on different env. to see if and where problems exists.

Thanks for trying it out, I'll come back with answers soon
Cheers,
Hemulin

p.s
could you please open an issue on the github repository page so others that face the same issue would see the discussion?

Share this post


Link to post

 

p.s

could you please open an issue on the github repository page so others that face the same issue would see the discussion?

 Thanks for the response.  I tried some of your suggestions, yet I still am following your lead here.  I opened the issue on your repo page as you requested.  Thanks.

Share this post


Link to post

[copy from the github discussion]


Apparently putting system tray indicator is not such an easy tasks (TK/GTK/QT/winico each library and its drawbacks).


Made a few changes. The minimal operation without the sys tray indicator should work without any external libraries (no need for pip install -r requirements.txt). If you do wish to have the sys tray, until I would find the solution that fits them all, you should install the wx library (wxPython) and then run the script with the optional parameter "show" in addition to "on" or "off".


The above paragraph also relevant to the problem you were facing with the pkg-resource. Now when there is no need to the "pip install... " command, you should be fine.


Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Security Check
    Play CAPTCHA Audio
    Refresh Image

×
×
  • Create New...