A terminal UI for managing OpenVPN connections with 2FA support
Project description
vpnx
| Status | |
|---|---|
| CI checks | |
| Latest version | |
| Release date | |
| Python | |
| License | |
| Open issues |
A terminal UI for managing OpenVPN connections with 2FA support.
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:
- Adding VPN configurations (name, path to .ovpn file, up/down scripts)
- Setting your username (optional - will prompt at connection if not set)
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e42eb6a69ac49c12dc5a0982c331e4338ec7764bcb7b61fd328e3b172ecea9d8
|
|
| MD5 |
6f5446f4802b4f6df25dc392fb9db0da
|
|
| BLAKE2b-256 |
91ade5722dd95a4e60207b5c1f3dda4d5aa1d51772b0cb03dd9876868ac65384
|
Provenance
The following attestation bundles were made for vpnx-0.3.0.tar.gz:
Publisher:
ci.yml on pirhoo/vpnx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vpnx-0.3.0.tar.gz -
Subject digest:
e42eb6a69ac49c12dc5a0982c331e4338ec7764bcb7b61fd328e3b172ecea9d8 - Sigstore transparency entry: 1341994520
- Sigstore integration time:
-
Permalink:
pirhoo/vpnx@a969ad65339383d02e304b849e985ad9c17f889d -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/pirhoo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@a969ad65339383d02e304b849e985ad9c17f889d -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6eb58a61e7f72f8dc3dbef38b5bd2d6934795e334cd57eaa1d8c731219316f67
|
|
| MD5 |
7ecfb5998f933da5ac9b77afa1f9a7b3
|
|
| BLAKE2b-256 |
dc426c3a5a24123dd3bbf3eea6bce2af6975067b3c63de009bdae15873cff103
|
Provenance
The following attestation bundles were made for vpnx-0.3.0-py3-none-any.whl:
Publisher:
ci.yml on pirhoo/vpnx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vpnx-0.3.0-py3-none-any.whl -
Subject digest:
6eb58a61e7f72f8dc3dbef38b5bd2d6934795e334cd57eaa1d8c731219316f67 - Sigstore transparency entry: 1341994530
- Sigstore integration time:
-
Permalink:
pirhoo/vpnx@a969ad65339383d02e304b849e985ad9c17f889d -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/pirhoo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@a969ad65339383d02e304b849e985ad9c17f889d -
Trigger Event:
release
-
Statement type: