Skip to main content

A terminal UI for managing OpenVPN connections with 2FA support

Project description

vpnx

Status
CI checks CI
Latest version PyPI
Release date Release date
Python Python
License License
Open issues Open issues

A terminal UI for managing OpenVPN connections with 2FA support.

README

Features

  • Interactive setup wizard for configuring multiple VPNs
  • Full-screen TUI with real-time connection status and bandwidth monitoring
  • Secure credential storage using GPG encryption
  • Support for up scripts (DNS/routing configuration)
  • XDG Base Directory compliant configuration

Requirements

  • Python 3.8+
  • openvpn
  • gpg (for encrypted password storage)
# macOS
brew install openvpn gnupg

# Debian/Ubuntu
sudo apt install openvpn gnupg

# Fedora
sudo dnf install openvpn gnupg2

# Arch
sudo pacman -S openvpn gnupg

Installation

Using pipx (recommended):

pipx install vpnx

Or with pip:

pip install vpnx

Setup

vpnx setup

The setup wizard will guide you through:

  1. Adding VPN configurations (name, path to .ovpn file, up/down scripts)
  2. Setting your username (optional - will prompt at connection if not set)
  3. Configuring the password store (GPG key for secure credential storage)

Usage

# Connect to all configured VPNs
vpnx all

# Connect to a specific VPN
vpnx connect <vpn-name>

# List configured VPNs
vpnx list

Configuration

Configuration is stored in XDG-compliant directories:

~/.config/vpnx/
├── config.yaml        # Main configuration
└── up.sh              # Optional default up script

~/.local/share/vpnx/
├── credentials.gpg    # GPG-encrypted password
└── credentials.gpg-id # GPG key ID

~/.cache/vpnx/
└── logs/              # Connection logs

config.yaml format

username: your-username                            # optional, will prompt if not set
credentials_path: ~/.local/share/vpnx/credentials  # path to GPG-encrypted password
up_script: /path/to/up.sh                          # optional, global up script
down_script: /path/to/down.sh                      # optional, global down script

vpns:
  - name: PROD
    display: Production VPN
    config_path: /path/to/prod.ovpn
    needs_up_script: true
    up_script: /path/to/prod-up.sh      # optional, per-VPN override
    needs_down_script: true
    down_script: /path/to/prod-down.sh  # optional, per-VPN override
    needs_2fa: true                     # default: true
  - name: DEV
    display: Development VPN
    config_path: /path/to/dev.ovpn
    needs_up_script: false
    needs_down_script: false
    needs_2fa: false

Build from source

git clone https://github.com/pirhoo/vpnx.git
cd vpnx
pip install -e ".[dev]"

Then use make targets to run the project and development tasks:

make setup          # Configure VPN client
make all            # Connect to all configured VPNs
make connect VPN=x  # Connect to a specific VPN
make list           # List configured VPNs

make test           # Run tests
make lint           # Check code style
make format         # Auto-format code
make clean          # Remove cache files

Project Structure

├── vpnx/
│   ├── domain/          # Business logic (entities, services)
│   ├── application/     # Use cases (commands, handlers)
│   ├── infrastructure/  # External integrations (OpenVPN, GPG)
│   └── presentation/    # UI components (TUI, CLI)
└── tests/               # Unit tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vpnx-0.3.0.tar.gz (46.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vpnx-0.3.0-py3-none-any.whl (41.0 kB view details)

Uploaded Python 3

File details

Details for the file vpnx-0.3.0.tar.gz.

File metadata

  • Download URL: vpnx-0.3.0.tar.gz
  • Upload date:
  • Size: 46.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vpnx-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e42eb6a69ac49c12dc5a0982c331e4338ec7764bcb7b61fd328e3b172ecea9d8
MD5 6f5446f4802b4f6df25dc392fb9db0da
BLAKE2b-256 91ade5722dd95a4e60207b5c1f3dda4d5aa1d51772b0cb03dd9876868ac65384

See more details on using hashes here.

Provenance

The following attestation bundles were made for vpnx-0.3.0.tar.gz:

Publisher: ci.yml on pirhoo/vpnx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vpnx-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: vpnx-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 41.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vpnx-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6eb58a61e7f72f8dc3dbef38b5bd2d6934795e334cd57eaa1d8c731219316f67
MD5 7ecfb5998f933da5ac9b77afa1f9a7b3
BLAKE2b-256 dc426c3a5a24123dd3bbf3eea6bce2af6975067b3c63de009bdae15873cff103

See more details on using hashes here.

Provenance

The following attestation bundles were made for vpnx-0.3.0-py3-none-any.whl:

Publisher: ci.yml on pirhoo/vpnx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page