|
Some checks are pending
Docker Build and Publish / build (push) Waiting to run
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> |
||
|---|---|---|
| .github/workflows | ||
| config | ||
| public | ||
| src | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| docker-compose.yml | ||
| Dockerfile | ||
| i18next-parser.config.js | ||
| i18next.d.ts | ||
| LICENSE | ||
| next-env.d.ts | ||
| next-i18next.config.js | ||
| next.config.js | ||
| package.json | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| postcss.config.js | ||
| README.md | ||
| renovate.json | ||
| tailwind.config.js | ||
| tsconfig.json | ||
file-storage-index
Get started · What's available · Docker
Local file storage directory listing, powered by Next.js and React
📖 Introduction
file-storage-index is a fork of onedrive-vercel-index, reimagined for local file systems instead of Microsoft OneDrive cloud storage. This lightweight web application lets you browse, preview, and share files from your local storage with a modern, responsive interface.
- 🚀 Simple deployment with Docker or Node.js
- 🔍 Built-in search and file preview capabilities
- 🔒 Password protection at folder level
- 📱 Modern responsive design for all devices
- 🎬 Rich media support (video/audio streaming, office docs, PDFs)
- 💯 Zero cloud dependencies - runs entirely on your machine
Perfect for home media servers, personal file sharing, or any scenario where you need a beautiful interface to your local files.
🎮 Demo
✨ Features
| 👀 File preview | 💠 List / Grid layouts | 🎥 Video and audio |
| PDF, EPUB, markdown, code, plain text | For previewing images and documents with thumbnails | mp4, mp3, m4a, ..., play online with subtitles support! |
| 📄 Office preview | 📝 README.md preview | 📑 Pagination |
| docx, pptx, xlsx, ... | Also renders code blocks, images with relative links, ... | For folders with many files |
| 🔒 Protected folders | 🔎 Native Search | 🐳 Docker Support |
| Password protected routes and files | Searching through your local files | Easy deployment with Docker and Docker Compose |
... and more:
- Direct file serving and hosting
- Full dark mode support
- Style and website customizations
- Mobile responsive design
Note
: This project is focused on showcasing and providing a way for others to download files from your local file system. Emphasis on simple setup and easy customization.
🚀 Quickstart Guide
Local Installation
- Clone repository:
git clone https://github.com/doandat943/file-storage-index.git
cd file-storage-index
- Install dependencies:
pnpm install
- Configuration:
Copy
.env.examplefile to.envand edit environment variables:
cp .env.example .env
Required environment variables:
STORAGE_ROOT: File storage directory (default is './data')
- Run the application in development mode:
pnpm dev
🐳 Docker Guide
This section covers all aspects of using file-storage-index with Docker.
Building from Source
If you prefer to build the Docker image from source:
- Clone repository:
git clone https://github.com/doandat943/file-storage-index.git
cd file-storage-index
- Configure environment:
cp .env.example .env
Edit .env file to set up your environment variables.
- Build and run with Docker Compose:
docker-compose up --build -d
Quick Deployment
The fastest way to get started with these images:
- Create a
docker-compose.ymlfile with the following content:
version: '3'
services:
file-storage-index:
image: doandat943/file-storage-index:latest
container_name: file-storage-index
restart: unless-stopped
environment:
- NODE_ENV=production
volumes:
- file-storage-data:/app/data
ports:
- "3000:3000"
volumes:
file-storage-data:
- Run the container:
docker-compose up -d
The application will be available at http://localhost:3000.
Updating Docker Containers
To update your container to the latest image version:
- Pull the latest image:
docker pull doandat943/file-storage-index:latest
- Stop and remove the current container (your data will be preserved):
docker-compose down
- Start the container with the new image:
docker-compose up -d
- Verify that the new container is running:
docker ps
Note: Your data will remain intact as long as you've properly configured volumes in your docker-compose.yml file.
Common Docker Commands
Here are the most frequently used commands for managing your container:
# View logs
docker logs file-storage-index
# Stop container
docker-compose stop
# Start container
docker-compose start
# Remove container (preserves data volume)
docker-compose down
# Access container shell
docker exec -it file-storage-index /bin/sh
CI/CD Pipeline
This project uses GitHub Actions for continuous integration and deployment:
- Every commit triggers automatic builds and pushes to GitHub Container Registry and Docker Hub
- The workflow file
.github/workflows/docker-publish.ymlhandles building, pushing, and signing images - Images are signed with Cosign for security verification
If you fork this project and want to use the CI/CD pipeline, set up these repository secrets:
DOCKERHUB_USERNAME: Your Docker Hub usernameDOCKERHUB_TOKEN: Your Docker Hub access token
⚙️ Configuration Options
Storage Configuration
Edit config/api.config.js to set up:
- File storage directory path
- Cache configuration
Website Configuration
Edit config/site.config.js to set up:
- Website name and icon
- Root shared directory
- Password-protected paths
- Contact information and social links
Folder Protection
To protect a folder with a password:
- Create a
.passwordfile in the folder you want to protect - Add the folder path to
protectedRoutesinconfig/site.config.js
🔌 API Reference
Available Endpoints
GET /api?path={path}: Get file or folder informationGET /api/item?id={id}: Get item information by IDGET /api/raw?path={path}: Get raw file contentGET /api/search?q={query}: Search for files and foldersGET /api/thumbnail?path={path}: Get file thumbnail
📄 License
MIT
👨💻 Author
Created and maintained by doandat943

made with