wrolpi/controller/test
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
..
__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
test_admin.py The hotspot starts on boot (#829) 2026-10-13 19:29:15 -06:00
test_admin_api.py Hotspot captive portal: welcome page with the WROLPi's address (#709) 2026-09-13 20:10:02 -06:00
test_api.py Controller: link to the main UI on :8443 for Docker installs (#1029) 2026-11-28 12:49:43 -07:00
test_captive_portal.py Hotspot captive portal: welcome page with the WROLPi's address (#709) 2026-09-13 20:10:02 -06:00
test_config.py Controller: hide Root CA download until drive is ready 2026-07-18 13:44:35 -06:00
test_defaults.py Torrents over a fail-closed VPN (#1026) 2026-11-28 14:26:24 -07:00
test_disks.py The drive wizard never offers an EFI system partition (#833) 2026-10-14 16:26:18 -06:00
test_disks_api.py controller: don't strand the API stopped on a failed primary unmount 2026-07-23 19:23:05 -06:00
test_docker_services.py Torrents over a fail-closed VPN (#1026) 2026-11-28 14:26:24 -07:00
test_fstab.py Remove code that only tests called (#888) 2026-10-27 16:00:27 -06:00
test_fstab_migration.py Moving WROLPi-managed mounts off /etc/fstab onto a drive-resident fstab.yaml. 2026-05-24 12:44:05 -06:00
test_fstab_yaml.py Moving WROLPi-managed mounts off /etc/fstab onto a drive-resident fstab.yaml. 2026-05-24 12:44:05 -06:00
test_mount_executor.py Reconciler: uid/gid and ntfsfix for NTFS secondary mounts. 2026-07-06 20:30:29 -06:00
test_onboarding.py The drive wizard never offers an EFI system partition (#833) 2026-10-14 16:26:18 -06:00
test_onboarding_api.py Debian installs show the Controller drive wizard (#826) 2026-10-13 15:50:20 -06:00
test_readiness.py Checking readiness of main app in Controller instead of javascript requests, which break with CORS. 2026-03-08 16:05:56 -06:00
test_ready_api.py Checking readiness of main app in Controller instead of javascript requests, which break with CORS. 2026-03-08 16:05:56 -06:00
test_reconciler.py Reconciler: uid/gid and ntfsfix for NTFS secondary mounts. 2026-07-06 20:30:29 -06:00
test_rsyncd.py Torrents over a fail-closed VPN (#1026) 2026-11-28 14:26:24 -07:00
test_samba.py Adding docker support for samba shares. 2026-03-29 11:14:38 -06:00
test_samba_api.py Adding docker support for samba shares. 2026-03-29 11:14:38 -06:00
test_schemas.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
test_scripts.py A script's result reads the journal when systemd has cleared its timestamps (#956) 2026-11-08 11:25:38 -07:00
test_scripts_api.py A failed upgrade is shown on the upgrade page instead of redirecting home (#955) 2026-11-08 11:11:59 -07:00
test_services_api.py controller: expose kind/group in the services API response 2026-07-23 18:44:59 -06:00
test_smart.py Surface coarse SMART health for USB-bridge drives (#498) 2026-06-26 09:05:06 -06:00
test_status.py controller: report idle (0 RPM) fans; prefer the CPU fan over case fans 2026-07-23 19:52:58 -06:00
test_status_api.py Consolidating controller tests. Fixing controller test cleanup which slowed down tests significantly. 2026-05-15 21:10:30 -06:00
test_status_worker.py Warn in the navbar when a hard drive runs hot (#470) 2026-06-11 19:46:33 -06:00
test_sync.py The backup drive keeps deleted files for 30 days, then removes them (#999) 2026-11-19 16:50:21 -07:00
test_systemd.py Controller logs: an unparseable since is a 400, not empty logs (#953) 2026-11-08 08:02:48 -07:00
test_vpn.py VPN: read only the VPN files the Controller writes (#1037) 2026-11-30 15:05:37 -07:00
test_vpn_tunnel.py VPN: read only the VPN files the Controller writes (#1037) 2026-11-30 15:05:37 -07:00
test_wrol_mode.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