Skip to content

fix: guard raid setup and fix file share over-removal - #2182

Open
mrv777 wants to merge 2 commits into
getumbrel:masterfrom
mrv777:fix/storage-safety-guards
Open

fix: guard raid setup and fix file share over-removal#2182
mrv777 wants to merge 2 commits into
getumbrel:masterfrom
mrv777:fix/storage-safety-guards

Conversation

@mrv777

@mrv777 mrv777 commented Jun 30, 2026

Copy link
Copy Markdown

Two small safety fixes from going over the storage code, both independent.

raid setup guard
setup() partitions the devices and creates a fresh pool. The setup tRPC route is still live (marked dev/testing) and doesn't check for an existing array, so calling it with the current devices would wipe the live pool. Added a check to throw if an array already exists. Safe on fresh devices (getStatus returns exists: false with no pool) and on the onboarding setup path which runs before any pool exists.

file share over-removal
When deleting a path under /External we remove its shares with startsWith, which also matched siblings. Deleting /External/Drive/Foo would remove the share for /External/Drive/Foobar too. Now matches the exact path or a real child (path + '/').

Typecheck passes.

mrv777 added 2 commits June 30, 2026 12:21
- raid: throw in setup() if an array already exists, so the dev/testing setup route can't repartition and destroy a live pool.
- files: only remove shares for the deleted path or its children, not siblings. deleting /External/Drive/Foo was also removing the share for /External/Drive/Foobar.
delete() used the raw path for the /External share check, so a trailing slash (e.g. /External/Drive/Folder/) skipped child shares. normalize up front like list() does.
@mrv777
mrv777 marked this pull request as ready for review June 30, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant