Famous people: admin page, own prompt, one photo, public pages
- Admin "Híres emberek": birth data, one photo (S3: DigitalOcean Spaces in production, RustFS in development), a face point that every crop keeps in view, publishing, and a detailed portrait written with its own `celebrity` prompt (third person, by name, from the chart alone). - The photo is stored once (upright JPEG, at most 2000 px, no metadata); next/image makes the sizes from it, so Cloudflare can cache those. - Public list and pages (/hires-emberek), in the sitemap, with a share image showing the face and the chart. - Share images: the wheel's glyphs and numbers are drawn with the card's fonts (inside the SVG image they came out as boxes, on every card). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -83,6 +83,18 @@ A Docker által kinyitott portokat az ufw magától nem szűri, ezért a 80-as
|
||||
|
||||
A Google OAuth kliensnél a `https://sorsfonalak.hu` címet fel kell venni az engedélyezett JavaScript-források közé.
|
||||
|
||||
### Fotók: DigitalOcean Spaces (híres emberek)
|
||||
|
||||
A híres emberek fotóit a backend S3-kompatibilis tárolóba teszi, fotónként egyetlen változatot (álló JPEG, legfeljebb 2000 px, metaadatok nélkül). A tároló privát marad. A backend a `/v1/public/photos/...` címen adja ki a képet, a méretezett változatokat a Next.js képoptimalizálója készíti (`/_next/image`), és ezeket a Cloudflare cache-eli. Minden feltöltés új kulcsot kap, ezért a régi kép sosem ragad be a cache-ben.
|
||||
|
||||
- Spaces: Create → Spaces Object Storage, régió például `fra1`, név például `sorsfonalak-photos`. A File Listing legyen *Restricted*. CDN nem kell.
|
||||
- Kulcs: Spaces Object Storage → Access Keys → *Limited access*, csak erre a bucketre, *Read/Write/Delete* joggal.
|
||||
- `.env`: `S3_ENDPOINT=https://fra1.digitaloceanspaces.com`, `S3_BUCKET=sorsfonalak-photos` (a `S3_REGION` maradhat `us-east-1`).
|
||||
- `.env.secrets`: `S3_ACCESS_KEY_ID` és `S3_SECRET_ACCESS_KEY`. Utána `docker compose up -d backend`.
|
||||
- Ha nincs beállítva `S3_ENDPOINT`, minden más működik, csak fotót nem lehet feltölteni.
|
||||
- A fotók nincsenek benne a napi `pg_dump`-ban. A Spaces maga is több példányban tárol, de ha a bucketet törlik, a fotókat újra fel kell tölteni.
|
||||
- Cloudflare: Caching → Cache Rules → új szabály: *URI Path starts with `/_next/image`* → **Eligible for cache**, Edge TTL: *Use cache-control header if present*. Kiterjesztés nélküli címet a Cloudflare magától nem cache-el, a szabály nélkül minden méretet a szerver számolna újra. A Next csak WebP-t ad, ezért nem gond, hogy a Cloudflare az `Accept` fejlécet nem veszi figyelembe.
|
||||
|
||||
## Üzemeltetés
|
||||
|
||||
- Naplók élőben: `docker compose logs -f backend worker worker-ai` (ez a konténer újraindításáig/cseréjéig él).
|
||||
|
||||
@@ -105,6 +105,11 @@ services:
|
||||
FREE_PERSON_SLOTS: ${FREE_PERSON_SLOTS:-0}
|
||||
# invite: new accounts need an invitation (admin page "Meghívók"); open: anyone.
|
||||
SIGNUP_MODE: ${SIGNUP_MODE:-invite}
|
||||
# Famous people's photos: DigitalOcean Spaces (S3_ACCESS_KEY_ID and
|
||||
# S3_SECRET_ACCESS_KEY in .env.secrets). Empty S3_ENDPOINT: no uploads.
|
||||
S3_ENDPOINT: ${S3_ENDPOINT:-}
|
||||
S3_BUCKET: ${S3_BUCKET:-}
|
||||
S3_REGION: ${S3_REGION:-us-east-1}
|
||||
# The log also goes to the logs volume, one file a day, kept 30 days
|
||||
# (deploy/README.md: Logs).
|
||||
LOG_DIR: /logs
|
||||
|
||||
Reference in New Issue
Block a user