Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

project-epb/flaredrive-rev

Repository files navigation

FlareDrive Logo

FlareDrive: REMASTERED

Deploy to Cloudflare

简体中文

Cloud-native S3-compatible bucket manager built on Cloudflare Workers.

This repository is under active refactoring. For architecture notes and progress tracking, see:

What it is

  • Backend: Cloudflare Workers + Hono (/api/**)
  • Database: Cloudflare D1 (SQLite-compatible) + Drizzle ORM
  • Frontend: Vue 3 SPA (Naive UI) bundled by Vite and served via Workers assets
  • Storage: S3-compatible providers (Cloudflare R2 / AWS S3 / MinIO / ...)

Features (current)

  • User registration/login (cookie-based sessions)
  • Bucket configuration & connection test (stored in D1)
  • Object browser (list/preview/delete)
  • Upload via presigned URL + upload history recording
  • Raw file access via /api/raw/:bucketId/* with access checks
  • Site settings stored in D1 (fallback: env → default)

UI is currently English-only.

Requirements

  • Node.js 22+ (recommended: 24.x)
  • Bun
  • Cloudflare account (for deploy / production D1)

Local development

Install dependencies:

bun install

Optional: create a local env file (frontend build-time options):

cp .env.sample .env

Apply D1 migrations to local database:

bun run drizzle:push

Start dev server:

bun dev

Default dev URL: http://localhost:5880

Authentication / creating the first admin

There are two common ways:

  1. Enable registration, then the first registered user (ID=1) becomes admin automatically.
  • The flag is resolved by DB → env → default.
  • In wrangler.jsonc, ALLOW_REGISTER defaults to false.
  • Admins can change it later in the UI: /@admin/settings.
  1. Admin create endpoint (no public registration needed)
  • Set ADMIN_CREATE_TOKEN as a Worker secret.
  • Then run:
bun run user:create -- --url http://localhost:5880 --email admin@example.com --password "StrongPass123" --token "<ADMIN_CREATE_TOKEN>"

Script details: scripts/create-user.ts

Useful scripts

  • bun dev - start dev server
  • bun run build - build frontend + worker assets
  • bun run deploy - deploy to Cloudflare Workers
  • bun run drizzle:push - apply D1 migrations locally
  • bun run drizzle:push-prod - apply D1 migrations to production (D1 HTTP)
  • bun run drizzle:studio - open Drizzle Studio (local)
  • bun run drizzle:studio-prod - open Drizzle Studio (production)

Environment variables

Frontend (Vite) env vars live in:

  • .env (optional)
  • .env.development / .env.production
  • .env.sample lists supported keys

Backend (Worker) env vars are configured in Cloudflare (Dashboard / Wrangler):

  • ALLOW_REGISTER (string boolean)
  • SITE_NAME (instance display name)
  • ADMIN_CREATE_TOKEN (enables /api/auth/admin-create)

Production Drizzle (D1 HTTP driver) requires:

  • CLOUDFLARE_ACCOUNT_ID
  • CLOUDFLARE_API_TOKEN
  • CLOUDFLARE_DATABASE_ID

Project structure

  • backend/ - Worker API (Hono)
  • frontend/ - Vue SPA
  • db/ - Drizzle schema
  • drizzle/ - SQL migrations
  • common/ - shared utilities

Screenshots

My Buckets

Gallery Layout

Book Layout

Manga!

File Info

License

MIT License

  • Copyright (c) 2022 Siyu Long (before f82ffdc)
  • Copyright (c) 2025 Dragon Fish (remastered version)

FlareDrive Logos & mascots

  • CC BY-SA 4.0
  • See more: README

About

✨ Get your own free cloud storage (image hosting) with 10 Gb free space ☁️ Cloud-native S3-compatible bucket manager built on Cloudflare Workers.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /