/vpn-handler

The VPN Handler πŸ‘½ is an application for handling the built-in VPN in the macOS - auto connect, auto reconnect, multi-user macOS environment & VPN management.

Primary LanguagePythonMIT LicenseMIT

VPN Handler

Gitter Releases Downloads OS OS OS License

What is it? πŸ€”

The VPN Handler is an application for handling the built-in VPN in the macOS:

  • auto connect.
  • auto reconnect.
  • multi-user macOS environment & VPN management.

The specific user - is the user for which you want to use a specific VPN. For example, a workVPN must be enabled for a workUser, while for other users the workVPN must be disabled.

How to use? πŸ€“

  1. Download the latest release.
  2. Launch the application.
  3. Connect to the VPN.
  4. (Optional) enable automatic VPN connection when the application launches.
  5. (Optional) enable launch of the application on the macOS startup.

Notifications may depend on your "Notifications & Focus"1 Preferences.

your-pic-caption-name

White paper πŸ“ƒ

Use cases

  1. User can select the VPN and connect or disconnect to the VPN.
  2. User can select the VPN and enable or disable automatic VPN connection when the application launches.
  3. User can enable or disable launch of the application on the macOS startup.
  4. User can use multi-user macOS environment.

Requirements

  1. Tracks VPN connections:

    1. reconnect if the VPN connection is down.
    2. if the Internet connection is down, then wait until the Internet connection is established, then try to reconnect to the VPN.
    3. reconnection must be followed by the number of attempts, and each attempt must be delayed with increasing time.
  2. Supports multi-user macOS environment:

    1. keep active VPN connections for the selected user.
    2. disconnect from all selected VPNs when switching to another users.
    3. reconnect to all selected VPNs when switching to the selected user.
  3. Supports preferences:

    1. automatically connect to the preferred VPNs when the application launches.
    2. automatically launch or not launch the application on the macOS startup.
    3. preferences must be stored permanently.
  4. Tracks macOS Network Preferences:

    1. created VPN must be automatically added to the application.
    2. renamed VPN must be automatically detected in the application.
    3. deleted VPN must be automatically deleted from the application.
  5. Pushes macOS notifications:

    1. connect to the VPN:
      1. Connecting 🐾 πŸš€
      2. Connected πŸš€ 🟒
      3. Connection failed πŸš€ πŸ”΄
    2. reconnect to the VPN:
      1. Reconnecting 🐾 🎲
    3. disconnect from the VPN:
      1. Disconnecting 🐾 πŸ’£
      2. Disconnected πŸ’£ 🟒
      3. Disconnection failed πŸ’£ πŸ”΄
    4. internet connection is down:
      1. Interrupted 🐾 πŸ’₯
    5. VPN has been created or renamed:
      1. Detected new VPN 🐾 πŸ‘€
    6. VPN has been deleted or renamed:
      1. Removing VPN 🐾 ❌

Technologies πŸ’Ύ

Install & build πŸ‘Ύ

  1. Clone the repository:
git clone https://github.com/tsarenkotxt/vpn-handler.git
  1. Open the project:
cd vpn-handler
  1. Build and launch the application:
sh build_and_launch.sh

rumps and py2app must be pre-installed.

Known issues 🧐

The application is not signed2 and the following warning may appear on the first launch:

β€œVPN Handler.app” can’t be opened because Apple cannot check it for malicious software.

Workaround:

  1. Open preferences - navigate to:
"System Preferences" > "Security & Privacy" > "General"
  1. Grant access - click to:
"Open Anyway" 

Inspiration 🀠

Contribute 🀩

Have a look through existing Issues and Pull Requests that you could help with.
If you'd like to request a feature or report a bug, please create a GitHub Issue using one of the templates provided.

License πŸ“œ

The MIT License.

Footnotes

  1. Notifications & Focus Preferences ↩

  2. Signing a Mac Product & Gatekeeper ↩