Commit Graph
12 Commits
Author SHA1 Message Date
saltboandCopilot 0137f009d4 feat(docker): add deploy variants and auto-generate auth secret
- Add --external better-sqlite3 to tsup build to fix ESM runtime error
- Add docker-entrypoint.sh to auto-generate BETTER_AUTH_SECRET if not set
- Persist generated secret to /data/.auth_secret across restarts
- Move image-based compose files to deploy/ directory
- Add deploy/docker-compose.rustfs.yml for ZPan + RustFS setup
- Keep build-from-source docker-compose.yml at project root

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-21 10:41:24 -04:00
saltboandClaude Opus 4.6 6c8f042948 feat: auto-configure GitHub OAuth in db-reset seed script
Reads GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET from .dev.vars
and inserts the OAuth provider config into system_options during
database reset, so GitHub login works out of the box locally.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 15:27:32 -04:00
4a5fbb7f4a feat(auth): add dynamic OAuth provider system (#282)
* feat(auth): add dynamic OAuth provider system

Admin can configure OAuth/OIDC providers in the database via API.
All 35 built-in better-auth providers are registered as async functions
that read config from system_options at runtime. Custom OIDC providers
use the genericOAuth plugin with configs loaded at auth init time.

New endpoints:
- GET /api/auth-providers (public, enabled only, no secrets)
- GET /api/auth-providers/admin (admin, all configs, masked secrets)
- PUT /api/auth-providers/admin/:providerId (admin, upsert)
- DELETE /api/auth-providers/admin/:providerId (admin, remove)

Agent-Profile: https://agent-kanban.dev/agents/a6bb038c4226a87f
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: async createTestApp compat in email and invite test files

createAuth became async in the OAuth PR, which made createTestApp async.
Email and invite code test files need await + Awaited<> type wrappers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Bob <aibob@mails.agent-kanban.dev>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-12 21:46:11 -04:00
saltboandClaude Opus 4.6 33ca372bdb fix(dev): fix D1 local database name and add db:migrate:d1 script
db-reset.ts referenced non-existent 'zpan-db-local'; update to
'zpan-db-staging' with --env staging to match wrangler.toml. Add
npm run db:migrate:d1 shortcut and update CONTRIBUTING.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 14:50:13 -04:00
Jasper VanandBob 689d9cc74f refactor: remove custom filePath, enforce tenant-isolated storage path (#278)
* refactor: remove custom filePath, enforce tenant-isolated storage path

Replace user-customizable filePath template with a hardcoded
tenant-isolated pattern ($ORG_ID/$UID/$NOW_DATE/$RAND_16KEY$RAW_EXT).
This ensures proper tenant isolation and removes unnecessary complexity.
The DB column is preserved to avoid migration; code simply stops
reading/writing it.

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

* refactor: clean up dead tokens, locale keys, and simplify path template

Remove unused template tokens ($UUID, $RAW_NAME, $NOW_YEAR, $NOW_MONTH,
$NOW_DAY) and corresponding TemplateVars fields (uuid, rawName) since
the hardcoded template doesn't use them. Remove orphaned i18n keys for
fieldFilePath. Update DB schema default to empty string. Add storage
service unit tests.

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

---------

Co-authored-by: Bob <aibob@mails.agent-kanban.dev>
2026-04-12 14:09:29 -04:00
saltboandClaude Opus 4.6 877ef9d212 refactor(deploy): inline staging env detection into npm build script
Move CLOUDFLARE_ENV logic from ci-build.sh into package.json build
script. Workers Builds can use default build command (npm run build)
without custom Dashboard configuration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 13:14:23 -04:00
saltboandClaude Opus 4.6 abba373dcc feat(deploy): auto-select staging env for non-production branch builds
Add ci-build.sh that checks WORKERS_CI_BRANCH to set CLOUDFLARE_ENV.
Non-master branches automatically build with staging config (staging D1).

Workers Builds Dashboard config:
- Build command: sh scripts/ci-build.sh
- Deploy command: npx wrangler deploy
- Version command: npx wrangler versions upload

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 13:12:50 -04:00
saltboandClaude Opus 4.6 3b80eff413 feat: migrate from CF Pages to Workers with one-click deploy button
- Replace Pages Functions with Workers entry (`workers/bootstrap.ts`)
- Add Deploy to Cloudflare button in README
- Integrate `@cloudflare/vite-plugin` for CF dev with HMR
- Integrate `@hono/vite-dev-server` for Node dev with HMR
- `npm run dev` now defaults to CF Workers mode
- Add `run_worker_first = ["/api/*"]` so static assets stay free
- Extract shared Node bootstrap (`server/bootstrap.ts`) for reuse
- Update all docs from Pages to Workers references

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 10:40:15 -04:00
saltboandClaude Opus 4.6 3d14f3ceae chore(dev): enhance db:reset for D1 local and add top-level D1 binding
- db:reset script supports --pages flag to reset D1 local database
- Added db:reset:pages npm script
- Added top-level D1 binding in wrangler.toml for local dev
- Standardized dev env var names in .dev.vars

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 23:52:24 -04:00
saltboandClaude Opus 4.6 bce4da3ebf feat(quota): add default org quota with admin settings UI and db:reset script
New users get a 10MB default storage quota (configurable via admin settings).
Admin can set the default in Settings with MB/GB unit selector. Added db:generate,
db:migrate, and db:reset scripts; dev server now reads .dev.vars automatically.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 23:37:54 -04:00
saltbo ff286a824d feat: update the code by the goproject template 2020-08-07 00:33:37 +08:00
saltbo 99d6e46a42 chore: add scripts to build and release 2019-10-27 11:29:04 +08:00