Skip to content

bnsmcx/yvpn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

103 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yVPN

A terminal user interface (TUI) application for managing VPN exit nodes on a Tailscale network using DigitalOcean droplets.

Overview

yVPN simplifies the creation and management of distributed VPN exit nodes. It provisions DigitalOcean droplets preconfigured as Tailscale exit nodes, giving you on-demand VPN endpoints in various geographic locations.

Features

  • Interactive TUI - Clean terminal interface with keyboard navigation
  • Scriptable CLI - JSON output for automation and scripting
  • One-click provisioning - Create exit nodes in any DigitalOcean datacenter
  • Automated setup - Droplets are fully configured via cloud-init (Tailscale installation, IP forwarding, NAT rules)
  • SSH access - Run as an SSH server for remote management without local installation
  • Exit node management - View, create, and delete exit nodes from a unified dashboard

Prerequisites

  • DigitalOcean API token (with read/write access)
  • Tailscale API key

Installation

From GitHub Releases

Download the latest binary for your platform from the Releases page.

# Linux
curl -LO https://github.com/bnsmcx/yvpn/releases/latest/download/yvpn-linux-amd64
chmod +x yvpn-linux-amd64
sudo mv yvpn-linux-amd64 /usr/local/bin/yvpn

# macOS (Apple Silicon)
curl -LO https://github.com/bnsmcx/yvpn/releases/latest/download/yvpn-darwin-arm64
chmod +x yvpn-darwin-arm64
sudo mv yvpn-darwin-arm64 /usr/local/bin/yvpn

# macOS (Intel)
curl -LO https://github.com/bnsmcx/yvpn/releases/latest/download/yvpn-darwin-amd64
chmod +x yvpn-darwin-amd64
sudo mv yvpn-darwin-amd64 /usr/local/bin/yvpn

From Source

git clone https://github.com/bnsmcx/yvpn.git
cd yvpn
go build -o yvpn ./cmd/tui

Requires Go 1.21+.

Configuration

Set your credentials as environment variables:

export DIGITAL_OCEAN_TOKEN=<your_digitalocean_token>
export TAILSCALE_API=<your_tailscale_api_key>

Usage

Interactive TUI

yvpn tui

If credentials aren't set, you'll be prompted to enter them on startup.

CLI Commands

# List existing exit nodes
yvpn list

# List available datacenters
yvpn datacenters

# Create a new exit node
yvpn create nyc1

# Delete an exit node by ID
yvpn delete 12345

# JSON output for scripting
yvpn list --json
yvpn datacenters --json
yvpn create nyc1 --json

# Show version
yvpn --version

SSH Server Mode

Run yVPN as an SSH server for remote access:

yvpn ssh

This starts an SSH server on port 1337. Connect with:

ssh -p 1337 user@hostname

Pass credentials via SSH environment variables.

TUI Keyboard Controls

Key Action
n Create new exit node
d Delete selected exit node
↑/↓ Navigate list
Enter Confirm selection
Esc Go back / Cancel
q Quit

How It Works

  1. Create: Select a DigitalOcean datacenter. yVPN generates a temporary Tailscale auth key, provisions a droplet with cloud-init configuration, and waits for the node to appear on your tailnet.

  2. Configure: The droplet automatically installs Tailscale, enables IP forwarding, configures iptables rules, and advertises itself as an exit node.

  3. Enable: Once the droplet joins your tailnet, yVPN enables it as an exit node via the Tailscale API.

  4. Use: Connect to your new exit node from any device on your tailnet.

Project Structure

yvpn/
├── cmd/
│   └── tui/           # Main application
│       ├── main.go    # Entry point, SSH server
│       ├── cli.go     # CLI commands
│       ├── dash.go    # Dashboard view
│       ├── add.go     # Create exit node screen
│       ├── delete.go  # Delete exit node screen
│       ├── onboard.go # Credential input
│       └── style.go   # UI styling
├── pkg/
│   ├── digital_ocean/ # DigitalOcean API wrapper
│   └── tailscale/     # Tailscale API wrapper
├── Dockerfile
├── go.mod
└── shell.nix          # Nix development environment

Development

Using Nix

nix-shell

This provides Go, Git, gopls, and development tools.

Droplet Specifications

Exit nodes are created with:

  • OS: Ubuntu 24.04 x64
  • Size: s-1vcpu-1gb (1 vCPU, 1GB RAM)
  • Tag: yVPN

Dependencies

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A tool for creating Tailscale exit nodes in Digital Ocean.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors