feat(admin): issue #146 — photo upload with sharp crop/optimization (restore old behavior)

- POST /api/upload: FormData, 10MB limit, sharp resize 800px inside + webp@80, saves to /app/uploads, returns /uploads/url
- GET /uploads/[...path]: serves files with Content-Type, path traversal protected
- compose: ./uploads mounted in tg_shop_admin
- Dockerfile: /app/uploads created + chown nextjs
- catalog-page: file input + thumbnail preview + remove for photoUrl/hiddenPhotoUrl
- Bot resolvePhotoSource already supports /uploads/ paths — no bot changes
This commit is contained in:
NW
2026-08-10 09:38:31 +01:00
parent 792efc07ce
commit 301763f428
5 changed files with 176 additions and 11 deletions

View File

@@ -75,6 +75,7 @@ services:
- WG_PRESHARED_KEY=${WG_PRESHARED_KEY}
volumes:
- ./db:/app/db
- ./uploads:/app/uploads
deploy:
resources:
limits: