This project is an API server for managing WireGuard configurations, utilizing the Axum framework and interfacing directly with the WireGuard CLI. It provides a simple and efficient way to programmatically manipulate WireGuard settings, keys, and configurations. Whether you're automating VPN setup or managing multiple WireGuard instances, this server offers a powerful and flexible solution.
- API Management: Easily interact with WireGuard via RESTful API endpoints.
- Axum Framework: Built using the high-performance and ergonomic Axum web framework.
- WireGuard CLI Integration: Directly wraps and leverages the WireGuard command-line interface.
- Key Generation: Generate and manage public/private key pairs seamlessly.
- Configuration Handling: Create, update, and delete WireGuard configurations.
- Installed Rust and Cargo. If you don't have it installed, you can follow the instructions here.
- Installed and setup WireGuard or simply run setup scripts/setup_wireguard.sh.
- Specify .env file following the example .env.example.
cargo run
Yeah, that's it! The server will be running on
http://<AGENT_HOST>:<AGENT_PORT>
.
Setup github secrets following the table below:
Secret Name | Description |
---|---|
HELIOS_SSH | SSH private key for the remote server |
SSH_PORT | SSH port for the remote server |
SSH_USER | SSH user for the remote server |
SSH_HOST | IP address or hostname of the remote server |
- SSH into the remote server and create .env file following the example .env.example and add HELIOS_SSH public key.
- Run Server Setup script scripts/server_setupr.sh.
- Run binary
./agent-wireguard
.
run server setup script scripts/server_setup.sh on the remote server OR:
- Install Wireguard running the setup script scripts/setup_wireguard.sh.
- Allow firewall rules for the Agent Server
ufw allow <AGENT_PORT>
. - Download the latest release from the releases page.
- Specify .env file following the example .env.example.
- Unzip the release and run the binary
./agent-wireguard
.