docs(server): storage domain blueprint entry; TREK_PLACE_PHOTO_DIR tombstone clarifier

This commit is contained in:
jubnl
2026-08-20 21:37:31 +02:00
parent f014d14c9e
commit 17024381c5
2 changed files with 21 additions and 0 deletions
+1
View File
@@ -83,6 +83,7 @@ in the admin UI / `data/storage-config.json` instead): `TREK_S3_ENDPOINT`,
`TREK_S3_BUCKET`, `TREK_S3_ACCESS_KEY_ID`, `TREK_S3_SECRET_ACCESS_KEY`,
`TREK_S3_REGION`, `TREK_S3_KEY_PREFIX`, `TREK_S3_RETRIES`, `TREK_S3_TIMEOUT_MS`,
`TREK_UPLOADS_DIR` (see `storageTombstonePreconditions` in `env.ts`).
`TREK_PLACE_PHOTO_DIR` intentionally survives (documented, prod-supported) — do not tombstone it by association.
**Runtime-toggled** (read live on every access via `readEnv()` /
`RuntimeEnvService`; tests mutate these mid-lifetime):
+20
View File
@@ -125,6 +125,26 @@ tools, which never pass through an HTTP guard. In the five domains piloted for
answer 404 to anonymous callers, so the addon check must beat the 401.
- `common/demo-write.ts` — `isDemoWriteBlocked`, the demo-mode upload block. A
function and not a guard on purpose; see the gotcha below.
- `storage/` — the storage abstraction and its admin surface. `storage.types.ts`
defines the driver contract (opaque keys, no rename/append — S3 constraints
baked in) plus the `ServedCategory` seam: `STORAGE_CATEGORIES` (shared, 8,
configurable) + the legacy `photos` directory that is served and backed up
but not configurable. `drivers/` (local, s3, mirror) all pass one contract
suite (`tests/unit/nest/storage/storage-driver.contract.ts`).
`storage-registry.service.ts` merges built-ins ← env (`place-photos-local`)
← `app_settings` rows, validates semantics (references, no mirror nesting),
falls back to last-good/defaults at boot but NEVER on admin writes
(`preview()` runs the real build first), seeds once from
`data/storage-config.json`, and hot-swaps on `reload()`.
`storage.service.ts` is the facade every byte-path uses.
`storage-admin.{controller,service}.ts` (+ `storage-secrets.ts`,
`storage-probe.ts`) carry `api/admin/storage`: masked GET of the effective
world, full-document PUT (unmask → encryption gate → preview → encrypt →
one transaction → reload → audit), and per-target test probes with
ephemeral drivers. Secrets live `enc:v1:`-encrypted inside the
`storage.backends` JSON; saving plaintext secrets requires an explicit
`ENCRYPTION_KEY` (`security.encryptionKeySet`). The client presents mirrors
as replicas-on-primary; the wire keeps explicit mirror backends.
- `memories/photo-provider.ts` + `providers/` — the PhotoProvider seam (#584).
Dispatch to a photo backend was a `switch (photo.provider)` in three places
(`photo-resolver.service.ts` twice, `journey-public.controller.ts` once, where