* VPN: read only the VPN files the Controller writes
controller.yaml's vpn.config_file and vpn.auth_file were joined to the
config directory as-is. The tunnel runs as root, so an absolute or ../
path would have it read (and send to the VPN server) any file, and the
Controller API would return any file's text as the VPN config.
Both now accept only vpn/wireguard.conf, vpn/openvpn.ovpn, and
vpn/openvpn-auth.txt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* VPN: refuse a VPN file which links outside the vpn directory
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* VPN: read each VPN file once, never through a symlink
The check resolved the path, then the file was opened again later: by
root OpenVPN for the login (--auth-nocache re-reads it). The wrolpi user,
who owns the library, could swap the file for a symlink in between.
read_vpn_file() opens with O_NOFOLLOW and reads once. OpenVPN gets a
0600 copy of the login in the run directory, removed when the tunnel
goes down.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Torrents reach the Internet only through a fail-closed VPN (WireGuard or
OpenVPN, any provider), so peers never see a WROLPi's own address.
- A network namespace (Pi/Debian) or the vpn container (Docker) with an
nftables kill switch; NAT-PMP or fixed port forwarding.
- qBittorrent inside it, sandboxed; torrents kept in config/torrents/.
- Torrent download form, Torrents page, Share as torrent, nav warning, and
VPN settings in both Controller UIs.
- Help docs: Torrents, and The VPN for Torrents.
QA'd on a Raspberry Pi with a real provider over WireGuard and OpenVPN.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>