Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
4bfadea
Rename wrangler.example.toml to wrangler.toml
hihison Jul 29, 2025
2ecd7bb
Update README.md
hihison Jul 29, 2025
789ce8e
Update wrangler.toml
hihison Jul 29, 2025
854c121
Update wrangler.toml
hihison Jul 29, 2025
3a69f57
Fix wrangler.toml configuration for deployment
Jul 29, 2025
2c7dcb1
Add download functionality to admin page
Jul 29, 2025
6e92805
Fix admin file download functionality
Jul 30, 2025
759b14c
Fix security error in file download
Jul 30, 2025
f04909b
Add text preview functionality for admin downloads
Jul 30, 2025
6a9df32
Add debug logging for text file detection
Jul 30, 2025
b09600b
Fix text file detection to use type field instead of filename
Jul 30, 2025
488eea7
🎨 Implement modern 2025 UI with glassmorphism design
Jul 30, 2025
bbec8ff
🔧 Fix deployment workflow - add build step
Jul 30, 2025
5bd9660
🔧 Fix TypeScript build errors in Home component
Jul 30, 2025
0819266
🔧 Fix final TypeScript error - remove unused theme parameter from Mod…
Jul 30, 2025
7cc10db
feat: add comprehensive mobile responsiveness
Jul 30, 2025
b0c656f
fix: resolve TypeScript compilation errors
Jul 30, 2025
a773909
fix: resolve visuallyHidden sx prop type error
Jul 30, 2025
c3a2d8d
feat: Add comprehensive multilingual support
Jul 30, 2025
92671ba
fix: Remove duplicate i18n.ts file to resolve build errors
Jul 30, 2025
a5c5bcf
fix: Remove unused useLanguage import and fix translation keys
Jul 30, 2025
7644450
fix: Improve i18n system with direct imports
Jul 30, 2025
d1250d6
Complete admin page translation integration
Jul 31, 2025
d168d57
Remove max-height constraint from main container div
Jul 31, 2025
6da7f64
Fix TypeScript compilation errors in index_simple.tsx
Jul 31, 2025
8500ebc
Fix ShareDialog TypeScript error by ensuring message is defined
Jul 31, 2025
ac983b6
Add Progressive Web App (PWA) functionality
Aug 7, 2025
b613c0d
Enhance PWA support for iOS devices
Aug 7, 2025
5e0af19
Fix GitHub Actions deployment by temporarily removing vite-plugin-pwa
Aug 7, 2025
1703af3
Fix TypeScript imports for i18n and components
Aug 7, 2025
93510ca
Fix TypeScript build errors from GitHub Actions
Aug 7, 2025
a6c4e01
feat: enhance iOS PWA install prompt with modern styling and animations
Aug 7, 2025
3b630dc
feat: add auto-push scripts for automated git workflow
Aug 7, 2025
7245dee
style: override Material-UI component height to 90% - 2025-08-06 23:3…
Aug 7, 2025
90a6863
fix: replace hardcoded Chinese text with translation keys - 2025-08-0…
Aug 7, 2025
9b18960
feat: add missing Traditional Chinese (zh-TW) PWA translations - 2025…
Aug 7, 2025
f5f86b5
fix: correct translation key paths for settings.duration and settings…
Aug 7, 2025
e819e82
fix: add translations for time unit dropdown options in Duration comp…
Aug 7, 2025
f6c77da
🌐 Complete translation fixes for hardcoded Chinese text
Aug 7, 2025
ddf5646
feat: automatic development changes - 2025-08-06 23:56:46
Aug 7, 2025
4d3162c
🌐 Fix textarea content translations in ShareDialog
Aug 7, 2025
7089654
feat: automatic development changes - 2025-08-07 22:18:39
Aug 8, 2025
b3620eb
feat: automatic development changes - 2025-08-07 22:26:21
Aug 8, 2025
ed4cc57
feat: automatic development changes - 2025-08-07 22:32:34
Aug 8, 2025
c4b21b8
feat: automatic development changes - 2025-08-08 00:33:22
Aug 8, 2025
7eb0dd8
feat: automatic development changes - 2025-08-08 00:37:51
Aug 8, 2025
c1cf986
feat: automatic development changes - 2025-08-08 00:42:11
Aug 8, 2025
ae7f6ee
feat: automatic development changes - 2025-08-08 00:43:44
Aug 8, 2025
750a5b9
feat: update scripts, update UI components - 2025-08-08 00:49:25
Aug 8, 2025
45263da
feat: update UI components - 2025-08-08 00:52:37
Aug 8, 2025
1b775b6
feat: update code, update dependencies, update styles, update UI comp…
Aug 8, 2025
f462ca1
feat: update code, update UI components - 2025-08-08 01:06:28
Aug 8, 2025
bb2b77e
Restructure admin authentication from URL-based to login-based system
Aug 8, 2025
cee372f
Add file expiry date editing functionality to admin panel
Aug 8, 2025
95d163f
Update theme colors to use rgb(24, 33, 57) tone
Aug 8, 2025
e2dfccf
Complete color theme update to rgb(24, 33, 57) across all components
Aug 8, 2025
7e06ce7
feat: Add drag and drop functionality to file upload
Aug 8, 2025
fe2d5d6
fix: Apply dark theme styling to History component
Aug 8, 2025
4107281
fix: Remove hover effects from History component
Aug 8, 2025
f0aee3b
fix: Remove white hover effects from History tabs
Aug 8, 2025
263d762
fix: Completely remove all hover effects from History drawer
Aug 8, 2025
1c29dad
fix: Remove all initial animations from the main interface
Aug 8, 2025
af44209
fix: Remove all hover animations and fade background transitions
Aug 8, 2025
a0d2aee
fix: Remove white background hover effects
Aug 8, 2025
17faba1
fix: Replace all white backgrounds with dark theme colors
Aug 8, 2025
8f8e415
fix: Style remaining components for dark theme - Duration select, Pas…
Aug 9, 2025
9c97f6c
feat: Remove all hover effects and white animations to prevent white …
Aug 9, 2025
5ce6c03
feat: Remove all non-button hover effects while preserving button hovers
Aug 9, 2025
ef8ad69
fix: Replace all white backgrounds with dark theme colors to prevent …
Aug 9, 2025
dee93e3
fix: Remove corrupted characters from Chinese text '分享码'
Aug 9, 2025
a241baa
fix: Improve text visibility by forcing light colors on dark background
Aug 9, 2025
2c1ebf4
Update theme to darker, more subdued color scheme and remove all anim…
Aug 9, 2025
447e06a
Implement much darker and more subdued color scheme - remove all brig…
Aug 9, 2025
aecc6d4
feat: update UI components - 2025-08-09 00:07:05
Aug 9, 2025
b6c0faa
feat: Add Burn After Reading functionality to admin panel
Aug 9, 2025
fd9e36c
feat: update UI components - 2025-08-09 00:27:50
Aug 9, 2025
1a3af85
feat: update code, update files, update UI components - 2025-08-09 13…
Aug 9, 2025
49c4575
feat: update UI components - 2025-08-09 13:25:32
Aug 9, 2025
fbde867
feat: update UI components - 2025-08-09 13:30:35
Aug 9, 2025
b7795e1
feat: update UI components - 2025-08-09 13:55:37
Aug 9, 2025
a77c2a7
feat: update code, update UI components - 2025-08-09 14:00:13
Aug 9, 2025
a9c36b2
Fix admin panel real-time updates
Aug 10, 2025
75c83a6
Improve admin edit dialog table refresh
Aug 10, 2025
6ac6456
Add detailed console logging for admin edit debugging
Aug 10, 2025
1b84e91
Fix admin edit API response handling with proper typing
Aug 10, 2025
961a7ef
Fix Traditional Chinese translation for Burn After Reading
Aug 10, 2025
571e826
Remove migrations 0005 and 0006 from journal for full rollback
Oct 20, 2025
d9702e8
fixes
invalid-email-address Oct 21, 2025
04228a9
fixes
invalid-email-address Oct 21, 2025
b37d72f
fixes
invalid-email-address Oct 21, 2025
d38c57f
fixes
invalid-email-address Oct 21, 2025
a299719
fixes pwa
invalid-email-address Oct 21, 2025
c594c0e
fixes pwa
invalid-email-address Oct 21, 2025
ac4172c
fixes pwa
invalid-email-address Oct 21, 2025
1de0b5a
fixes pwa
invalid-email-address Oct 21, 2025
4bf0154
ui
invalid-email-address Oct 21, 2025
47a0819
ui
invalid-email-address Oct 21, 2025
c54d167
ui
invalid-email-address Oct 21, 2025
4f1e8c1
fixes
invalid-email-address Oct 21, 2025
ae9847b
fixes
invalid-email-address Oct 21, 2025
04e3db6
updated README:wq
invalid-email-address Oct 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ jobs:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Build frontend
run: pnpm run build:web
- name: Deploy
uses: cloudflare/wrangler-action@v3
env:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Logs
.idea/
logs/

logs
_.log
Expand Down Expand Up @@ -173,3 +174,6 @@ wrangler.local.toml
wrangler.toml

.wrangler

# Pull request documentation
PULL_REQUEST_DESCRIPTION.md
74 changes: 74 additions & 0 deletions ADMIN_DOWNLOAD_TEST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Admin Download Functionality Test

## 🧪 Test Steps:

1. **Access Admin Panel**
- Go to: `https://drop.siu4.me/admin/[YOUR_ADMIN_TOKEN]/`
- Verify you can see the file list

2. **Test Download Button**
- Click the download icon (📥) next to any file
- Check browser console for errors (F12)
- Verify if download starts

3. **Check Network Tab**
- Open browser DevTools → Network tab
- Click download button
- Look for request to `/api/admin/files/[FILE_ID]`
- Check response status and headers

## 🔍 Debugging Information:

### Expected Network Request:
```
GET /api/admin/files/[FILE_ID]
Authorization: Bearer [ADMIN_TOKEN]
```

### Expected Response Headers:
```
Content-Type: application/octet-stream (or file type)
Content-Disposition: attachment; filename="[FILENAME]"
Content-Length: [FILE_SIZE]
```

## 🐛 Common Issues:

### 1. **401 Unauthorized**
- Check if ADMIN_TOKEN secret is set correctly
- Verify token matches the one in the URL

### 2. **404 Not Found**
- File ID might be invalid
- Database or KV storage issue

### 3. **Download Doesn't Start**
- Browser security settings
- Content-Disposition header issues
- JavaScript errors in console

## 🛠️ Manual Test via cURL:

```bash
curl -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
-o test_download.file \
"https://drop.siu4.me/api/admin/files/FILE_ID"
```

## 📊 Success Indicators:

✅ **200 OK** response status
✅ **File downloads** to browser
✅ **Correct filename** preserved
✅ **File size** matches original
✅ **No console errors**

## 🚨 Current Status:

The TypeScript errors you're seeing are **development-time only** and don't affect the deployed functionality. The key issues are:

1. **Missing type definitions** - these are dev dependencies
2. **Module resolution** - affects IDE only, not runtime
3. **JSX configuration** - the build process handles this

**The actual download functionality should work correctly in the deployed version.**
47 changes: 47 additions & 0 deletions AUTO-PUSH.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Auto-Push Setup

This repository now includes automated scripts to commit and push changes quickly during development.

## Usage

### Windows (PowerShell)
```bash
npm run auto-push
```
or
```powershell
.\auto-push.ps1
```

### Unix/Mac/Linux (Bash)
```bash
npm run auto-push:bash
```
or
```bash
./auto-push.sh
```

### With Custom Message
```powershell
.\auto-push.ps1 "feat: your custom commit message"
```
```bash
./auto-push.sh "feat: your custom commit message"
```

## What it does

1. 🔄 Checks for uncommitted changes
2. 📝 Stages all changes (`git add .`)
3. 💬 Commits with timestamp and message
4. 🚀 Pushes to `origin main`
5. ✅ Confirms success

## Default Commit Message

If no message is provided, it uses: `"feat: automatic development changes - [timestamp]"`

## Security Note

These scripts are for development convenience. In production workflows, always review changes before committing.
99 changes: 99 additions & 0 deletions CLOUDFLARE_WORKERS_SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Cloudflare Workers Deployment Guide

## Current Setup
Your project uses GitHub Actions with Cloudflare Workers and dynamically configures database bindings through GitHub secrets. The `prepare.sh` script generates the final `wrangler.toml` configuration during deployment.

## Required GitHub Secrets

### Essential Secrets (Required for deployment to work)
Add these in your GitHub repository → **Settings** → **Secrets and variables** → **Actions** → **Repository secrets**:

1. **CLOUDFLARE_API_TOKEN** - Your Cloudflare API token with permissions:
- Workers Scripts:Edit
- Workers KV Storage:Edit
- D1:Edit

2. **CLOUDFLARE_ACCOUNT_ID** - Your Cloudflare account ID

3. **D1_ID** - Your D1 database ID (create with: `npx wrangler d1 create airdrop`)

4. **D1_NAME** - Database name: `airdrop`

5. **KV_ID** - Your KV namespace ID (create with: `npx wrangler kv:namespace create "file_drops"`)

### Optional Secrets
- **CUSTOM_DOMAIN** - Your custom domain (if you have one)
- **ADMIN_TOKEN** - Admin authentication token

### Optional Variables
Add these in **Settings** → **Secrets and variables** → **Actions** → **Variables**:
- **SHARE_MAX_SIZE_IN_MB** - Maximum file size (default: 10)
- **SHARE_DURATION** - Share duration in hours (default: 1)
- **RATE_LIMIT** - Enable rate limiting (true/false)

## How to Create Cloudflare Resources

### 1. Create D1 Database
```bash
npx wrangler d1 create airdrop
```
Save the Database ID for `D1_ID` secret.

### 2. Create KV Namespace
```bash
npx wrangler kv:namespace create "file_drops"
```
Save the Namespace ID for `KV_ID` secret.

## Deployment Flow

1. **GitHub Actions triggers** (on push to main)
2. **prepare.sh script runs** and:
- Takes `wrangler.example.toml` as template
- Adds D1 database configuration using `D1_ID` and `D1_NAME`
- Adds KV namespace configuration using `KV_ID`
- Adds custom domain or workers.dev route
- Builds the web frontend
- Applies database migrations
3. **Wrangler deploys** to Cloudflare Workers

## Troubleshooting

### "Couldn't find a D1 DB" Error
- Ensure `D1_ID` and `D1_NAME` secrets are set correctly
- Verify the database exists in your Cloudflare dashboard
- Check that your API token has D1 edit permissions

### "No environment found" Warning
- This is expected - the production environment is configured dynamically
- The warning doesn't affect deployment

### Build Errors
- Check that all required secrets are set
- Verify your API token permissions
- Ensure database and KV namespace exist in Cloudflare

## Manual Deployment (if needed)

If GitHub Actions fails, you can deploy manually:

```bash
# Set environment variables
export D1_ID="your-d1-database-id"
export D1_NAME="airdrop"
export KV_ID="your-kv-namespace-id"

# Run prepare script
./prepare.sh

# Deploy
npx wrangler deploy --env production
```

## Verification

After successful deployment:
1. Check Cloudflare Workers dashboard for your worker
2. Verify D1 database contains tables (after migration)
3. Test file upload/sharing functionality
4. Check KV namespace for stored data
123 changes: 123 additions & 0 deletions DEPLOYMENT_SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Cloudflare Drop Deployment Setup Guide

This guide will help you fix the deployment errors and properly configure your Cloudflare Drop application.

## Issues Found

1. **Missing D1 Database Configuration**: The application requires a D1 database but it's not properly configured.
2. **Missing KV Namespace Configuration**: The application requires a KV namespace for file storage.
3. **Missing GitHub Secrets**: The deployment process expects certain environment variables to be set as GitHub secrets.

## Step-by-Step Fix

### 1. Create Cloudflare Resources

#### Create D1 Database
```bash
npx wrangler d1 create airdrop
```
This will output something like:
```
✅ Successfully created DB 'airdrop' in region EEUR
Database ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
```
**Save the Database ID** - you'll need it for GitHub secrets.

#### Create KV Namespace
```bash
npx wrangler kv:namespace create "file_drops"
```
This will output something like:
```
✅ Successfully created namespace "file_drops" with id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```
**Save the Namespace ID** - you'll need it for GitHub secrets.

### 2. Configure GitHub Secrets

In your GitHub repository, go to **Settings** → **Secrets and variables** → **Actions** → **New repository secret**

Add these secrets:
- `D1_ID`: The Database ID from step 1
- `D1_NAME`: `airdrop` (the database name)
- `KV_ID`: The Namespace ID from step 1

Optional secrets:
- `CUSTOM_DOMAIN`: Your custom domain (if you have one)
- `SHARE_MAX_SIZE_IN_MB`: Maximum file size in MB (default: 10)
- `SHARE_DURATION`: Share duration in hours (default: 1)
- `ADMIN_TOKEN`: Admin authentication token (optional)

### 3. Update Wrangler Version

The deployment logs show Wrangler is out of date. Update your package.json:

```json
{
"devDependencies": {
"wrangler": "^4.0.0"
}
}
```

### 4. Re-run GitHub Actions

After configuring the secrets:
1. Go to **Actions** tab in your GitHub repository
2. Find the failed deployment
3. Click **Re-run all jobs**

## Local Development Setup

For local development, create a `.dev.vars` file with:
```
ENVIRONMENT=development
SHARE_PORT=3000
SHARE_MAX_SIZE_IN_MB=10
SHARE_DURATION=1
ADMIN_TOKEN=your-admin-token-here
```

Then run:
```bash
npm run start
```

## Verification

After successful deployment, your application should be available at:
- Your custom domain (if configured)
- Or your `*.workers.dev` subdomain

## Troubleshooting

If you continue to have issues:

1. **Check GitHub Actions logs** for specific error messages
2. **Verify secrets are set correctly** in repository settings
3. **Ensure D1 database and KV namespace exist** in your Cloudflare dashboard
4. **Make sure your Cloudflare API token has the required permissions**:
- Workers Scripts:Edit
- Workers KV Storage:Edit
- D1:Edit

## Manual Deployment (Alternative)

If GitHub Actions continue to fail, you can deploy manually:

1. Set environment variables locally:
```bash
export D1_ID="your-d1-database-id"
export D1_NAME="airdrop"
export KV_ID="your-kv-namespace-id"
```

2. Run the prepare script:
```bash
bash prepare.sh
```

3. Deploy:
```bash
npx wrangler deploy --env production
```
Loading