A cloud storage aggregation service deployed on Cloudflare Workers with D1 database support.
English | 简体中文
- File storage and management
- Cloudflare Workers deployment
- D1 database integration
- Responsive web interface
- File preview capabilities
- Multi-storage backend support
- WebDAV server support - Access your storages via WebDAV protocol
Before deploying this application, ensure you have the following:
- Node.js (v18 or higher)
- npm or yarn package manager
- Cloudflare account with Workers enabled
- Wrangler CLI installed globally:
npm install -g wrangler
- Clone the repository:
git clone https://github.com/ooyyh/Cloudflare-Clist.git
cd Cloudflare-Clist- Install dependencies:
npm install- Log in to Cloudflare:
wrangler login- Create a D1 database:
wrangler d1 create clist- Update the
wrangler.jsoncfile with your specific database ID and environment variables:
{
"vars": {
"VALUE_FROM_CLOUDFLARE": "Hello from Cloudflare",
"ADMIN_USERNAME": "your_admin_username",
"ADMIN_PASSWORD": "your_secure_password",
"SITE_TITLE": "Your Site Title",
"SITE_ANNOUNCEMENT": "Welcome to CList storage service!",
"CHUNK_SIZE_MB": "10"
},
"d1_databases": [
{
"binding": "DB",
"database_name": "clist",
"database_id": "your_database_id_here"
}
]
}Run the database migrations to set up the required tables:
wrangler d1 migrations apply clistTo run the application in development mode:
npm run devThis will start the development server with hot reloading.
To build the application for production:
npm run buildThis creates optimized builds for both client and server.
To deploy the application to Cloudflare Workers:
npm run deployThis command will:
- Build the application
- Deploy it to Cloudflare Workers
Alternatively, you can build and deploy separately:
npm run build
wrangler deploySee the GitHub Actions workflow guide: GITHUB_WORKFLOW_DEPLOY.md
The application uses the following environment variables:
ADMIN_USERNAME: Administrator username for accessing the serviceADMIN_PASSWORD: Administrator password for accessing the serviceSITE_TITLE: Title displayed on the websiteSITE_ANNOUNCEMENT: Announcement text shown on the homepageCHUNK_SIZE_MB: Maximum file chunk size in MB for uploadsWEBDAV_ENABLED: Set to "true" to enable WebDAV serverWEBDAV_USERNAME: WebDAV access username (optional, defaults to admin username)WEBDAV_PASSWORD: WebDAV access password (optional, defaults to admin password)
Set the following in Cloudflare Workers environment variables:
{
"vars": {
"WEBDAV_ENABLED": "true",
"WEBDAV_USERNAME": "your_webdav_username",
"WEBDAV_PASSWORD": "your_webdav_password"
}
}Once enabled, access your storages via:
- All storages root:
https://your-domain/dav/0/ - Specific storage:
https://your-domain/dav/{storage_id}/
- Windows: Map network drive with WebDAV URL
- macOS: Finder → Go → Connect to Server
- Linux: Use davfs2 or file manager
- Mobile: Use any WebDAV-compatible file manager app
The application uses a D1 database with migrations located in the migrations/ directory. The schema is defined in schema.sql.
To preview the production build locally:
npm run previewTo run TypeScript type checking:
npm run typecheckThis will generate Cloudflare types and run TypeScript compilation.
├── app/ # React Router application source
│ ├── components/ # React components
│ ├── lib/ # Utility libraries
│ ├── routes/ # Route definitions
│ └── types/ # Type definitions
├── migrations/ # D1 database migrations
├── workers/ # Cloudflare Workers entry point
├── package.json # Project dependencies and scripts
├── wrangler.jsonc # Cloudflare Workers configuration
├── vite.config.ts # Vite build configuration
└── tsconfig.json # TypeScript configuration
- React Router v7
- Cloudflare Workers
- Cloudflare D1 Database
- Vite build tool
- TypeScript
- Tailwind CSS
For support, please contact:
- GitHub: https://github.com/ooyyh
- Email: laowan345@gmail.com
This project is licensed under the terms specified in the repository.