Web & API based configuration management for WireGuard VPN.
- GoLang Server
- WebUI using Vue.js
- Edit .env file for the required setup (See below for Template)
- Install Dependencies - Go & Vue.js
- If wireguard configuration already exists - create the file server.json with required changes
- Allow the required system port on the firewall
- Create the path file
[Unit] Description=Watch /etc/wireguard for changes
[Path] PathModified=/etc/wireguard
[Install] WantedBy=multi-user.target
- Create the service file
[Unit] Description=WireGuard directory watcher After=network.target
[Service] Type=oneshot ExecStart=/bin/systemctl restart [email protected]
[Install] WantedBy=multi-user.target
Finally Run:
-
sudo systemctl daemon-reload
-
sudo systemctl enable wg-watcher.path && sudo systemctl start wg-watcher.path
Created symlink /etc/systemd/system/multi-user.target.wants/wg-watcher.path → /etc/systemd/system/wg-watcher.path.
- sudo systemctl enable wg-watcher.service && sudo systemctl start wg-watcher.service
Created symlink /etc/systemd/system/multi-user.target.wants/wg-watcher.service → /etc/systemd/system/wg-watcher.service.
-
sudo systemctl status wg-watcher.path
-
sudo systemctl status wg-watcher.service
SERVER=0.0.0.0 PORT=9080 GIN_MODE=debug #debug or release
WG_CONF_DIR=/etc/wireguard WG_KEYS_DIR=/etc/wireguard/keys WG_INTERFACE_NAME=wg0.conf WG_DOMAIN=: #zone.mydomain.com:51820
SMTP_HOST=smtp.email.com SMTP_PORT=465 SMTP_USERNAME=[email protected] SMTP_PASSWORD="email-password" SMTP_FROM="My Domain [email protected]"