Database
All auth data is stored in a single SQLite file at/data/auth.db (configurable via DB_PATH).
On startup, scripts/secure-db.sh automatically sets the file permissions to 600 (owner read/write only).
| Table | Contents |
|---|---|
user | Accounts — passwords bcrypt-hashed |
session | Web sessions |
apiKey | API keys — hashed before storage |
account | OAuth providers |
verification | Email/phone verification tokens |
API keys
Getting your first key
- Fullstack mode (default)
- API-only mode
- Visit
/setupto create your admin account. - Go to
/api-keysin the dashboard to create your first key.
Using a key
Pass it in theAuthorization header:
Best practices
- Store keys in environment variables, never in source code.
- Create a separate key per service or environment.
- Set an expiration when creating keys (
expiresInin seconds). - Rotate keys regularly; disable unused ones promptly.
API routes
| Method | Route | Auth |
|---|---|---|
GET | / | Public |
GET | /health | Public |
GET | /t/* | Public |
GET | /download/* | Public |
GET | /authenticated/* | Public (signature-verified) |
GET | /video-status/* | Public |
GET | /video-status/*/size | Public |
GET | /video-status/stats | Public |
GET | /queue/events | Public |
GET | /health/database | Protected |
POST | /upload | Protected |
GET | /storage | Protected |
GET | /storage/*/metadata | Protected |
DELETE | /storage/* | Protected |
DELETE | /invalidate/* | Protected |
POST | /api-keys/create | Protected |
GET | /api-keys/list | Protected |
DELETE | /api-keys/:keyId | Protected |
PATCH | /api-keys/:keyId | Protected |
GET | /queue/stats | Protected |
GET | /queue/jobs | Protected |
POST | /queue/jobs/:id/retry | Protected |
POST | /queue/jobs/:id/cancel | Protected |
DELETE | /queue/jobs/:id | Protected |
GET | /queue/worker/stats | Protected |
Authorization: Bearer <API_KEY>.
Rate limiting
Public routes (/t/*, /health, etc.) are rate-limited to 100 requests per 60-second window per IP by default. Adjust with PUBLIC_RATE_LIMIT_MAX and PUBLIC_RATE_LIMIT_WINDOW_MS.
Docker security
- Containers run as the
nodeuser (non-root) to limit blast radius. - The
/datavolume should be mounted with appropriate host permissions.
Incident response
Compromised API key
Compromised API key
Database integrity check
Database integrity check
ok. If it reports errors, restore from your most recent backup and restart.Additional resources
Better Auth
Official Better Auth documentation.
API Key Plugin
Better Auth API Key plugin reference.