mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-26 01:46:18 -05:00
Controller can unmount foreign mounts; protect the primary drive.
The /api/disks/unmount endpoint only removed entries from fstab.yaml and asked the reconciler to unmount, but the reconciler deliberately never unmounts paths it has not claimed. Foreign mounts (udisks2 desktop automounts, manual mounts) therefore could not be unmounted from the UI, failing with a confusing "check journalctl" error. - Fall back to a direct umount(8) when a reconcile leaves the requested mount point live. - Reject unmounting the primary WROLPi drive (/media/wrolpi) with a clear 400, normalized to catch path traversal. - Require the normalized mount point to be strictly under /media/ before any direct umount, since the fallback runs as root. - Show "System" instead of an Unmount button for /media/wrolpi in both the React UI and the Controller's simplified UI. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ed4546d1ad
commit
5313b0dccc
4 changed files with 93 additions and 12 deletions
|
|
@ -1604,7 +1604,7 @@
|
|||
<td>
|
||||
`;
|
||||
|
||||
const protectedMounts = ['/', '/boot', '/boot/firmware'];
|
||||
const protectedMounts = ['/', '/boot', '/boot/firmware', '/media/wrolpi'];
|
||||
const isProtected = protectedMounts.includes(disk.mountpoint);
|
||||
|
||||
// Check if this disk has a persistent entry (by mount point or UUID)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue