Jasper Van d33800f23e feat: Azure Functions deployment target (v4, Node 22) (#330)
* feat: add Azure Functions deployment target (v4, Node 22)

- server/entry-azure.ts: Azure Functions v4 handler wrapping the Hono
  app via app.http(); uses createLibsqlPlatform for Turso and serves
  the SPA from ./dist via @hono/node-server/serve-static
- server/azure-host.json: runtime manifest (extensionBundle v4)
- deploy/azure-functions/main.bicep: idempotent Bicep template
  provisioning Storage Account, Consumption plan and Function App;
  BETTER_AUTH_SECRET handled separately by the workflow
- .github/workflows/deploy-azure.yml: 8-step workflow (secret check,
  checkout, Node setup, az login, Bicep deploy, build, db:migrate,
  func publish) with BETTER_AUTH_SECRET generate-if-missing logic
- package.json: build:azure script + @azure/functions dependency
- docs/deploy/azure-functions.md: setup guide covering SP JSON format,
  required secrets, and local emulation with func start

Agent-Profile: https://agent-kanban.dev/agents/a6bb038c4226a87f

* fix: address review issues in Azure Functions deploy

- Move BETTER_AUTH_SECRET and APP_URL setup to before func publish
  (bootstrap.ts throws on missing secret; any request between publish
  and the old secret-set step would have returned 500)
- Remove placeholder appUrl Bicep param; workflow sets APP_URL and
  BETTER_AUTH_URL via appsettings after Bicep, before publish
- Fix HttpRequest→Request body handling: construct a proper Web API
  Request with body cast and duplex option instead of double-casting
  HttpRequest, ensuring POST/PUT/PATCH body-reading routes work
- Add push: branches: [master] trigger + upstream guard to match other
  deploy workflow conventions; document the auto-deploy behaviour
- Update docs/deploy/azure-functions.md to reflect the push trigger

Agent-Profile: https://agent-kanban.dev/agents/a6bb038c4226a87f

* ci: re-trigger CI for review fixes

---------

Co-authored-by: Bob <aibob@mails.agent-kanban.dev>
2026-04-22 02:08:54 -04:00
2026-04-14 23:44:12 -04:00
2020-10-13 01:50:40 +08:00

ZPan

The open-source, S3-native file hosting platform.

CI codecov Release GitHub Release Docker Image License

Image bed, file sharing, and backup — powered by S3, deployed anywhere.

What is ZPan?

ZPan is a lightweight file hosting platform built on top of S3-compatible storage. Files upload directly from the client to S3, bypassing server bandwidth entirely.

Three scenarios, one platform:

  • Image Bed — Upload via PicGo / ShareX / API, get a URL instantly
  • File Sharing — Upload files, generate share links, distribute to anyone
  • File Backup — CLI agent syncs local directories to S3/R2

Deploy

Deploy via GitHub Actions with zero server management. Free tier covers personal use.

  1. Fork this repository
  2. In your fork, go to Settings → Secrets and variables → Actions and add:
    • CLOUDFLARE_ACCOUNT_ID — found on the Cloudflare dashboard sidebar
    • CLOUDFLARE_API_TOKEN — create one here with Workers Scripts:Edit and D1:Edit permissions
  3. Go to the Actions tab, select Deploy to Cloudflare Workers, and click Run workflow

After initial setup, the workflow runs automatically every time you sync your fork with the latest release.

AWS Lambda

Deploy via GitHub Actions using SAM. Lambda Function URL provides HTTPS with no API Gateway needed.

  1. Fork this repository
  2. In your fork, go to Settings → Secrets and variables → Actions and add:
    • TURSO_DATABASE_URL and TURSO_AUTH_TOKEN — from Turso (free, no credit card)
    • AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION
  3. Go to the Actions tab, select Deploy to AWS Lambda, and click Run workflow

See docs/deploy/aws-lambda.md for full setup instructions and IAM permissions.

Docker

Quick start — pull the pre-built image and bring your own S3 storage:

curl -O https://raw.githubusercontent.com/saltbo/zpan/master/deploy/docker-compose.yml
docker compose up -d

With RustFS (self-hosted S3-compatible storage, no external dependencies):

curl -O https://raw.githubusercontent.com/saltbo/zpan/master/deploy/docker-compose.rustfs.yml
docker compose -f docker-compose.rustfs.yml up -d

After startup:

  1. Open the RustFS console at http://localhost:9001 (admin / admin123) and create a bucket (e.g. zpan-bucket)
  2. Open ZPan at http://localhost:8222, register a user (first user gets admin role)
  3. Go to Admin → Storage and add the RustFS storage:
    • Endpoint: http://localhost:9000 (must be reachable from your browser, not the Docker internal hostname)
    • Bucket: the bucket name you created in step 1
    • Region: us-east-1
    • Access Key / Secret Key: admin / admin123

Important: The storage endpoint must be accessible from the client browser, since files upload directly to S3 via presigned URLs. Use http://localhost:9000 for local development, or your server's public URL for production.

Documentation

Why ZPan?

  • Zero bandwidth bottleneck — files transfer directly between client and S3
  • Zero ops option — deploy to Cloudflare Workers for free, no server needed
  • Self-host friendly — Docker deployment with any S3-compatible storage
  • Tool ecosystem — works with PicGo, ShareX, Flameshot out of the box
  • Open source — free forever for self-hosted users

v1

Looking for ZPan v1 (Go version)? See the v1 branch.

Contributing

See CONTRIBUTING.md for details.

Thank you to all the people who contributed to ZPan!

License

ZPan is under the GPL 3.0 license. See the LICENSE file for details.

S
Description
A self-hosted cloud disk base on the cloud storage./ 一个基于云存储的网盘系统,用于自建私人网盘或企业网盘。
Readme AGPL-3.0 71 MiB
Languages
TypeScript 92.7%
Go 6.5%
JavaScript 0.5%
CSS 0.1%