wrolpi/controller
lrnselfreliance b1334c834b
VPN: read only the VPN files the Controller writes (#1037)
* 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>
2026-11-30 15:05:37 -07:00
..
api Torrents over a fail-closed VPN (#1026) 2026-11-28 14:26:24 -07:00
lib VPN: read only the VPN files the Controller writes (#1037) 2026-11-30 15:05:37 -07:00
templates Torrents over a fail-closed VPN (#1026) 2026-11-28 14:26:24 -07:00
test VPN: read only the VPN files the Controller writes (#1037) 2026-11-30 15:05:37 -07:00
vpn VPN: read only the VPN files the Controller writes (#1037) 2026-11-30 15:05:37 -07:00
__init__.py Creating Controller service which will control WROLPi services, admin, SMART, disks, and status. nginx will fallback to Controller UI when React UI is unavailable (such as during upgrades). 2025-12-15 15:48:40 -07:00
conftest.py Torrents over a fail-closed VPN (#1026) 2026-11-28 14:26:24 -07:00
defaults.py Torrents over a fail-closed VPN (#1026) 2026-11-28 14:26:24 -07:00
main.py Torrents over a fail-closed VPN (#1026) 2026-11-28 14:26:24 -07:00
requirements.lock Python packages install from hash-locked requirements; yt-dlp still floats (#913) 2026-11-01 12:00:39 -07:00
requirements.txt build(deps): update pytest-asyncio requirement in /controller (#926) 2026-11-02 12:05:36 -07:00
rsyncd.conf Torrents over a fail-closed VPN (#1026) 2026-11-28 14:26:24 -07:00
serve.py Migrating Controller from port 8087 to 80 so that it is more discoverable. Reformatting Controller dashboard to make header at the top. Reformatting navigation bar to handle the new links which prevented Admin from being visible in some screens. 2026-04-09 15:01:05 -06:00