Enstore is a network file system, file server and file management ecosystem built in Node.js (and Bun), enabling file-based operations with authentication, authorization, role-based access control, and streaming capabilities. The project is divided into multiple packages, each focusing on a specific domain:
-
@enstore/server- A Node.js (or Bun) server exposing file operations over HTTP/HTTPS with chunked file uploads, user management, and role-based permissions.
- Can run as Express middleware, a standalone CLI server, or inside Docker.
-
@enstore/cli- A command-line interface for interacting with an Enstore server.
- Supports file listing, reading, writing, user management, and role management.
- Credentials are stored locally in
~/.enstore/credentials.jsonor specified via environment variables.
-
@enstore/fs- A Node.js–style filesystem API that mounts Enstore as if it were a local filesystem.
- Provides methods analogous to Node’s
fsandfs.promises, includingcreateWriteStream,readFile,writeFile. - Perfect for directly integrating with Enstore servers as if they were local disks.
- File Operations: List directories, read files, write/upload files (with chunked or streaming uploads).
- Authentication & Authorization:
- File-based user store (
users.json) with bcrypt hashed passwords. - Role-based permissions (
read,write,manageUsers, etc.).
- File-based user store (
- Streaming: Chunked uploads with
multeror direct streaming forms. - Multiple Deployment Modes:
- Express Middleware – embed Enstore endpoints into an existing Express app
- Standalone CLI – quickly start an Enstore server with
enstore-server start - Docker – containerize everything, run with environment variables for dynamic user creation
@enstore/server is the core file server.
Key capabilities:
- Exposes a file management API (
/files/ls,/files/readFile,/files/writeFile). - Manages authentication & authorization using a file-based user store (
users.json). - Supports Express middleware usage, standalone CLI (
enstore-server start), or Docker container.
Read more about @enstore/server →
@enstore/cli is a command-line interface that interacts with any Enstore server.
Highlights:
enstore login <endpoint> <username>to store credentials (endpoint, username, password) in~/.enstore/credentials.json.enstore ls,enstore read,enstore write– list, read, and write files.enstore user add/update/delete– manage users.enstore role update/delete– manage roles.- Credentials can be overridden by environment variables (
ENSTORE_ENDPOINT,ENSTORE_USERNAME,ENSTORE_PASSWORD).
Read more about @enstore/cli →
@enstore/fs provides a Node.js fs–like API for reading/writing files against an Enstore server.
Features:
EnstoreFswithcreateWriteStream– stream file uploads chunk-by-chunk.EnstorePromiseFswithreadFileandwriteFile– promise-based approach.- Root directory mapping – treat a local directory (e.g.,
/var/logs) as root mapped to"/"on the remote server.
npm install -g @enstore/server @enstore/cliNow you can run:
enstore-server start --port 3000 --users ./users.json -d ./uploads
enstore login http://localhost:3000 admin
enstore ls /Pull the pre-built Docker image or build your own. For example:
docker pull ghcr.io/ricsam/enstore-server:latest
docker run -d \
-p 8080:3000 \
-v /host/path/uploads:/app/uploads \
ghcr.io/ricsam/enstore-server:latest start --port 3000 --users /app/users.json --uploads-dir /app/uploadsAdmin User (Optional):
docker run -d \
-p 8080:3000 \
-e ADMIN_USERNAME=admin -e ADMIN_PASSWORD=secret \
ghcr.io/ricsam/enstore-server:latest(Your entrypoint script checks env vars and creates the admin user automatically.)
- Bug Reports: Please open an issue in the main Enstore repository.
- Features/PRs: We welcome community contributions. Each package has its own subfolder – follow the code style and structure.
Areas to contribute or expand:
- More
fs-like methods (e.g.,readdir,stat,unlink, etc.) in@enstore/fs - Enhanced CLI commands (e.g.,
move,copyfiles) - Extended server routes for advanced file management
Enstore is licensed under the MIT License.
See LICENSE for more details.