[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-72756":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":38,"readmeContent":39,"aiSummary":40,"trendingCount":16,"starSnapshotCount":16,"syncStatus":41,"lastSyncTime":42,"discoverSource":43},72756,"CloudPaste","ling-drag0n\u002FCloudPaste","ling-drag0n","🌩️ Serverless 自托管的文件管理与文本分享工具\u002F网盘，支持多存储聚合管理和WebDAV 服务挂载。兼容 S3、WebDAV、OneDrive、Google Drive、Telegram、HF、GitHub 等。内置   Markdown 编辑器、30+文件格式预览。支持 Cloudflare Workers 或 Docker 部署。","https:\u002F\u002Fdoc.cloudpaste.qzz.io",null,"JavaScript",2449,1605,5,32,0,12,30,80,36,31.62,"Other",false,"main",true,[27,28,29,30,31,32,33,34,35,36,37],"cloudflare","cloudflare-workers","docker","file-browser","huggingface","markdown","onedrive","s3","telegram","telegrambot","webdav","2026-06-12 02:03:07","# CloudPaste 📋\n\n\u003Cdiv align=\"center\">\n    \u003Cp>\n    \u003Ca href=\"README_CN.md\">中文\u003C\u002Fa> | \u003Ca href=\"README.md\">English\u003C\u002Fa> |\n    \u003Ca href=\"https:\u002F\u002Fwww.readme-i18n.com\u002Fling-drag0n\u002FCloudPaste?lang=es\">Español\u003C\u002Fa> |\n    \u003Ca href=\"https:\u002F\u002Fwww.readme-i18n.com\u002Fling-drag0n\u002FCloudPaste?lang=fr\">français\u003C\u002Fa> |\n    \u003Ca href=\"https:\u002F\u002Fwww.readme-i18n.com\u002Fling-drag0n\u002FCloudPaste?lang=ja\">日本語\u003C\u002Fa>\n    \u003C\u002Fp>\n    \u003Cimg width=\"100\" height=\"100\" src=\"https:\u002F\u002Fimg.icons8.com\u002Fdusk\u002F100\u002Fpaste.png\" alt=\"paste\"\u002F>\n    \u003Ch3>🌩️ Serverless file management and Markdown sharing tool, supports multiple storage aggregation, online preview of 30+ file formats, and WebDAV mounting\u003C\u002Fh3>\n\u003C\u002Fdiv>\n\n\u003Cdiv align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Fdeepwiki.com\u002Fling-drag0n\u002FCloudPaste\">\u003Cimg src=\"https:\u002F\u002Fdeepwiki.com\u002Fbadge.svg\" alt=\"Ask DeepWiki\">\u003C\u002Fa>\n    \u003Ca href=\".\u002FLICENSE\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Apache%202.0-blue.svg\" alt=\"License\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fling-drag0n\u002FCloudPaste\u002Fstargazers\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fling-drag0n\u002FCloudPaste.svg\" alt=\"GitHub Stars\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fwww.cloudflare.com\u002F\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPowered%20by-Cloudflare-F38020?logo=cloudflare\" alt=\"Powered by Cloudflare\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fhub.docker.com\u002Fr\u002Fdragon730\u002Fcloudpaste-backend\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fdocker\u002Fpulls\u002Fdragon730\u002Fcloudpaste-backend.svg\" alt=\"Docker Pulls\">\u003C\u002Fa>\n\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"#-showcase\">📸 Showcase\u003C\u002Fa> •\n  \u003Ca href=\"#-features\">✨ Features\u003C\u002Fa> •\n  \u003Ca href=\"#-deployment-guide\">🚀 Deployment Guide\u003C\u002Fa> •\n  \u003Ca href=\"#-tech-stack\">🔧 Tech Stack\u003C\u002Fa> •\n  \u003Ca href=\"#-development\">💻 Development\u003C\u002Fa> •\n  \u003Ca href=\"#-license\">📄 License\u003C\u002Fa>\n\u003C\u002Fp>\n\n## 📸 Showcase\n\n\u003Ctable align=\"center\">\n  \u003Ctr>\n    \u003Ctd>\u003Cimg src=\".\u002Fimages\u002Fimage-1.png\" width=\"400\"\u002F>\u003C\u002Ftd>\n    \u003Ctd>\u003Cimg src=\".\u002Fimages\u002Fimage-2.png\" width=\"400\"\u002F>\u003C\u002Ftd>\n  \u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd>\u003Cimg src=\".\u002Fimages\u002Fimage-3.png\" width=\"400\"\u002F>\u003C\u002Ftd>\n    \u003Ctd>\u003Cimg src=\".\u002Fimages\u002Fimage-4.png\" width=\"400\"\u002F>\u003C\u002Ftd>\n  \u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd>\u003Cimg src=\".\u002Fimages\u002Fimage-5.png\" width=\"400\"\u002F>\u003C\u002Ftd>\n    \u003Ctd>\u003Cimg src=\".\u002Fimages\u002Fimage-en1.png\" width=\"400\"\u002F>\u003C\u002Ftd>\n  \u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd>\u003Cimg src=\".\u002Fimages\u002Fimage-mount1.png\" width=\"400\"\u002F>\u003C\u002Ftd>\n    \u003Ctd>\u003Cimg src=\".\u002Fimages\u002Fimage-mount2.png\" width=\"400\"\u002F>\u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n## ✨ Core Features\n\n### Cloudflare Native Architecture\n\n- **Edge Computing**: Based on Cloudflare Workers, WorkFlow, and D1 database, with 300+ global nodes for nearby responses\n- **Zero Maintenance**: No server management required, automatic scaling, pay-per-request billing\n- **Integrated Deployment**: Frontend and backend packaged in the same Worker, saving time and effort\n- **Separate Deployment**: Optional frontend-backend separation, flexible to adapt to personal needs\n\n### Multi-Storage Support\n\n- **S3 Compatible**: Cloudflare R2, Backblaze B2, AWS S3, Alibaba Cloud OSS, Tencent Cloud COS, MinIO, etc.\n- **Cloud Storage Integration**: WebDAV, OneDrive, Google Drive, Telegram, Discord Bot, HuggingFace Database, GitHub API\u002FReleases (read-only), etc.\n- **Local Storage**: Docker deployment supports local file system\n- **Smart Upload**: Frontend pre-signed direct upload + streaming upload + chunked resumable upload, with real-time progress display, minimizing CF limitations\n- **File Preview**: Direct preview support for 30+ formats (images, videos, audio, PDF, Office, code, e-books, etc.), others can be previewed through external IFrame embedding [KKFileview](https:\u002F\u002Fgithub.com\u002Fkekingcn\u002FkkFileView)\n- **Scheduled Tasks**: Support for automated tasks like cleaning upload sessions, storage synchronization, search index rebuilding, etc.\n- **Unified Management**: Visual configuration for multiple storage, flexible switching of default storage sources\n\n### Powerful Markdown Editor\n\n- **Vditor Integration**: Support for GitHub-style Markdown, math formulas, flowcharts, mind maps\n- **Real-time Preview**: WYSIWYG editing experience\n- **Multi-format Export**: One-click export to PDF, HTML, PNG, Word\n- **Secure Sharing**: Password protection, expiration time, access count limits\n- **Raw Direct Links**: Similar to GitHub Raw, suitable for configuration file hosting\n\n### WebDAV Protocol Support\n\n- **Standard Protocol**: Supports mounting as a network drive with any WebDAV client\n- **Complete Operations**: Directory creation, file upload, deletion, renaming, moving\n- **Permission Control**: API key authorization, fine-grained access control\n- **Cache Optimization**: Configurable TTL, reducing upstream requests\n\n### Flexible Permission Management\n\n- **API Keys**: Create multi-permission read\u002Fwrite keys, bound to specific storage paths\n- **Time Control**: Custom validity period, automatic expiration and manual revocation\n- **JWT Authentication**: Secure administrator authentication system\n- **PWA Support**: Can be installed as a desktop application, usable offline\n\n### Multiple Deployment Methods\n\n- **Automatic Deployment**: One-click deployment via GitHub Actions, supports automatic triggering\n- **Manual Deployment**: Wrangler CLI deployment, flexible and controllable\n- **Docker Deployment**: Frontend and backend images + Docker Compose one-click startup\n- **Multi-platform**: Supports Cloudflare, Vercel, ClawCloud, HuggingFace,etc.\n\n## 🚀 Deployment Guide\n\n### Prerequisites\n\nBefore starting deployment, please ensure you have prepared the following:\n\n- [ ] [Cloudflare](https:\u002F\u002Fdash.cloudflare.com) account (required)\n- [ ] If using R2: Activate **Cloudflare R2** service and create a bucket (requires payment method)\n- [ ] If using Vercel: Register for a [Vercel](https:\u002F\u002Fvercel.com) account\n- [ ] Configuration information for other S3 storage services:\n    - `S3_ACCESS_KEY_ID`\n    - `S3_SECRET_ACCESS_KEY`\n    - `S3_BUCKET_NAME`\n    - `S3_ENDPOINT`\n\n**The following tutorial may be outdated. For specific details, refer to: [Cloudpaste Online Deployment Documentation](https:\u002F\u002Fdoc.cloudpaste.qzz.io)**\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>👉 View Complete Deployment Guide\u003C\u002Fb>\u003C\u002Fsummary>\n\n### 📑 Table of Contents\n\n- [Action Automated Deployment](#Action-Automated-Deployment)\n    - [Deployment Architecture Selection](#Deployment-Architecture-Selection)\n    - [Configure GitHub Repository](#Configure-GitHub-Repository)\n    - [Unified Deployment Tutorial (Recommended)](#Unified-Deployment-Tutorial-Recommended)\n    - [Separated Deployment Tutorial](#Separated-Deployment-Tutorial)\n- [Manual Deployment](#Manual-Deployment)\n    - [Unified Manual Deployment (Recommended)](#Unified-Manual-Deployment-Recommended)\n    - [Separated Manual Deployment](#Separated-Manual-Deployment)\n- [ClawCloud CloudPaste Deployment Tutorial](#ClawCloud-CloudPaste-Deployment-Tutorial)\n\n---\n\n## Action Automated Deployment\n\nUsing GitHub Actions enables automatic deployment of your application after code is pushed. CloudPaste offers two deployment architectures for you to choose from.\n\n### Deployment Architecture Selection\n\n#### 🔄 Unified Deployment (Recommended)\n\n**Frontend and backend deployed on the same Cloudflare Worker**\n\n✨ **Advantages:**\n- **Same Origin** - No CORS issues, simpler configuration\n- **Lower Cost** - Navigation requests are free, saving 60%+ costs compared to separated deployment\n- **Simpler Deployment** - Deploy frontend and backend in one go, no need to manage multiple services\n- **Better Performance** - Frontend and backend on the same Worker, faster response time\n\n#### 🔀 Separated Deployment\n\n**Backend deployed to Cloudflare Workers, frontend deployed to Cloudflare Pages**\n\n✨ **Advantages:**\n-  **Flexible Management** - Independent deployment, no mutual interference\n- **Team Collaboration** - Frontend and backend can be maintained by different teams\n- **Scalability** - Frontend can easily switch to other platforms (e.g., Vercel)\n\n---\n\n### Configure GitHub Repository\n\n#### 1️⃣ Fork or Clone Repository\n\nVisit and Fork the repository: [https:\u002F\u002Fgithub.com\u002Fling-drag0n\u002FCloudPaste](https:\u002F\u002Fgithub.com\u002Fling-drag0n\u002FCloudPaste)\n\n#### 2️⃣ Configure GitHub Secrets\n\nGo to your GitHub repository settings: **Settings** → **Secrets and variables** → **Actions** → **New repository secret**\n\nAdd the following Secrets:\n\n| Secret Name             | Required | Purpose                                                                               |\n| ----------------------- | -------- | ------------------------------------------------------------------------------------- |\n| `CLOUDFLARE_API_TOKEN`  | ✅       | Cloudflare API token (requires Workers, D1, and Pages permissions)                                      |\n| `CLOUDFLARE_ACCOUNT_ID` | ✅       | Cloudflare account ID                                                                                   |\n| `ENCRYPTION_SECRET`     | ❌       | Key for encrypting sensitive data (will be auto-generated if not provided)                              |\n| `ACTIONS_VAR_TOKEN`     | ✅       | GitHub Token for deployment control panel (required only when using the control panel, otherwise skip) |\n\n#### 3️⃣ Obtain Cloudflare API Token\n\n**Get API Token:**\n\n1. Visit [Cloudflare API Tokens](https:\u002F\u002Fdash.cloudflare.com\u002Fprofile\u002Fapi-tokens)\n2. Click **Create Token**\n3. Select **Edit Cloudflare Workers** template\n4. **Add additional permissions**:\n    - Account → **D1** → **Edit**\n    - Account → **Cloudflare Pages** → **Edit** (if using separated deployment)\n5. Click **Continue to summary** → **Create Token**\n6. **Copy the Token** and save it to GitHub Secrets\n\n![D1 Permission](.\u002Fimages\u002FD1.png)\n\n**Get Account ID:**\n\n1. Visit [Cloudflare Dashboard](https:\u002F\u002Fdash.cloudflare.com)\n2. Find **Account ID** in the right sidebar\n3. Click to copy and save to GitHub Secrets\n\n#### 4️⃣ (Optional) Configure Deployment Control Panel\n\nIf you want to use the visual control panel to manage auto-deployment switches, you need additional configuration:\n\n**Create GitHub Personal Access Token:**\n\n1. Visit [GitHub Token Settings](https:\u002F\u002Fgithub.com\u002Fsettings\u002Ftokens)\n2. Click **Generate new token** → **Generate new token (classic)**\n3. Set Token name (e.g., `CloudPaste Deployment Control`)\n4. Select permissions:\n    - ✅ **repo** (Full repository access)\n    - ✅ **workflow** (Workflow permissions)\n5. Click **Generate token**\n6. Copy the Token and save as Secret `ACTIONS_VAR_TOKEN`\n\n**Using the Control Panel:**\n\n1. Go to repository **Actions** tab\n2. In the left workflow list, click **🎛️ Deployment Control Panel**\n3. Click **Run workflow** → **Run workflow** on the right\n4. In the popup, select the deployment method to enable\u002Fdisable\n5. Click **Run workflow** to apply configuration\n6. After updating the switch state, the control panel will automatically trigger the corresponding deployment workflow once (whether it actually deploys is decided by the current switch state)\n\n---\n\n### 🔄 Unified Deployment Tutorial (Recommended)\n\n#### Deployment Steps\n\n1️⃣ **Configure GitHub Secrets** (refer to the configuration section above)\n\n2️⃣ **Trigger Deployment Workflow**\n\nMethod 1: Manual Trigger (recommended for first deployment)\n\n- Go to repository **Actions** tab\n- Click **Deploy SPA CF Workers[一体化部署]** on the left\n- Click **Run workflow** on the right → select `main` branch → **Run workflow**\n\nMethod 2: Auto Trigger\n\n- Use the deployment control panel to enable **SPA Unified Auto Deploy**\n- After that, deployment will be triggered automatically when pushing code to `frontend\u002F` or `backend\u002F` directory to `main` branch\n\n> Note: When you manually run **Deploy SPA CF Workers[一体化部署]** from the Actions page, it will **always deploy once regardless of the auto-deploy switch**. Automatic behavior (push or control panel triggered) is still controlled by the `SPA_DEPLOY` switch.\n\n3️⃣ **Wait for Deployment to Complete**\n\nThe deployment process takes about 3-5 minutes. The workflow will automatically complete the following steps:\n\n- ✅ Build frontend static assets\n- ✅ Install backend dependencies\n- ✅ Create\u002Fverify D1 database\n- ✅ Initialize database schema\n- ✅ Set encryption secret\n- ✅ Deploy to Cloudflare Workers\n\n4️⃣ **Get Deployment URL**\n\nAfter successful deployment, you will see output similar to this in the Actions log:\n\n```\nPublished cloudpaste-spa (X.XX sec)\n  https:\u002F\u002Fcloudpaste-spa.your-account.workers.dev\n```\n\nYour CloudPaste has been successfully deployed! Visit the URL above to use it.\n\n#### Deployment Complete\n\n**Visit your application:** `https:\u002F\u002Fcloudpaste-spa.your-account.workers.dev`\n\n**Post-deployment Configuration:**\n\n1. The database will be automatically initialized on first visit\n2. Log in with the default admin account:\n    - Username: `admin`\n    - Password: `admin123`\n3. **⚠️ Important: Change the default admin password immediately!**\n4. Configure your S3-compatible storage service in the admin panel\n5. (Optional) Bind a custom domain in Cloudflare Dashboard\n\n**Advantages Recap:**\n- ✅ Same origin for frontend and backend, no CORS issues\n- ✅ Navigation requests are free, reducing costs by 60%+\n- ✅ Deploy in one go, simple management\n\n---\n\n### 🔀 Separated Deployment Tutorial\n\nIf you choose separated deployment, follow these steps:\n\n#### Backend Deployment\n\n1️⃣ **Configure GitHub Secrets** (refer to the configuration section above)\n\n2️⃣ **Trigger Backend Deployment**\n\nMethod 1: Manual Trigger\n\n- Go to repository **Actions** tab\n- Click **Deploy Backend CF Workers[Worker后端分离部署]** on the left\n- Click **Run workflow** → **Run workflow**\n\nMethod 2: Auto Trigger\n\n- Use the deployment control panel to enable **Backend Separated Auto Deploy**\n- Deployment will be triggered automatically when pushing `backend\u002F` directory code\n\n3️⃣ **Wait for Deployment to Complete**\n\nThe workflow will automatically complete:\n\n- ✅ Create\u002Fverify D1 database\n- ✅ Initialize database schema\n- ✅ Set encryption secret\n- ✅ Deploy Worker to Cloudflare\n\n4️⃣ **Record Backend URL**\n\nAfter successful deployment, note down your backend Worker URL:\n`https:\u002F\u002Fcloudpaste-backend.your-account.workers.dev`\n\n**\u003Cspan style=\"color:red\">⚠️ Important: Remember your backend domain, you'll need it for frontend deployment!\u003C\u002Fspan>**\n\n#### Frontend Deployment\n\n##### Cloudflare Pages\n\n1️⃣ **Trigger Frontend Deployment**\n\nMethod 1: Manual Trigger\n\n- Go to repository **Actions** tab\n- Click **Deploy Frontend CF Pages[Pages前端分离部署]** on the left\n- Click **Run workflow** → **Run workflow**\n\nMethod 2: Auto Trigger\n\n- Use the deployment control panel to enable **Frontend Separated Auto Deploy**\n- Deployment will be triggered automatically when pushing `frontend\u002F` directory code\n\n> Note: When you manually run the **Backend** or **Frontend** deployment workflows from the Actions page, they will **always deploy once regardless of the auto-deploy switch**. Automatic behavior is controlled by the `BACKEND_DEPLOY` \u002F `FRONTEND_DEPLOY` switches.\n\n2️⃣ **Configure Environment Variables**\n\n**Required step: After frontend deployment, you must manually configure the backend address!**\n\n1. Log in to [Cloudflare Dashboard](https:\u002F\u002Fdash.cloudflare.com\u002F)\n2. Navigate to **Pages** → **cloudpaste-frontend**\n3. Click **Settings** → **Environment variables**\n4. Add environment variable:\n    - **Name**: `VITE_BACKEND_URL`\n    - **Value**: Your backend Worker URL (e.g., `https:\u002F\u002Fcloudpaste-backend.your-account.workers.dev`)\n    - **Note**: No trailing `\u002F`, custom domain recommended\n\n**\u003Cspan style=\"color:red\">⚠️ Must fill in the complete backend domain, format: https:\u002F\u002Fxxxx.com\u003C\u002Fspan>**\n\n3️⃣ **Redeploy Frontend**\n\n**Important: After configuring environment variables, you must run the frontend workflow again!**\n\n- Return to GitHub Actions\n- Manually trigger **Deploy Frontend CF Pages** workflow again\n- This is necessary to load the backend domain configuration\n\n![Frontend Redeploy](.\u002Fimages\u002Ftest-1.png)\n\n4️⃣ **Access Application**\n\nFrontend deployment URL: `https:\u002F\u002Fcloudpaste-frontend.pages.dev`\n\n**\u003Cspan style=\"color:red\">⚠️ Please strictly follow the steps, otherwise backend domain loading will fail!\u003C\u002Fspan>**\n\n##### Vercel (Alternative)\n\nVercel deployment steps:\n\n1. Import GitHub project in Vercel after forking\n2. Configure deployment parameters:\n\n```\nFramework Preset: Vite\nBuild Command: npm run build\nOutput Directory: dist\nInstall Command: npm install\n```\n\n3. Configure environment variables:\n    - Name: `VITE_BACKEND_URL`\n    - Value: Your backend Worker URL\n4. Click **Deploy** button to deploy\n\n**☝️ Choose either Cloudflare Pages or Vercel**\n\n**\u003Cspan style=\"color:red\">⚠️ Security Notice: Please change the default admin password immediately after system initialization (username: admin, password: admin123).\u003C\u002Fspan>**\n\n---\n\n## Manual Deployment\n\nCloudPaste supports two manual deployment methods: unified deployment (recommended) and separated deployment.\n\n### 🔄 Unified Manual Deployment (Recommended)\n\nUnified deployment deploys both frontend and backend to the same Cloudflare Worker, offering simpler configuration and lower costs.\n\n#### Step 1: Clone Repository\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fling-drag0n\u002FCloudPaste.git\ncd CloudPaste\n```\n\n#### Step 2: Build Frontend\n\n```bash\ncd frontend\nnpm install\nnpm run build\ncd ..\n```\n\n**Verify build output:** Ensure `frontend\u002Fdist` directory exists and contains `index.html`\n\n#### Step 3: Configure Backend\n\n```bash\ncd backend\nnpm install\nnpx wrangler login\n```\n\n#### Step 4: Create D1 Database\n\n```bash\nnpx wrangler d1 create cloudpaste-db\n```\n\nNote the `database_id` from the output (e.g., `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`)\n\n#### Step 5: Initialize Database\n\n```bash\nnpx wrangler d1 execute cloudpaste-db --file=.\u002Fschema.sql\n```\n\n#### Step 6: Configure wrangler.spa.toml\n\nEdit `backend\u002Fwrangler.spa.toml` file and modify the database ID:\n\n```toml\n[[d1_databases]]\nbinding = \"DB\"\ndatabase_name = \"cloudpaste-db\"\ndatabase_id = \"YOUR_DATABASE_ID\"  # Replace with ID from Step 4\n```\n\n#### Step 7: Deploy to Cloudflare Workers\n\n```bash\nnpx wrangler deploy --config wrangler.spa.toml\n```\n\nAfter successful deployment, you'll see your application URL:\n\n```\nPublished cloudpaste-spa (X.XX sec)\n  https:\u002F\u002Fcloudpaste-spa.your-account.workers.dev\n```\n\n#### Deployment Complete!\n\n**Visit your application:** Open the URL above to use CloudPaste\n\n**Post-deployment Configuration:**\n1. The database will be automatically initialized on first visit\n2. Log in with the default admin account (username: `admin`, password: `admin123`)\n3. **⚠️ Change the default admin password immediately!**\n4. Configure S3-compatible storage service in the admin panel\n5. (Optional) Bind a custom domain in Cloudflare Dashboard\n\n**\u003Cspan style=\"color:red\">⚠️ Security Notice: Please change the default admin password immediately after system initialization.\u003C\u002Fspan>**\n\n---\n\n### 🔀 Separated Manual Deployment\n\nIf you need to deploy and manage frontend and backend independently, you can choose the separated deployment method.\n\n#### Backend Manual Deployment\n\n1. Clone the repository\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fling-drag0n\u002FCloudPaste.git\ncd CloudPaste\u002Fbackend\n```\n\n2. Install dependencies\n\n   ```bash\n   npm install\n   ```\n\n3. Log in to Cloudflare\n\n   ```bash\n   npx wrangler login\n   ```\n\n4. Create D1 database\n\n   ```bash\n   npx wrangler d1 create cloudpaste-db\n   ```\n\n   Note the database ID from the output.\n\n5. Modify wrangler.toml configuration\n\n   ```toml\n   [[d1_databases]]\n   binding = \"DB\"\n   database_name = \"cloudpaste-db\"\n   database_id = \"YOUR_DATABASE_ID\"\n   ```\n\n6. Deploy Worker\n\n   ```bash\n   npx wrangler deploy\n   ```\n\n   Note the URL from the output; this is your backend API address.\n\n7. Initialize database (automatic)\n   Visit your Worker URL to trigger initialization:\n\n   ```\n   https:\u002F\u002Fcloudpaste-backend.your-username.workers.dev\n   ```\n\n**\u003Cspan style=\"color:red\">⚠️ Important: Remember your backend domain, you'll need it for frontend deployment!\u003C\u002Fspan>**\n\n#### Frontend Manual Deployment\n\n#### Cloudflare Pages\n\n1. Prepare frontend code\n\n   ```bash\n   cd CloudPaste\u002Ffrontend\n   npm install\n   ```\n\n2. Configure environment variables\n   Create or modify the `.env.production` file:\n\n   ```\n   VITE_BACKEND_URL=https:\u002F\u002Fcloudpaste-backend.your-username.workers.dev\n   VITE_APP_ENV=production\n   VITE_ENABLE_DEVTOOLS=false\n   ```\n\n3. Build frontend project\n\n   ```bash\n   npm run build\n   ```\n\n   [Be careful when building! !](https:\u002F\u002Fgithub.com\u002Fling-drag0n\u002FCloudPaste\u002Fissues\u002F6#issuecomment-2818746354)\n\n4. Deploy to Cloudflare Pages\n\n   **Method 1**: Via Wrangler CLI\n\n   ```bash\n   npx wrangler pages deploy dist --project-name=cloudpaste-frontend\n   ```\n\n   **Method 2**: Via Cloudflare Dashboard\n\n    1. Log in to [Cloudflare Dashboard](https:\u002F\u002Fdash.cloudflare.com\u002F)\n    2. Select \"Pages\"\n    3. Click \"Create a project\" → \"Direct Upload\"\n    4. Upload files from the `dist` directory\n    5. Set project name (e.g., \"cloudpaste-frontend\")\n    6. Click \"Save and Deploy\"\n\n#### Vercel\n\n1. Prepare frontend code\n\n   ```bash\n   cd CloudPaste\u002Ffrontend\n   npm install\n   ```\n\n2. Install and log in to Vercel CLI\n\n   ```bash\n   npm install -g vercel\n   vercel login\n   ```\n\n3. Configure environment variables, same as for Cloudflare Pages\n4. Build and deploy\n\n   ```bash\n   vercel --prod\n   ```\n\n   Follow the prompts to configure the project.\n\n---\n\n## ClawCloud CloudPaste Deployment Tutorial\n\n#### 10GB free traffic per month, suitable for light usage only\n\n###### Step 1:\n\nRegistration link: [Claw Cloud](https:\u002F\u002Fap-northeast-1.run.claw.cloud\u002Fsignin) (no #AFF)\nNo credit card required, as long as your GitHub registration date is more than 180 days, you get $5 credit every month.\n\n###### Step 2:\n\nAfter registration, click APP Launchpad on the homepage, then click create app in the upper right corner\n\n![image.png](https:\u002F\u002Fs2.loli.net\u002F2025\u002F04\u002F21\u002Fsoj5eWMhxTg1VFt.png)\n\n###### Step 3:\n\nFirst deploy the backend, as shown in the figure (for reference only):\n![image.png](https:\u002F\u002Fs2.loli.net\u002F2025\u002F04\u002F21\u002FAHrMnuVyNhK6eUk.png)\n\nBackend data storage is here:\n![image.png](https:\u002F\u002Fs2.loli.net\u002F2025\u002F04\u002F21\u002FANaoU5Y6cxPOVfw.png)\n\n###### Step 4:\n\nThen the frontend, as shown in the figure (for reference only):\n![image.png](https:\u002F\u002Fs2.loli.net\u002F2025\u002F04\u002F21\u002FkaT5Qu8ctovFdUp.png)\n\n##### Deployment is complete and ready to use, custom domain names can be configured as needed\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>👉 Docker Deployment Guide\u003C\u002Fb>\u003C\u002Fsummary>\n\n### 📑 Table of Contents\n\n- [Docker Command Line Deployment](#Docker-Command-Line-Deployment)\n    - [Backend Docker Deployment](#Backend-Docker-Deployment)\n    - [Frontend Docker Deployment](#Frontend-Docker-Deployment)\n- [Docker Compose One-Click Deployment](#Docker-Compose-One-Click-Deployment)\n\n---\n\n## Docker Command Line Deployment\n\n### Backend Docker Deployment\n\nCloudPaste backend can be quickly deployed using the official Docker image.\n\n1. Create data storage directory\n\n   ```bash\n   mkdir -p sql_data\n   ```\n\n2. Run the backend container\n\n   ```bash\n   docker run -d --name cloudpaste-backend \\\n     -p 8787:8787 \\\n     -v $(pwd)\u002Fsql_data:\u002Fdata \\\n     -e ENCRYPTION_SECRET=your-encryption-key \\\n     -e NODE_ENV=production \\\n     dragon730\u002Fcloudpaste-backend:latest\n   ```\n\n   Note the deployment URL (e.g., `http:\u002F\u002Fyour-server-ip:8787`), which will be needed for the frontend deployment.\n\n**\u003Cspan style=\"color:red\">⚠️ Security tip: Be sure to customize ENCRYPTION_SECRET and keep it safe, as this key is used to encrypt sensitive data.\u003C\u002Fspan>**\n\n### Frontend Docker Deployment\n\nThe frontend uses Nginx to serve and configures the backend API address at startup.\n\n```bash\ndocker run -d --name cloudpaste-frontend \\\n  -p 80:80 \\\n  -e BACKEND_URL=http:\u002F\u002Fyour-server-ip:8787 \\\n  dragon730\u002Fcloudpaste-frontend:latest\n```\n\n**\u003Cspan style=\"color:red\">⚠️ Note: BACKEND_URL must include the complete URL (including protocol http:\u002F\u002F or https:\u002F\u002F)\u003C\u002Fspan>**\n**\u003Cspan style=\"color:red\">⚠️ Security reminder: Please change the default administrator password immediately after system initialization (Username: admin, Password: admin123).\u003C\u002Fspan>**\n\n### Docker Image Update\n\nWhen a new version of the project is released, you can update your Docker deployment following these steps:\n\n1. Pull the latest images\n\n   ```bash\n   docker pull dragon730\u002Fcloudpaste-backend:latest\n   docker pull dragon730\u002Fcloudpaste-frontend:latest\n   ```\n\n2. Stop and remove old containers\n\n   ```bash\n   docker stop cloudpaste-backend cloudpaste-frontend\n   docker rm cloudpaste-backend cloudpaste-frontend\n   ```\n\n3. Start new containers using the same run commands as above (preserving data directory and configuration)\n\n## Docker Compose One-Click Deployment\n\nUsing Docker Compose allows you to deploy both frontend and backend services with one click, which is the simplest recommended method.\n\n1. Create a `docker-compose.yml` file\n\n```yaml\nversion: \"3.8\"\n\nservices:\n  frontend:\n    image: dragon730\u002Fcloudpaste-frontend:latest\n    environment:\n      - BACKEND_URL=https:\u002F\u002Fxxx.com # Fill in the backend service address\n    ports:\n      - \"8080:80\" #\"127.0.0.1:8080:80\"\n    depends_on:\n      - backend # Depends on backend service\n    networks:\n      - cloudpaste-network\n    restart: unless-stopped\n\n  backend:\n    image: dragon730\u002Fcloudpaste-backend:latest\n    environment:\n      - NODE_ENV=production\n      - PORT=8787\n      - ENCRYPTION_SECRET=custom-key # Please modify this to your own security key\n      - TASK_WORKER_POOL_SIZE=2\n    volumes:\n      - .\u002Fsql_data:\u002Fdata # Data persistence\n    ports:\n      - \"8787:8787\" #\"127.0.0.1:8787:8787\"\n    networks:\n      - cloudpaste-network\n    restart: unless-stopped\n\nnetworks:\n  cloudpaste-network:\n    driver: bridge\n```\n\n2. Start the services\n\n```bash\ndocker-compose up -d\n```\n\n**\u003Cspan style=\"color:red\">⚠️ Security reminder: Please change the default administrator password immediately after system initialization (Username: admin, Password: admin123).\u003C\u002Fspan>**\n\n3. Access the services\n\nFrontend: `http:\u002F\u002Fyour-server-ip:80`\nBackend: `http:\u002F\u002Fyour-server-ip:8787`\n\n### Docker Compose Update\n\nWhen you need to update to a new version:\n\n1. Pull the latest images\n\n   ```bash\n   docker-compose pull\n   ```\n\n2. Recreate containers using new images (preserving data volumes)\n\n   ```bash\n   docker-compose up -d --force-recreate\n   ```\n\n**\u003Cspan style=\"color:orange\">💡 Tip: If there are configuration changes, you may need to backup data and modify the docker-compose.yml file\u003C\u002Fspan>**\n\n### Nginx Reverse Proxy Example\n\n```nginx\nserver {\n    listen 443 ssl;\n    server_name paste.yourdomain.com;  # Replace with your domain name\n\n    # SSL certificate configuration\n    ssl_certificate     \u002Fpath\u002Fto\u002Fcert.pem;  # Replace with certificate path\n    ssl_certificate_key \u002Fpath\u002Fto\u002Fkey.pem;   # Replace with key path\n\n    # Frontend proxy configuration\n    location \u002F {\n        proxy_pass http:\u002F\u002Flocalhost:80;  # Docker frontend service address\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n    }\n\n    # Backend API proxy configuration\n    location \u002Fapi {\n        proxy_pass http:\u002F\u002Flocalhost:8787;  # Docker backend service address\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        client_max_body_size 0;\n\n        # WebSocket support (if needed)\n        proxy_http_version 1.1;\n        proxy_set_header Upgrade $http_upgrade;\n        proxy_set_header Connection \"upgrade\";\n    }\n\n    # WebDAV Configuration\n    location \u002Fdav {\n        proxy_pass http:\u002F\u002Flocalhost:8787\u002Fdav;  # Points to your backend service\n\n        # WebDAV necessary headers\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n\n        # WebDAV method support\n        proxy_pass_request_headers on;\n\n        # Support all WebDAV methods\n        proxy_method $request_method;\n\n        # Necessary header processing\n        proxy_set_header Destination $http_destination;\n        proxy_set_header Overwrite $http_overwrite;\n\n        # Handle large files\n        client_max_body_size 0;\n\n        # Timeout settings\n        proxy_connect_timeout 3600s;\n        proxy_send_timeout 3600s;\n        proxy_read_timeout 3600s;\n    }\n}\n```\n\n**\u003Cspan style=\"color:red\">⚠️ Security tip: It is recommended to configure HTTPS and a reverse proxy (such as Nginx) to enhance security.\u003C\u002Fspan>**\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>👉 S3 Cross-Origin Configuration Guide\u003C\u002Fb>\u003C\u002Fsummary>\n\n## R2 API Retrieval and Cross-Origin Configuration\n\n1. Log in to Cloudflare Dashboard\n2. Click R2 Storage and create a bucket.\n3. Create API token\n   ![R2api](.\u002Fimages\u002FR2\u002FR2-api.png)\n   ![R2rw](.\u002Fimages\u002FR2\u002FR2-rw.png)\n\n4. Save all data after creation; you'll need it later\n5. Configure cross-origin rules: click the corresponding bucket, click Settings, edit CORS policy as shown below:\n\n```json\n[\n  {\n    \"AllowedOrigins\": [\"http:\u002F\u002Flocalhost:3000\", \"https:\u002F\u002Freplace-with-your-frontend-domain\"],\n    \"AllowedMethods\": [\"GET\", \"PUT\", \"POST\", \"DELETE\", \"HEAD\"],\n    \"AllowedHeaders\": [\"*\"],\n    \"ExposeHeaders\": [\"ETag\"],\n    \"MaxAgeSeconds\": 3600\n  }\n]\n```\n\n## B2 API Retrieval and Cross-Origin Configuration\n\n1. If you don't have a B2 account, [register](https:\u002F\u002Fwww.backblaze.com\u002Fsign-up\u002Fcloud-storage?referrer=getstarted) one first, then create a bucket.\n   ![B2账号注册](.\u002Fimages\u002FB2\u002FB2-1.png)\n2. Click Application Key in the sidebar, click Create Key, and follow the illustration.\n   ![B2key](.\u002Fimages\u002FB2\u002FB2-2.png)\n3. Configure B2 cross-origin; B2 cross-origin configuration is more complex, take note\n   ![B2cors](.\u002Fimages\u002FB2\u002FB2-3.png)\n4. You can try options 1 or 2 first, go to the upload page and see if you can upload. If F12 console shows cross-origin errors, use option 3. For a permanent solution, use option 3 directly.\n\n   ![B21](.\u002Fimages\u002FB2\u002FB2-4.png)\n\nRegarding option 3 configuration, since the panel cannot configure it, you need to configure manually by [downloading B2 CLI](https:\u002F\u002Fwww.backblaze.com\u002Fdocs\u002Fcloud-storage-command-line-tools) tool. For more details, refer to: \"https:\u002F\u002Fdocs.cloudreve.org\u002Fzh\u002Fusage\u002Fstorage\u002Fb2\".\n\nAfter downloading, in the corresponding download directory CMD, enter the following commands:\n\n```txt\nb2-windows.exe account authorize   \u002F\u002FLog in to your account, following prompts to enter your keyID and applicationKey\nb2-windows.exe bucket get \u003CbucketName> \u002F\u002FYou can execute to get bucket information, replace \u003CbucketName> with your bucket name\n```\n\nWindows configuration, Use \".\\b2-windows.exe xxx\",\nPython CLI would be similar:\n\n```cmd\nb2-windows.exe bucket update \u003CbucketName> allPrivate --cors-rules \"[{\\\"corsRuleName\\\":\\\"CloudPaste\\\",\\\"allowedOrigins\\\":[\\\"*\\\"],\\\"allowedHeaders\\\":[\\\"*\\\"],\\\"allowedOperations\\\":[\\\"b2_upload_file\\\",\\\"b2_download_file_by_name\\\",\\\"b2_download_file_by_id\\\",\\\"s3_head\\\",\\\"s3_get\\\",\\\"s3_put\\\",\\\"s3_post\\\",\\\"s3_delete\\\"],\\\"exposeHeaders\\\":[\\\"Etag\\\",\\\"content-length\\\",\\\"content-type\\\",\\\"x-bz-content-sha1\\\"],\\\"maxAgeSeconds\\\":3600}]\"\n```\n\nReplace \u003CbucketName> with your bucket name. For allowedOrigins in the cross-origin allowance, you can configure based on your needs; here it allows all.\n\n5. Cross-origin configuration complete\n\n## MinIO API Access and Cross-Origin Configuration\n\n1. **Deploy MinIO Server**\n\n   Use the following Docker Compose configuration (reference) to quickly deploy MinIO:\n\n   ```yaml\n   version: \"3\"\n\n   services:\n     minio:\n       image: minio\u002Fminio:RELEASE.2025-02-18T16-25-55Z\n       container_name: minio-server\n       command: server \u002Fdata --console-address :9001 --address :9000\n       environment:\n         - MINIO_ROOT_USER=minioadmin # Admin username\n         - MINIO_ROOT_PASSWORD=minioadmin # Admin password\n         - MINIO_BROWSER=on\n         - MINIO_SERVER_URL=https:\u002F\u002Fminio.example.com # S3 API access URL\n         - MINIO_BROWSER_REDIRECT_URL=https:\u002F\u002Fconsole.example.com # Console access URL\n       ports:\n         - \"9000:9000\" # S3 API port\n         - \"9001:9001\" # Console port\n       volumes:\n         - .\u002Fdata:\u002Fdata\n         - .\u002Fcerts:\u002Froot\u002F.minio\u002Fcerts # SSL certificates (if needed)\n       restart: always\n   ```\n\n   Run `docker-compose up -d` to start the service.\n\n2. **Configure Reverse Proxy (Reference)**\n\n   To ensure MinIO functions correctly, especially file previews, configure reverse proxy properly. Recommended OpenResty\u002FNginx settings:\n\n   **MinIO S3 API Reverse Proxy (minio.example.com)**:\n\n   ```nginx\n   location \u002F {\n       proxy_pass http:\u002F\u002F127.0.0.1:9000;\n       proxy_set_header Host $host;\n       proxy_set_header X-Real-IP $remote_addr;\n       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n       proxy_set_header X-Forwarded-Proto $scheme;\n\n       # HTTP optimization\n       proxy_http_version 1.1;\n       proxy_set_header Connection \"\";  # Enable HTTP\u002F1.1 keepalive\n\n       # Critical: Resolve 403 errors & preview issues\n       proxy_cache off;\n       proxy_buffering off;\n       proxy_request_buffering off;\n\n       # No file size limit\n       client_max_body_size 0;\n   }\n   ```\n\n   **MinIO Console Reverse Proxy (console.example.com)**:\n\n   ```nginx\n   location \u002F {\n       proxy_pass http:\u002F\u002F127.0.0.1:9001;\n       proxy_set_header Host $host;\n       proxy_set_header X-Real-IP $remote_addr;\n       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n       proxy_set_header X-Forwarded-Proto $scheme;\n\n       # WebSocket support\n       proxy_http_version 1.1;\n       proxy_set_header Upgrade $http_upgrade;\n       proxy_set_header Connection \"upgrade\";\n\n       # Critical settings\n       proxy_cache off;\n       proxy_buffering off;\n\n       # No file size limit\n       client_max_body_size 0;\n   }\n   ```\n\n3. **Access Console to Create Buckets & Access Keys**\n\n   For detailed configuration, refer to official docs:  \n   https:\u002F\u002Fmin.io\u002Fdocs\u002Fminio\u002Fcontainer\u002Findex.html  \n   CN: https:\u002F\u002Fmin-io.cn\u002Fdocs\u002Fminio\u002Fcontainer\u002Findex.html\n\n   ![minio-1](.\u002Fimages\u002Fminio-1.png)\n\n4. **Additional Configuration (Optional)**\n\n   Allowed origins must include your frontend domain.  \n   ![minio-2](.\u002Fimages\u002Fminio-2.png)\n\n5. **Configure MinIO in CloudPaste**\n\n    - Log in to CloudPaste admin panel\n    - Go to \"S3 Storage Settings\" → \"Add Storage Configuration\"\n    - Select \"Other S3-compatible service\" as provider\n    - Enter details:\n        - Name: Custom name\n        - Endpoint URL: MinIO service URL (e.g., `https:\u002F\u002Fminio.example.com`)\n        - Bucket Name: Pre-created bucket\n        - Access Key ID: Your Access Key\n        - Secret Key: Your Secret Key\n        - Region: Leave empty\n        - Path-Style Access: MUST ENABLE!\n    - Click \"Test Connection\" to verify\n    - Save settings\n\n6. **Troubleshooting**\n\n    - **Note**: If using Cloudflare's CDN, you may need to add `proxy_set_header Accept-Encoding \"identity\"`, and there are caching issues to consider. It is recommended to use only DNS resolution.\n    - **403 Error**: Ensure reverse proxy includes `proxy_cache off` & `proxy_buffering off`\n    - **Preview Issues**: Verify `MINIO_SERVER_URL` & `MINIO_BROWSER_REDIRECT_URL` are correctly set\n    - **Upload Failures**: Check CORS settings; allowed origins must include frontend domain\n    - **Console Unreachable**: Verify WebSocket config, especially `Connection \"upgrade\"`\n\n## More S3-related configurations to come......\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>👉 WebDAV Configuration Guide\u003C\u002Fb>\u003C\u002Fsummary>\n\n## WebDAV Configuration and Usage Guide\n\nCloudPaste provides simple WebDAV protocol support, allowing you to mount storage spaces as network drives for convenient access and management of files directly through file managers.\n\n### WebDAV Service Basic Information\n\n- **WebDAV Base URL**: `https:\u002F\u002Fyour-backend-domain\u002Fdav`\n- **Supported Authentication Methods**:\n    - Basic Authentication (username+password)\n- **Supported Permission Types**:\n    - Administrator accounts - Full operation permissions\n    - API keys - Requires enabled mount permission (mount_permission)\n\n### Permission Configuration\n\n#### 1. Administrator Account Access\n\nUse administrator account and password to directly access the WebDAV service:\n\n- **Username**: Administrator username\n- **Password**: Administrator password\n\n#### 2. API Key Access (Recommended)\n\nFor a more secure access method, it is recommended to create a dedicated API key:\n\n1. Log in to the management interface\n2. Navigate to \"API Key Management\"\n3. Create a new API key, **ensure \"Mount Permission\" is enabled**\n4. Usage method:\n    - **Username**: API key value\n    - **Password**: The same API key value as the username\n\n### NGINX Reverse Proxy Configuration\n\nIf using NGINX as a reverse proxy, specific WebDAV configuration needs to be added to ensure all WebDAV methods work properly:\n\n```nginx\n# WebDAV Configuration\nlocation \u002Fdav {\n    proxy_pass http:\u002F\u002Flocalhost:8787;  # Points to your backend service\n\n    # WebDAV necessary headers\n    proxy_set_header Host $host;\n    proxy_set_header X-Real-IP $remote_addr;\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n\n    # WebDAV method support\n    proxy_pass_request_headers on;\n\n    # Support all WebDAV methods\n    proxy_method $request_method;\n\n    # Necessary header processing\n    proxy_set_header Destination $http_destination;\n    proxy_set_header Overwrite $http_overwrite;\n\n    # Handle large files\n    client_max_body_size 0;\n\n    # Timeout settings\n    proxy_connect_timeout 3600s;\n    proxy_send_timeout 3600s;\n    proxy_read_timeout 3600s;\n}\n```\n\n### Common Issues and Solutions\n\n1. **Connection Problems**:\n\n    - Confirm the WebDAV URL format is correct\n    - Verify that authentication credentials are valid\n    - Check if the API key has mount permission\n\n2. **Permission Errors**:\n\n    - Confirm the account has the required permissions\n    - Administrator accounts should have full permissions\n    - API keys need to have mount permission specifically enabled\n\n3. **⚠️⚠️ WebDAV Upload Issues**:\n\n    - The upload size for webdav deployed by Workers may be limited by CF's CDN restrictions to around 100MB, resulting in a 413 error.\n    - For Docker deployments, just pay attention to the nginx proxy configuration, any upload mode is acceptable\n\n\u003C\u002Fdetails>\n\n## 🔧 Tech Stack\n\n### Frontend\n\n- **Framework**: Vue.js 3 + Vite\n- **Styling**: TailwindCSS\n- **Editor**: Vditor\n- **Internationalization**: Vue-i18n\n- **Charts**: Chart.js + Vue-chartjs\n\n### Backend\n\n- **Runtime**: Cloudflare Workers\n- **Framework**: Hono\n- **Database**: Cloudflare D1 (SQLite)\n- **Storage**: Multiple S3-compatible services (supports R2, B2, AWS S3)\n- **Authentication**: JWT tokens + API keys\n\n## 💻 Development\n\n### API Documentation\n\n[API Documentation](Api-doc.md)\n\n[Server Direct File Upload API Documentation](Api-s3_direct.md) - Detailed description of the server direct file upload interface\n\n### Local Development Setup\n\n1. **Clone project repository**\n\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002Fling-drag0n\u002Fcloudpaste.git\n   cd cloudpaste\n   ```\n\n2. **Backend setup**\n\n   ```bash\n   cd backend\n   npm install\n   # Initialize D1 database\n   wrangler d1 create cloudpaste-db\n   wrangler d1 execute cloudpaste-db --file=.\u002Fschema.sql\n   ```\n\n3. **Frontend setup**\n\n   ```bash\n   cd frontend\n   npm install\n   ```\n\n4. **Configure environment variables**\n\n    - In the `backend` directory, create a `wrangler.toml` file to set development environment variables\n    - In the `frontend` directory, configure the `.env.development` file to set frontend environment variables\n\n5. **Start development servers**\n\n   ```bash\n   # Backend\n   cd backend\n   npm run dev\n\n   # Frontend (in another terminal)\n   cd frontend\n   npm run dev\n   ```\n\n### Project Structure\n\n```\nCloudPaste\u002F\n├── frontend\u002F                         # Frontend Vite + Vue 3 SPA\n│   ├── src\u002F\n│   │   ├── api\u002F                      # HTTP client & API services (no domain semantics)\n│   │   ├── modules\u002F                  # Domain modules layer (by business area)\n│   │   │   ├── paste\u002F                # Text sharing (editor \u002F public view \u002F admin)\n│   │   │   ├── fileshare\u002F            # File sharing (public page \u002F admin)\n│   │   │   ├── fs\u002F                   # Mounted file system explorer (MountExplorer)\n│   │   │   ├── upload\u002F               # Upload controller & upload views\n│   │   │   ├── storage-core\u002F         # Storage drivers & Uppy wiring (low-level abstraction)\n│   │   │   ├── security\u002F             # Frontend auth bridge & Authorization header helpers\n│   │   │   ├── pwa-offline\u002F          # PWA offline queue & state\n│   │   │   └── admin\u002F                # Admin panel (dashboard \u002F settings \u002F key management, etc.)\n│   │   ├── components\u002F               # Reusable, cross-module UI components (no module imports)\n│   │   ├── composables\u002F              # Shared composition APIs (file-system \u002F preview \u002F upload, etc.)\n│   │   ├── stores\u002F                   # Pinia stores (auth \u002F fileSystem \u002F siteConfig, etc.)\n│   │   ├── router\u002F                   # Vue Router configuration (single entry for all views)\n│   │   ├── pwa\u002F                      # PWA state & installation prompts\n│   │   ├── utils\u002F                    # Utilities (clipboard \u002F time \u002F file icons, etc.)\n│   │   ├── styles\u002F                   # Global styles & Tailwind config entry\n│   │   └── assets\u002F                   # Static assets\n│   ├── eslint.config.cjs             # Frontend ESLint config (including import boundaries)\n│   ├── vite.config.js                # Vite build configuration\n│   └── package.json\n├── backend\u002F                          # Backend (Cloudflare Workers \u002F Docker runtime)\n│   ├── src\u002F\n│   │   ├── routes\u002F                   # HTTP routing layer (fs \u002F files \u002F pastes \u002F admin \u002F system, etc.)\n│   │   │   ├── fs\u002F                   # Mount FS APIs (list \u002F read \u002F write \u002F search \u002F share)\n│   │   │   ├── files\u002F                # File sharing APIs (public \u002F protected)\n│   │   │   ├── pastes\u002F               # Text sharing APIs (public \u002F protected)\n│   │   │   ├── adminRoutes.js        # Generic admin routes\n│   │   │   ├── apiKeyRoutes.js       # API key management routes\n│   │   │   ├── mountRoutes.js        # Mount configuration routes\n│   │   │   ├── systemRoutes.js       # System settings & dashboard stats\n│   │   │   └── fsRoutes.js           # Unified FS entry aggregation\n│   │   ├── services\u002F                 # Domain services (pastes \u002F files \u002F system \u002F apiKey, etc.)\n│   │   ├── security\u002F                 # Auth + authorization (AuthService \u002F securityContext \u002F authorize \u002F policies)\n│   │   ├── webdav\u002F                   # WebDAV implementation & path handling\n│   │   ├── storage\u002F                  # Storage abstraction (S3 drivers, mount manager, file system ops)\n│   │   ├── repositories\u002F             # Data access layer (D1 + SQLite repositories)\n│   │   ├── cache\u002F                    # Cache & invalidation (mainly FS)\n│   │   ├── constants\u002F                # Constants (ApiStatus \u002F Permission \u002F DbTables \u002F UserType, etc.)\n│   │   ├── http\u002F                     # Unified error types & response helpers\n│   │   └── utils\u002F                    # Utilities (common \u002F crypto \u002F environment, etc.)\n│   ├── schema.sql                    # D1 \u002F SQLite schema bootstrap\n│   ├── wrangler.toml                 # Cloudflare Workers \u002F D1 configuration\n│   └── package.json\n├── docs\u002F                             # Architecture & design docs\n│   ├── frontend-architecture-implementation.md    # Frontend layering & modules\u002F* design\n│   ├── frontend-architecture-optimization-plan.md # Frontend optimization plan (Phase 2\u002F3)\n│   ├── auth-permissions-design.md                # Auth & permissions system design\n│   └── backend-error-handling-refactor.md        # Backend error handling refactor design\n├── docker\u002F                           # Docker & Compose deployment configs\n├── images\u002F                           # Screenshots used in README\n├── Api-doc.md                        # API overview\n├── Api-s3_direct.md                  # S3 direct upload API docs\n└── README.md                         # Main project README\n```\n\n### Custom Docker Build\n\nIf you want to customize Docker images or debug during development, you can follow these steps to build manually:\n\n1. **Build backend image**\n\n   ```bash\n   # Execute in the project root directory\n   docker build -t cloudpaste-backend:custom -f docker\u002Fbackend\u002FDockerfile .\n\n   # Run the custom built image\n   docker run -d --name cloudpaste-backend \\\n     -p 8787:8787 \\\n     -v $(pwd)\u002Fsql_data:\u002Fdata \\\n     -e ENCRYPTION_SECRET=development-test-key \\\n     cloudpaste-backend:custom\n   ```\n\n2. **Build frontend image**\n\n   ```bash\n   # Execute in the project root directory\n   docker build -t cloudpaste-frontend:custom -f docker\u002Ffrontend\u002FDockerfile .\n\n   # Run the custom built image\n   docker run -d --name cloudpaste-frontend \\\n     -p 80:80 \\\n     -e BACKEND_URL=http:\u002F\u002Flocalhost:8787 \\\n     cloudpaste-frontend:custom\n   ```\n\n3. **Development environment Docker Compose**\n\n   Create a `docker-compose.dev.yml` file:\n\n   ```yaml\n   version: \"3.8\"\n\n   services:\n     frontend:\n       build:\n         context: .\n         dockerfile: docker\u002Ffrontend\u002FDockerfile\n       environment:\n         - BACKEND_URL=http:\u002F\u002Fbackend:8787\n       ports:\n         - \"80:80\"\n       depends_on:\n         - backend\n\n     backend:\n       build:\n         context: .\n         dockerfile: docker\u002Fbackend\u002FDockerfile\n       environment:\n         - NODE_ENV=development\n         - RUNTIME_ENV=docker\n         - PORT=8787\n         - ENCRYPTION_SECRET=dev_secret_key\n       volumes:\n         - .\u002Fsql_data:\u002Fdata\n       ports:\n         - \"8787:8787\"\n   ```\n\n   Start the development environment:\n\n   ```bash\n   docker-compose -f docker-compose.yml up --build\n   ```\n\n## 📄 License\n\nApache License 2.0\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n\n## ❤️ Contribution\n- **Sponsorship**: Maintaining the project is not easy. If you like this project, you can give the author a little encouragement. Every bit of your support is the motivation for me to move forward~\n\n  ![image.png](.\u002Fimages\u002FPayQrcode.png)\n\n  \u003Ca href=\"https:\u002F\u002Fafdian.com\u002Fa\u002Fdrag0n\">\u003Cimg width=\"200\" src=\"https:\u002F\u002Fpic1.afdiancdn.com\u002Fstatic\u002Fimg\u002Fwelcome\u002Fbutton-sponsorme.png\" alt=\"\">\u003C\u002Fa>\n\n    - **Sponsors**: A huge thank you to the following sponsors for their support of this project!!\n\n      [![Sponsors](https:\u002F\u002Fafdian.730888.xyz\u002Fimage)](https:\u002F\u002Fafdian.com\u002Fa\u002Fdrag0n)\n\n- **Contributors**: Thanks to the following contributors for their selfless contributions to this project!\n\n  [![Contributors](https:\u002F\u002Fcontrib.rocks\u002Fimage?repo=ling-drag0n\u002FCloudPaste)](https:\u002F\u002Fgithub.com\u002Fling-drag0n\u002FCloudPaste\u002Fgraphs\u002Fcontributors)\n\n**If you think the project is good I hope you can give a free star✨✨, Thank you very much!**\n","CloudPaste 是一个自托管的文件管理和文本分享工具，支持多存储聚合管理及WebDAV服务挂载。其核心功能包括通过Cloudflare Workers实现的边缘计算架构，提供零维护、自动扩展和按需计费等特性；同时支持多种存储服务如S3兼容存储、WebDAV、OneDrive、Google Drive等，并内置了Markdown编辑器与超过30种文件格式的在线预览能力。该工具适用于需要高效管理和共享文件的个人或团队，特别是那些希望利用无服务器技术简化运维流程并保持灵活性的用户。支持通过Cloudflare Workers或Docker进行部署。",2,"2026-06-11 03:43:29","high_star"]