Self-registration is now controlled at runtime from the admin panel rather
than at build time via an env var. Default: off.
- New `settings` table (key/value/updated_at) plus getSetting/setSetting
helpers. Idempotent first-boot migration seeds allow_self_registration
from the ALLOW_SELF_REGISTRATION env var; after first boot the env var
is ignored and admins control the toggle from the UI.
- New public GET /api/auth/config (no auth) — returns
{ allowSelfRegistration, hasUsers }. The Login page polls this on mount
to decide whether to show a Register link, and to render
"Create the first admin account" mode when the install is empty.
- New admin GET /api/admin/settings + PUT /api/admin/settings/:key for
the dashboard. Constrained to a known-keys allowlist with type coercion
so unrecognized keys can't be stored.
- POST /api/auth/register now reads the toggle from the database instead
of process.env. The first user is still always allowed and is auto-
promoted to admin.
- Admin.tsx grows a "Settings" card with a labelled toggle switch and
toast feedback. The card sits above the user table.
- VITE_ALLOW_SELF_REGISTRATION dropped — runtime fetch replaces it.
Docs: README + .env.example clarify that ALLOW_SELF_REGISTRATION is now
an initial seed only, the going-public checklist points at the dashboard
toggle, and the features list calls out runtime control.
53 lines
1.7 KiB
YAML
53 lines
1.7 KiB
YAML
services:
|
|
minio:
|
|
image: minio/minio:latest
|
|
container_name: refboard-minio
|
|
command: server /data --console-address ":9001"
|
|
environment:
|
|
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY:-minioadmin}
|
|
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY:-minioadmin}
|
|
ports:
|
|
- "9000:9000" # S3 API
|
|
- "9001:9001" # Web console
|
|
volumes:
|
|
- ./.docker-data/minio:/data
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
refboard:
|
|
build: .
|
|
container_name: refboard
|
|
depends_on:
|
|
minio:
|
|
condition: service_healthy
|
|
environment:
|
|
PORT: 8000
|
|
NODE_ENV: ${NODE_ENV:-production}
|
|
JWT_SECRET: ${JWT_SECRET:?JWT_SECRET must be set in .env}
|
|
JWT_EXPIRES_IN: ${JWT_EXPIRES_IN:-7d}
|
|
DB_PATH: /app/data/refboard.db
|
|
MINIO_ENDPOINT: minio
|
|
MINIO_PORT: 9000
|
|
MINIO_USE_SSL: "false"
|
|
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY:-minioadmin}
|
|
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY:-minioadmin}
|
|
MINIO_BUCKET: ${MINIO_BUCKET:-refboard}
|
|
PUBLIC_URL: ${PUBLIC_URL:-}
|
|
MAX_FILE_SIZE_MB: ${MAX_FILE_SIZE_MB:-200}
|
|
CORS_ORIGIN: ${CORS_ORIGIN:-*}
|
|
SEED_ADMIN_EMAIL: ${SEED_ADMIN_EMAIL:-}
|
|
SEED_ADMIN_PASSWORD: ${SEED_ADMIN_PASSWORD:-}
|
|
SEED_ADMIN_USERNAME: ${SEED_ADMIN_USERNAME:-}
|
|
SEED_ADMIN_DISPLAY_NAME: ${SEED_ADMIN_DISPLAY_NAME:-}
|
|
ALLOW_SELF_REGISTRATION: ${ALLOW_SELF_REGISTRATION:-false} # initial seed only; toggle lives in /admin
|
|
REFBOARD_API_KEY: ${REFBOARD_API_KEY:-}
|
|
ports:
|
|
- "8000:8000"
|
|
volumes:
|
|
- ./.docker-data/refboard:/app/data
|
|
restart: unless-stopped
|