port LXC side to Alpine/OpenRC, add Proxmox host-side creator
- Replace systemd units with OpenRC init scripts (supervise-daemon) - Add wirecon-watchdog-loop.sh since OpenRC has no timers - Switch install.sh to apk + rc-update - Update bootstrap.sh to install git/bash via apk - New proxmox/create-lxc.sh: picks next VMID, downloads Alpine template, creates unprivileged LXC with tun passthrough, chains bootstrap - Rewrite README around the Proxmox one-liner flow
This commit is contained in:
1 parent
390e10b06d
commit
5b9abdae08
13 files changed
+290
-128
No files matched your search
@@ -1,35 +1,54 @@
|
||||
# wirecon
|
||||
|
||||
WireGuard tunnel between a **rootless-Docker** internet host and an **unprivileged LXC** on Proxmox, with Caddy reverse-proxying inbound traffic into the LXC's LAN. Tuned for flaky uplinks (Telekom DSL/LTE Hybrid) with a fast-reconnect watchdog and structured journald logging.
|
||||
WireGuard tunnel between a **rootless-Docker** internet host and an **unprivileged Alpine LXC** on Proxmox, with Caddy reverse-proxying inbound traffic into the LXC's LAN. Tuned for flaky uplinks (Telekom DSL/LTE Hybrid) with a fast-reconnect watchdog and structured logging.
|
||||
|
||||
```
|
||||
internet Telekom Hybrid (DSL+LTE)
|
||||
clients ──► Docker host ══════ wg0 (UDP 51820) ══════ LXC ──► 192.168.1.0/24
|
||||
(Caddy + (kernel WG +
|
||||
wireguard-go, watchdog +
|
||||
rootless) monitor)
|
||||
(Caddy + (Alpine + kernel WG
|
||||
wireguard-go, + OpenRC watchdog
|
||||
rootless) & monitor)
|
||||
```
|
||||
|
||||
## Install
|
||||
|
||||
### LXC side — one-liner
|
||||
### Proxmox side — one-liner (creates the LXC from scratch)
|
||||
|
||||
On a fresh unprivileged LXC (after you've added the tun passthrough from `proxmox/lxc.conf.snippet` and restarted the container):
|
||||
Run on the **Proxmox host** as root:
|
||||
|
||||
```
|
||||
curl -fsSL https://git.d4nn13.de/d4nn13/wirecon/raw/branch/main/proxmox/create-lxc.sh | bash
|
||||
```
|
||||
|
||||
Defaults: Alpine template (latest), hostname `concad`, 1 core, 256 MiB RAM, 2 GiB disk, DHCP on `vmbr0`, auto-picked VMID. The script creates the container, applies the `/dev/net/tun` passthrough, starts it, and chains into the in-LXC bootstrap which clones the repo and runs `lxc/install.sh`. Override defaults via env vars:
|
||||
|
||||
```
|
||||
HOSTNAME=tunbox MEMORY=512 STORAGE=fast-nvme \
|
||||
bash -c "$(curl -fsSL https://git.d4nn13.de/d4nn13/wirecon/raw/branch/main/proxmox/create-lxc.sh)"
|
||||
```
|
||||
|
||||
### LXC side only (if the container already exists)
|
||||
|
||||
Inside the unprivileged LXC as root:
|
||||
|
||||
```
|
||||
curl -fsSL https://git.d4nn13.de/d4nn13/wirecon/raw/branch/main/lxc/bootstrap.sh | sudo bash
|
||||
```
|
||||
|
||||
Then edit `/etc/wireguard/wg0.conf` (keys, endpoint, LAN iface in the `PostUp` rules), optionally tune `/etc/wirecon/wirecon.conf`, and:
|
||||
### Finishing up (either path)
|
||||
|
||||
Edit `/etc/wireguard/wg0.conf` (keys, endpoint, LAN iface in `PostUp`), optionally tune `/etc/wirecon/wirecon.conf`, then:
|
||||
|
||||
```
|
||||
systemctl enable --now wg-quick@wg0 wirecon-watchdog.timer wirecon-monitor.service
|
||||
journalctl -f -t wirecon-watchdog -t wirecon-monitor
|
||||
rc-update add wg-quick.wg0 default && rc-service wg-quick.wg0 start
|
||||
rc-update add wirecon-watchdog default && rc-service wirecon-watchdog start
|
||||
rc-update add wirecon-monitor default && rc-service wirecon-monitor start
|
||||
tail -F /var/log/wirecon-watchdog.log /var/log/wirecon-monitor.log
|
||||
```
|
||||
|
||||
### Docker side
|
||||
### Docker side (internet host)
|
||||
|
||||
On the internet host (rootless Docker daemon already running):
|
||||
Rootless Docker daemon already running:
|
||||
|
||||
```
|
||||
git clone https://git.d4nn13.de/d4nn13/wirecon.git
|
||||
@@ -43,23 +62,16 @@ Host prereqs:
|
||||
- `/dev/net/tun` readable by the rootless user
|
||||
- `sysctl net.ipv4.ip_unprivileged_port_start=80` if you want 80/443 bound directly
|
||||
|
||||
### Proxmox
|
||||
|
||||
Append `proxmox/lxc.conf.snippet` to `/etc/pve/lxc/<VMID>.conf`, then `pct stop/start <VMID>`.
|
||||
|
||||
## Layout
|
||||
|
||||
```
|
||||
docker/ rootless-Docker stack: wg (wireguard-go) + Caddy sharing netns
|
||||
lxc/ installer, systemd units, watchdog/monitor/MTU-probe scripts
|
||||
proxmox/ tun passthrough snippet for unprivileged LXC
|
||||
lxc/ Alpine installer, OpenRC services, watchdog/monitor/MTU-probe
|
||||
proxmox/ host-side LXC creator + tun-passthrough snippet
|
||||
```
|
||||
|
||||
## Tuning
|
||||
|
||||
- **MTU** — default `1280`. Run `wirecon-mtu-probe.sh` on the LXC to find the real path MTU and update `MTU =` on both peers.
|
||||
- **Watchdog** thresholds (`/etc/wirecon/wirecon.conf`): handshake-age, ping loss, and consecutive-failure streak before a forced `wg-quick down/up`.
|
||||
- **Logs** — everything is structured `key=value` on journald:
|
||||
```
|
||||
journalctl -u wirecon-watchdog.service -u wirecon-monitor.service --since "1 hour ago"
|
||||
```
|
||||
- **MTU** — default `1280`. Run `/usr/local/bin/wirecon-mtu-probe.sh` inside the LXC to find the real path MTU; update `MTU =` on both peers.
|
||||
- **Watchdog** (`/etc/wirecon/wirecon.conf`): `HANDSHAKE_MAX_AGE`, `PING_LOSS_THRESHOLD`, `FAIL_STREAK_THRESHOLD`, `WATCHDOG_INTERVAL`.
|
||||
- **Logs** — structured `key=value` lines in `/var/log/wirecon-*.log`; grep-friendly.
|
||||
Reference in new issue
Block a user