Commit Graph

7 Commits

Author SHA1 Message Date
b5f5745107 docs: add README with full API and database documentation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 13:47:31 +02:00
0f35459b86 feat: pictures table, Hetzner S3 upload/delete, auto-migration
- pictures table with UUID, status enum, timestamps, blurhash, design
- Auto-trigger updates updated_at on every row change
- POST /api/pictures/:id/upload  → upload file to Hetzner snakkimo bucket
- DELETE /api/pictures/:id       → removes DB row + Hetzner file
- PATCH /api/pictures/:id        → auto-sets published/blocked timestamps
- Migration runs on every server start (idempotent)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 13:39:16 +02:00
b82a468197 fix: add Docker native HEALTHCHECK, replaces broken Coolify HTTP check
Coolify's HTTP health check hits localhost:3000 from the host — but the
container port is only reachable inside the Docker network via Traefik.
Docker's own HEALTHCHECK runs inside the container where localhost works.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 11:38:55 +02:00
7921929f73 feat: add Bearer token authentication
All /api/* routes require Authorization: Bearer <token>.
Tokens are configured via API_TOKENS env var (comma-separated for multiple).
/health remains public for Coolify health checks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 11:22:45 +02:00
fc35e265b2 fix: prevent container crash on DB error, fix health check
- Remove process.exit(-1) on pool error — a DB blip killed the whole container
- Health check now always returns 200 so Coolify doesn't mark it unhealthy
  when PostgreSQL is temporarily unreachable

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 10:04:52 +02:00
69f7962518 add package-lock.json for npm ci in Dockerfile
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 10:00:31 +02:00
ab720b09d0 Initial setup: snakkimo API server with PostgreSQL connection
Node.js/Express API server that connects to PostgreSQL via environment variables.
Includes health check, table listing, row queries, and raw SQL endpoint.
Designed for deployment in Coolify alongside the snakkimo PostgreSQL container.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 09:02:31 +02:00