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.4.0.tar.gz (48.5 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.4.0-py3-none-any.whl (42.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for vpnx-0.4.0.tar.gz
Algorithm Hash digest
SHA256 7e043860fa58ab5df4c7922edc20c9853a284a53e2055481df8cd91e28f20ed4
MD5 17e6c8f11b2ef8d5c90dae79fa22d97c
BLAKE2b-256 ef4d65cbebd0c4f2a768ac8b15ef72a9510925765cd6ae2122edee125b73c740

See more details on using hashes here.

Provenance

The following attestation bundles were made for vpnx-0.4.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.4.0-py3-none-any.whl.

File metadata

  • Download URL: vpnx-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 42.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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6cfbc10bafda25bd4d91f77c24802d212aab47742b012a16701e0033b83ddad4
MD5 e13fbce2907808b2012a495d2d24e1a7
BLAKE2b-256 0a67077e41c7315ccb662271f7e60cd767316c1de759350ef4144ed774c95617

See more details on using hashes here.

Provenance

The following attestation bundles were made for vpnx-0.4.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