Add plugin entry: file-manager - #90
Open
xMinor-1 wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What the plugin does
Adds a full-page file manager for the machine that runs the bb server, reachable
from a "File Manager" item in the sidebar. It covers the work that otherwise
needs a shell: a tree whose folders expand in place, drag-and-drop upload,
streamed download, move, copy, rename, delete, and archive extraction.
Uploads are chunked and resumable, so a dropped connection continues instead of
starting over — tested on a 5 GB file. Downloads are streamed rather than
buffered.
Source release
git:https://github.com/xMinor-1/bb-plugins.gitsubdir:plugins/file-managertagPrefix:file-manager/,range:^0.3.0file-manager/v0.3.0→ commit54eddc767af63a0183d0949c59ee59f83e2b3c61Plugin checks
Run against the exact released commit in a clean worktree:
npx tsc --noEmit— cleanbb plugin build .— buildsdist/server.js,dist/app.js,dist/app.cssand their metabb >=0.39,bbPluginSdk >=0.4.8Marketplace checks
npm ci --ignore-scripts,npm run build,npm run check— all pass, 64 entriesFolderOpen, the same one the plugin manifest declaresPermissions and security
This plugin reads and writes files on the bb host, which is its purpose, so the
boundary matters:
realpathbefore the root prefix test, so asymlink cannot be used to address anything outside the hard root — the home
directory of the user running bb. A path that resolves outside is refused
(
src/root.ts, which is the only place in the plugin allowed to build afilesystem path from user input).
staged into a private
<dest>/.bb-extract-<hex>/outdirectory the pluginowns, so a
../escape (the classic zip-slip) still lands inside it; anythingwritten beside
outis swept away; every symlink in the result is re-checkedagainst the hard root once it sits at its final path; only then is the tree
committed to the destination.
tar/unzip/7z, viaspawnwith anargument list rather than a shell string, with
--no-same-owner --no-same-permissions. The client cannot name a command or a destination —the format is detected by the plugin and the destination is derived from the
validated path.
routes.