Giter Site home page Giter Site logo

deanishe / alfred-vpn-manager Goto Github PK

View Code? Open in Web Editor NEW
152.0 9.0 15.0 3.15 MB

Manage Tunnelblick & Viscosity VPN connections from Alfred

License: Other

Shell 0.17% Python 97.11% AppleScript 0.79% JavaScript 1.92%
alfred alfred-workflow viscosity vpn-manager openvpn-client tunnelblick openvpn macos alfred-3 alfred-viscosity

alfred-vpn-manager's Introduction

Alfred VPN Manager

Manage your Tunnelblick and Viscosity VPN connections from Alfred.

Note: Version 2 requires Alfred 3.

Alfred-Viscosity in action

Contents

Installation

Download the VPN-Manager-X.X.X.alfred3workflow file from GitHub releases and double-click the file to import it into Alfred.

Usage

  • vpn [<query>] — View and filter Viscosity VPN connections.
    • — Connect/disconnect selected connection.
  • vpnconf [<query>] — View and edit workflow configuration.
    • Workflow Update Available! / Workflow Is up to Date — Workflow update availablity.
      • or — Check for and install update.
    • App Name (active) — The currently selected VPN application.
    • App Name (not installed) — Supported, but not installed, VPN application.
      • — Go to this application's website.
    • App Name — Installed, but unused, application.
      • — Use this application to manage VPN connections.
    • Online Docs — This README.
      • — Open in your default browser.
    • Get Help — Workflow's thread on AlfredForum.com.
      • — Open in your default browser.
    • Report Problem — Workflow's GitHub issues.
      • — Open in your default browser.

If you haven't entered a query, any active VPN connections will be shown at the top of the list. Action an active connection to disconnect it.

If you are connected to multiple VPNs, an additional "Disconnect All" item will be shown first.

Supported apps

The workflow currently supports Tunnelblick and Viscosity, which both manage OpenVPN connections.

Essentially, the functionality of both applications is the same. Tunnelblick is open source and free, while Viscosity is proprietary and cheap, but has a more pleasant user interface.

What's a VPN for, anyway?

To prevent people (geo)blocking and/or spying on you.

  • So other people on the same unsecured WiFi network (or the operator) can't monitor your traffic
  • To access services that are blocked on the network you're using. For example, some of the corporate networks I've used have blocked IMAP(S), so I couldn't check my email, or the iOS App Store
  • To access content censored by your ISP or government
  • To access services that geo-block your current location

VPN providers

If you don't have a VPN service yet, here are the two I personally use:

Private Internet Access for high-bandwidth stuff, like trying to watch online videos that GEMA has blocked in Germany. The service is fast and reliable, and they don't log your traffic. They regularly top Torrent Freak's best VPN provider chart.

A self-hosted Streisand installation for punching through locked-down corporate firewalls that don't think I should be able to check my email. It's very simple to set up, and gives you a lot of options for connecting.

Licence & thanks

This workflow is licensed under the MIT Licence.

It is based on the Alfred-Workflow library (also MIT-licensed) and the icons are from Font Awesome (SIL OFL Licence).

alfred-vpn-manager's People

Contributors

deanishe avatar muescha avatar phinze 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

alfred-vpn-manager's Issues

Issue with app selection

F00E-423F-8AD2-90260BC58C87/workflow/workflow.py", line 2067, in run
    func(self)
  File "./vpn.py", line 534, in main
    return do_config(args.get('<query>'))
  File "./vpn.py", line 342, in do_config
    icon=app.info.path,
AttributeError: 'NoneType' object has no attribute 'path'

Fixed naively by commenting all info.paths since I didn't quite care about the icon, just wanted to select Tunnelblick.

Add support for Wireguard

Wireguard is pretty much the best, fastest and most secure way to connect to a remote network. Would it be possible to add support for it? It'd be truly amazing to be able to manage all my VPNs in one place.

Application "Tunnelblick" is not installed

Lately I've been unable to use this workflow. It was working fine before, but now everytime I try to run it I get the error Application "Tunnelblick" is not installed.

  • Tunnelblick 3.8.2a (build 5481)
  • Alfred 4.0.5 [1118]

Workflow alfred-viscosity slowing down macbook 12 on sierra 10.12.4 - more than 100% CPU ressources due to python

Hello,

I want to report you that your workflow is slowing down my computer since the upgrade to 10.12.4
When I looked at Activity monitor, it says that python has an impact of 90% (it can be more than 100%).
I am running alfred 3.3.1[806] on a macbook 12 retina with sierra 10.12.4 16E195.

Alfred-viscosity appears in python process : (see capture attached)

pastedgraphic-1

Attached is a sample of python.

Sample of Python.txt

Hope it will help you to find out.

Regards

Spaces in VPN connection name not handled

Hello,

It appears that spaces in the VPN connection name are not handled correctly. I tried adding quotations around the "%1" in Alfred, but that appears to break connect / disconnect feature completely. I have no Python skills unfortunately to assist, but maybe you can help me figure out a resolution. Thank you for this workflow!

Error in workflow

Getting a strange error and I'm not sure what to check here.
The following is the output I'm getting from the debug log for the workflow. Any advice would be appreciated!

[2018-07-16 23:40:57][input.scriptfilter] Queuing argument ''
[2018-07-16 23:40:57][input.scriptfilter] Script with argument '' finished
[2018-07-16 23:40:57][ERROR: input.scriptfilter] Code 1: .
23:40:57 workflow.py:2055 DEBUG    ---------- VPN Manager (3.0.2) ----------
23:40:57 workflow.py:1462 DEBUG    reading settings from /Users/USER/Library/Application Support/Alfred 3/Workflow Data/net.deanishe.alfred.vpn.manager/settings.json
23:40:57 workflow.py:2339 DEBUG    update check not due
23:40:57 vpn.py:523 DEBUG    args : {'--all': False,
 '--help': False,
 '<name>': None,
 '<query>': u'',
 'conf': False,
 'connect': False,
 'disconnect': False,
 'list': True}
23:40:57 workflow.py:2074 ERROR    Command '['mdls', '-raw', '-name', 'kMDItemCFBundleIdentifier', '/Applications/Tunnelblick.app\n/Library/StagedExtensions/Applications/Tunnelblick.app']' returned non-zero exit status 1
Traceback (most recent call last):
  File "/Users/USER/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.B13B074F-5DEE-44AB-BEAF-5BB14CF5D519/workflow/workflow.py", line 2067, in run
    func(self)
  File "./vpn.py", line 526, in main
    return do_list(args.get('<query>'))
  File "./vpn.py", line 418, in do_list
    app = get_app()
  File "./vpn.py", line 275, in get_app
    if not app.installed:
  File "./vpn.py", line 126, in installed
    return self.info is not None
  File "./vpn.py", line 119, in info
    self._info = appinfo(self.name)
  File "/Users/USER/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.B13B074F-5DEE-44AB-BEAF-5BB14CF5D519/workflow/util.py", line 251, in appinfo
    bid = run_command(cmd).strip()
  File "/Users/USER/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.B13B074F-5DEE-44AB-BEAF-5BB14CF5D519/workflow/util.py", line 150, in run_command
    return subprocess.check_output(cmd, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command '['mdls', '-raw', '-name', 'kMDItemCFBundleIdentifier', '/Applications/Tunnelblick.app\n/Library/StagedExtensions/Applications/Tunnelblick.app']' returned non-zero exit status 1
23:40:57 workflow.py:2097 DEBUG    ---------- finished in 0.086s ----------
[2018-07-16 23:40:57][input.scriptfilter] {"items": [{"valid": false, "subtitle": "Command '['mdls', '-raw', '-name', 'kMDItemCFBundleIdentifier', '/Applications/Tunnelblick.app\\n/Library/StagedExtensions/Applications/Tunnelblick.app']' returned non-zero exit status 1", "icon": {"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"}, "title": "Error in workflow 'VPN Manager'"}]}

vpn configuration should be always the last option

the option vpn configuration should be always the last option

i have connection1 and connection2

if i type vpn then when disconneted the order is:

  1. connection1
  2. vpn configuration
  3. connection2

if i type vpn then when conneted the order is:

  1. vpn configuration
  2. connection1
  3. connection2

i expect always:

  1. connection1
  2. connection2
  3. vpn configuration

Please support native VPNs from network preferences

This is a fantastic workflow!

I'm a heavy user of VPNs, so I'm desperately want this workflow to manage all my VPN softwares and the VPN configured natively in the macOS.

Could you also add support to that?

Thanks!

Doesn't recognize that I have Tunnelblick installed

When I try to run the workflow I get a message that: Application "Viscosity" is not installed. I'm actually just interested in managing Tunnelblick, but that doesn't seem to be an option.

image

image

[2018-01-22 16:13:39][STDERR: input.scriptfilter] .
16:13:39 workflow.py:2055 DEBUG    ---------- VPN Manager (3.0.1) ----------
16:13:39 workflow.py:1462 DEBUG    reading settings from /Users/olaf/Library/Application Support/Alfred 3/Workflow Data/net.deanishe.alfred.vpn.manager/settings.json
16:13:39 workflow.py:2339 DEBUG    update check not due
16:13:39 vpn.py:523 DEBUG    args : {'--all': False,
 '--help': False,
 '<name>': None,
 '<query>': u'',
 'conf': False,
 'connect': False,
 'disconnect': False,
 'list': True}
16:13:39 vpn.py:120 DEBUG    appinfo=None
16:13:39 workflow.py:2248 DEBUG    set last run version: 3.0.1
16:13:39 workflow.py:2097 DEBUG    ---------- finished in 0.058s ----------
{
  "__workflow_last_version": "3.0.1"
}

Update icon never hides

Hi @deanishe. First of all thanks for the great job done

I've discovered an issue lately. The «Update Available» icon never hides even though I did upgrade to the latest version manually

[2017-08-18 16:41:43][STDERR: input.scriptfilter] 16:41:43 workflow.py:2249 DEBUG    workflow version: 2.0.2
16:41:43 workflow.py:1657 DEBUG    reading settings from /Users/pavelbirukov/Library/Application Support/Alfred 3/Workflow Data/net.deanishe.alfred-viscosity/settings.json
16:41:43 workflow.py:2532 DEBUG    Update check not due
16:41:43 viscosity.py:210 DEBUG    args : {'--all': False,
 '--help': False,
 '<name>': None,
 '<query>': u'',
 'connect': False,
 'disconnect': False,
 'list': True}
16:41:43 workflow.py:2954 DEBUG    Deleted : u'/Users/pavelbirukov/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/net.deanishe.alfred-viscosity/_wfsess-9e32015ea619431a854577daff8008b5-connections.cpickle'
16:41:43 viscosity.py:61 DEBUG    Script : u'/Users/pavelbirukov/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.8DC6EAA5-2338-4EA5-BC69-F253EFF437B8/scripts/get_connections.scpt'
16:41:43 viscosity.py:62 DEBUG    Output : u'...
16:41:43 viscosity.py:85 INFO     VPN(...
16:41:43 viscosity.py:85 INFO     VPN(...
16:41:43 viscosity.py:85 INFO     VPN(...
16:41:43 viscosity.py:85 INFO     VPN(...
16:41:43 workflow.py:1919 DEBUG    cached data: /Users/pavelbirukov/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/net.deanishe.alfred-viscosity/_wfsess-1b082fbb229c4d01861a3b085d0a503b-connections.cpickle
16:41:43 workflow.py:1884 DEBUG    loading cached data: /Users/pavelbirukov/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/net.deanishe.alfred-viscosity/__workflow_update_status.cpickle
16:41:43 workflow.py:2462 DEBUG    update_data: {u'available': True, u'version': u'v2.0.2', u'download_url': u'https://github.com/deanishe/alfred-viscosity/releases/download/v2.0.2/Viscosity-2.0.2.alfred3workflow'}
16:41:43 workflow.py:2441 DEBUG    set last run version: 2.0.2
16:41:43 workflow.py:2290 DEBUG    workflow finished in 0.124 seconds

As you can see in first line I do have 2.0.2 and it prompts me to upgrade to 2.0.2.

Do you need additional data? Will you be able to fix it?

If you know where is the problem and don't have time to fix it, please give me a hint and I'll try to prepare a PR

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.