Add admin config screen (issue #14)
Deploy to Dev / Deploy & Smoke Test (push) Successful in 23s
Deploy to Dev / Deploy & Smoke Test (push) Successful in 23s
Lets the photographer edit config/site.json from /dashboard instead of SSHing in and hand-editing the file. Two tiers: - Quick-edit form for the fields actually touched day to day (site title/tagline/hero, photographer bio, contact/social, Venmo username, session pricing, theme colors) - Raw JSON textarea for everything else (portfolio categories, locations, session types, Immich settings) - the form's fields are a subset of this, not a separate source of truth Backend: GET/PUT /api/admin/config, gated by the existing requireAdmin middleware (OIDC admin session or legacy ADMIN_SECRET). PUT validates the body is an object with the required top-level sections, writes atomically (temp file + rename), and keeps one prior version as site.json.bak before overwriting. Required a docker-compose.yml change: the api service had no volume mount for config/ at all before this (only portfolio/nginx did, and read-only) - added a read-write mount so the API can actually write the file the live site reads.
This commit is contained in:
@@ -39,6 +39,10 @@ services:
|
||||
- ./api/data:/app/data
|
||||
- ./api/signed-contracts:/app/signed-contracts
|
||||
- ./api/contracts:/app/contracts:ro
|
||||
# Read-write: the admin config screen (issue #14) edits site.json here.
|
||||
# Shares the same host directory the portfolio/nginx service mounts
|
||||
# read-only, so writes show up on the live site (subject to its 5-min cache).
|
||||
- ./config:/app/config
|
||||
networks:
|
||||
- web
|
||||
healthcheck:
|
||||
|
||||
Reference in New Issue
Block a user