| Changelog | Added
- Mass deletion guard. Content inside a protected folder can still be deleted, but a
user who deletes too much of it in a short time is now stopped. This closes the gap
left when a protected folder is deleted in Windows Explorer without the Recycle Bin
(Shift+Delete, or a folder too large for it): Explorer removes the files one by one,
the desktop client syncs half way and deletes them on the server one by one, and only
the protected folder itself survived. Past the limit, further deletions in that folder
by that user are refused, the content is advertised to them without the delete
permission so the desktop client restores what Explorer removed, and they get a
notification with a button that restores the deleted items from the trash bin.
Admins get a notification with a button to release the block, which otherwise ends on
its own. Limits are set in the admin settings: number of items and/or size (MB) within
a number of minutes, per user and per protected folder, and how long the block lasts.
Deleting a subfolder counts everything inside it (a folder sent to the Recycle Bin
reaches the server as a single DELETE), and a deletion that would go over a limit is
refused before anything is deleted; only a single file may cross the size limit, so
large files stay deletable.
Defaults: 100 items in 10 minutes, no size limit, 24 hours. Requires a memory cache
(Redis or APCu) to count deletions; the admin page warns when there is none.
Changed
- Admin page split into two tabs. "Protected folders" (with the total count) holds
a search field that filters by name, path and reason, the Add protection button and
the list. "Settings" holds the display option and the mass deletion guard. The active
tab is kept in the URL (
#folders, #settings), so links and the browser's back and
forward buttons work. Each folder shows its name (the Team folder name, or the last
part of the path), a "Team folder" badge, the reason, and a grey line with the path
(or internal ID of a Team folder) and who protected it when. Removing a protection now uses an open lock
icon instead of a trash can, and the confirmation says the folder is not deleted.
- Paused deletions appear as a banner above the tabs, only while someone is paused,
with a "Release" button for each user and folder, the same action as in the admins'
notification.
- Mass deletion guard settings: the unit is shown inside each field, a sentence
below the fields spells out what the current limits do, the fields are disabled while
the guard is off, and Save stays disabled until something changed or while a value
would be refused (both limits at 0, a window or pause of 0).
- "Show lock icons" now applies to every user. It was stored in the browser of the
admin who changed it, so it only ever affected that browser. It is now an app setting
(
show_lock_icons, on by default) that the Files app reads for every user; it is
still saved as soon as it is switched.
- "Add Folder Protection" dialog rebuilt with Nextcloud's own dialog components:
it traps focus and closes with Escape, the "/files/" prefix sits inside the path field,
which says whether the folder exists, the warning for a partly protected Team folder
is shown in the list instead of a tooltip, and the folder tree has labelled expand
buttons and says "Already protected" in text instead of a lock emoji. Confirmations
(remove a protection, reason for a Team folder) are Nextcloud dialogs too.
- Same wording and look across the app. Team folders are called team folders
everywhere, as Nextcloud itself names them since 31, instead of "Group folders"; labels
use sentence case; the success and error messages use the same words wherever the same
thing happens ("Folder protected", "Protection removed"); protected folders show the
same grey lock in Files, on the admin page, in the add dialog and on the dashboard; and
"Created by" became "Protected by", since it names who protected the folder, not who
created it.
- Dashboard widget rebuilt with Nextcloud's standard widget layout: each folder opens
in Files, sizes use the same format as Files, and the lock emoji is gone.
- Messages from the server use one style and are all translated, including the errors
the desktop client and WebDAV clients receive (one of them still had an emoji and
capitals). The "blocked" notification now says what was blocked ("Deleting "Projects"
was blocked") instead of an internal action name such as "prop_patch".
- The admin page is built with
@nextcloud/vue components, and the whole frontend
passes ESLint (@nextcloud/eslint-config, npm run lint).
Fixed
- Folder and user names containing
&, < or > were shown HTML-escaped (&)
in the admin page's messages.
- Errors from the server were shown untranslated on the admin page (for example
"Folder is already protected"), sometimes with the text of an internal exception.
- In "Add folder protection", typing the name of a team folder showed "Folder found"
next to the warning that team folders must be protected from their own tab.
- Protecting several folders from the folder tree stopped at the first one that failed;
the others are now protected anyway and the message says how many failed.
- Files deleted inside a protected personal folder skipped the trash bin and were
lost for good. The trash bin "deletes" an item by moving it into
files_trashbin/,
and the storage layer refused that move as a move out of the protected folder. When
that move fails, Nextcloud deletes the original permanently instead. Subfolders were
deleted even though the client got a 403, which also left the desktop client in a
sync error. A move into the trash bin now follows the delete rules: allowed for
anything that may be deleted, still refused for the protected folder itself and for
folders that contain one. Team folders and external storage were not affected.
- Uploading a new file into a protected personal folder failed with 423 Locked (#20).
An upload is written to a
.part file next to the target and then moved onto the
real name. That move used a code path without the "inside the same protected folder"
exception that renames already had. Both now share the same rules.
|