3.0 KiB
Litoral Regas VPN Orchestrator
A dark-themed Tauri desktop technician app for provisioning Litoral_Regas OpenWrt WireGuard production routers.
Production baseline
The app is structured around the validated router baseline:
- OpenWrt 23.05 only
- ZBT-WE826 16M target firmware
- fw4/nftables only
- no
opkg upgrade - LAN subnet:
198.51.100.0/24 - Router LAN IP:
198.51.100.1 - Controller IP:
198.51.100.10 - PLC IP:
198.51.100.50 - Overlay route:
198.19.0.0/16 - Router password:
litoralr - Hostname format:
Litoral_Regas_XXX - LuCI over WireGuard
- VPN firewall zone and DNAT rules:
- router WG IP
:5900->198.51.100.10:5900 - router WG IP
:20248->198.51.100.10:20249 - router WG IP
:8000->198.51.100.10:8000 - router WG IP
:81->198.51.100.50:81
- router WG IP
Install
npm install
npm install lucide-react recharts clsx tailwind-merge
npm install -D tailwindcss postcss autoprefixer
Development
npm run tauri:dev
Equivalent bootstrap command sequence:
npm create tauri-app@latest lr-openwrt-tool
# choose React, TypeScript, npm
cd lr-openwrt-tool
npm install
npm run tauri:dev
Build
npm run tauri:build
Backend assumptions
Development defaults are stored in app settings, not hardcoded as production secrets:
- Base URL:
http://localhost:8080 - Header:
X-API-Key: dev-api-key
Implemented API client calls:
GET /api/vpn/available-ipGET /api/vpn/used-ipsPOST /api/vpn/peersGET /api/vps/healthPOST /api/vps/wireguard/rollback-last-backup
Provisioning flow
The provisioning wizard models the technician workflow as a state machine:
IDLEDETECT_ROUTERUPLOAD_FIRMWAREFLASHINGWAITING_FOR_REBOOTWAITING_FOR_RECONNECTUPLOAD_PROVISIONING_BUNDLERUN_PROVISIONINGCAPTURE_PUBLIC_KEYREGISTER_PEERVERIFYCOMPLETEERROR
New router flow:
- Detect router at
192.168.1.1. - Request next available VPN IP from the backend.
- Generate
router.envusing the production baseline. - Upload firmware, flash router, and wait for SSH at
198.51.100.1. - Upload
router.envandprovision.sh. - Run provisioning.
- Capture WireGuard public key.
- Register peer with
POST /api/vpn/peers. - Verify final router state.
Reprovision flow keeps the selected existing VPN IP and replaces the public key through the same POST /api/vpn/peers endpoint.
Current Tauri command status
The following commands are implemented as mock placeholders with production-ready signatures:
detect_router(ip)upload_firmware(ip, firmwarePath)flash_router(ip, remoteFirmwarePath)wait_for_ssh(ip)upload_provisioning_bundle(ip, envContent, scriptContent)run_provisioning(ip)capture_wireguard_public_key(ip)verify_router(ip)
Future work should replace the mock bodies with real SSH/SCP/sysupgrade logic and explicitly call remove_known_host before reconnect attempts for 192.168.1.1 and 198.51.100.1.