diff --git a/.cursor/rules/docs.mdc b/.cursor/rules/docs.mdc new file mode 100644 index 00000000..a3755c0d --- /dev/null +++ b/.cursor/rules/docs.mdc @@ -0,0 +1,5 @@ +--- +alwaysApply: true +--- + +when working with this project and adding API endpoints always document them in @API_DOCS.md \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index fdc53d7d..8ae57ee7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,7 +35,9 @@ FROM python:3.12-slim AS runtime RUN useradd -m -u 1000 toolbox && \ chown -R toolbox:toolbox /home/toolbox && \ mkdir -p /home/toolbox/.cache/huggingface && \ - chown -R toolbox:toolbox /home/toolbox/.cache/huggingface + chown -R toolbox:toolbox /home/toolbox/.cache/huggingface && \ + mkdir -p /home/toolbox/site/backend/main/data/photos && \ + chown -R toolbox:toolbox /home/toolbox/site/backend/main/data/photos USER toolbox # 3.2. Copy content diff --git a/backend/main/API_DOCS.md b/backend/main/API_DOCS.md index 144e9bce..2d29460d 100644 --- a/backend/main/API_DOCS.md +++ b/backend/main/API_DOCS.md @@ -293,4 +293,57 @@ The Toolbox.io Telegram bot provides the same support functionality as the web i ## Authentication - All protected endpoints require the `Authorization: Bearer ` header. -- JWT tokens are returned by `/api/auth/login` and must be stored securely on the client. \ No newline at end of file +- JWT tokens are returned by `/api/auth/login` and must be stored securely on the client. + +--- + +## Photo Storage Endpoints + +All `/photos/*` endpoints are under the `/photos` prefix and require authentication (`Authorization: Bearer `). + +### GET `/photos/sync` +- **Description:** List all photo UUIDs and metadata for the authenticated user (for sync). +- **Headers:** + - `Authorization: Bearer ` +- **Response:** + ```json + { + "photos": [ + {"uuid": "", "uploaded_at": "T