Feature - complete file and folder management with docker compose#132
Open
dayal18 wants to merge 2 commits intomifi:masterfrom
Open
Feature - complete file and folder management with docker compose#132dayal18 wants to merge 2 commits intomifi:masterfrom
dayal18 wants to merge 2 commits intomifi:masterfrom
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.
🚀 Feature: File Management Enhancements (Create, Rename, Recursive Delete)
📝 Summary
This update introduces robust file management capabilities to the web interface, transforming it from a simple uploader/viewer into a fully functional file browser. Users can now create directories, rename files/folders inline, and recursively delete directories directly from the UI. Native browser dialogs have been completely replaced with elegant
SweetAlert2modals for a consistent, modern UX.⚙️ Backend Updates (
packages/lib/src/index.ts)POST /api/mkdirendpoint that securely resolves paths and sanitizes inputs (usingfilenamify) to create new directories.POST /api/renameendpoint to handle renaming operations for both files and directories, complete with root-folder protection.DELETE /api/deleteendpoint. Replacedfs.unlinkwithfs.rm({ recursive: true, force: true })to safely support deleting both individual files and non-empty directories.🖥️ Frontend Updates (
packages/web/src/routes/dir/$dirId.tsx)<FileRow />component to support an interactive edit mode. Users can now click theFaEditicon to transform the row into a text input.Enterto save,Escapeto cancel).window.confirmfor deletions with a custom-styledSwal.firemodal.Swal.firewith aninputValidatorfor the New Folder prompt to prevent empty directory names.🖼️ UI/UX Improvements
react-icons/fa(FaEdit,FaFolderPlus,FaCheck,FaTimes) to clearly indicate the new file management actions.🐳 Docker Deployment
You can run
ezshareeasily using Docker. This ensures all dependencies likeffmpegandxvfbare pre-installed and configured correctly.Prerequisites
Option 1: Using Docker Compose (Recommended)
The easiest way to run the application is with Docker Compose. This handles the build, port mapping, and volume creation automatically.
Start the application:
Access the app:
Open your browser to
http://localhost:3003.Shared Files:
Place files in the
./my-shared-datafolder (created automatically in your project root). These will appear in the application under/shared.Volume Permissions (Important)
Since the container now runs as UID 1000 (
node), the host directory mounted to/shared(defined indocker-compose.ymlas./my-shared-data) must be writable by UID 1000.If you encounter
Permission Deniederrors on Linux/Mac, run the following on the host machine to fix local folder permissions:Option 2: Manual Docker CLI
If you prefer to run the
Dockerfilemanually without Compose:Build the image:
docker build -t ezshare .Run the container:
You must map port
3003and mount a volume to/sharedfor the application to function properly.docker run -p 3003:3003 -v $(pwd)/my-shared-data:/shared ezshareConfiguration Details
3003by default./sharedto store and retrieve files.node:20-slimand includes necessary runtime tools likeffmpegfor media processing.