Deep audit identified 106 findings; 102 fixed, 4 deferred. Covers 8 areas: - Settings & deploy: env-gated DEBUG/SECRET_KEY, HTTPS headers, gunicorn, celery worker - Auth (registered_user): password write_only, request.data fixes, transaction safety, proper HTTP status codes - Workout app: IDOR protection, get_object_or_404, prefetch_related N+1 fixes, transaction.atomic - Video/scripts: path traversal sanitization, HLS trigger guard, auth on cache wipe - Models (exercise/equipment/muscle/superset): null-safe __str__, stable IDs, prefetch support - Generator views: helper for registered_user lookup, logger.exception, bulk_update, transaction wrapping - Generator core (rules/selector/generator): push-pull ratio, type affinity normalization, modality checks, side-pair exact match, word-boundary regex, equipment cache clearing - Generator services (plan_builder/analyzer/normalizer): transaction.atomic, muscle cache, bulk_update, glutes classification fix Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
56 lines
1.4 KiB
YAML
56 lines
1.4 KiB
YAML
services:
|
|
db:
|
|
image: postgres:14
|
|
restart: unless-stopped
|
|
volumes:
|
|
- /mnt/user/downloads/werkout_api/postgres:/var/lib/postgresql/data
|
|
environment:
|
|
- POSTGRES_DB=werkout
|
|
- POSTGRES_USER=postgres
|
|
- POSTGRES_PASSWORD=postgres
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
web:
|
|
build: .
|
|
restart: unless-stopped
|
|
volumes:
|
|
- /mnt/user/downloads/werkout_api/media:/code/media
|
|
ports:
|
|
- "8001:8000"
|
|
- "3010:3000"
|
|
environment:
|
|
- DATABASE_URL=postgres://postgres:postgres@db:5432/werkout
|
|
- REDIS_URL=redis://redis:6379
|
|
- SECRET_KEY=${SECRET_KEY:-insecure-dev-secret-key-change-in-production}
|
|
- DEBUG=${DEBUG:-true}
|
|
- ALLOWED_HOSTS=${ALLOWED_HOSTS:-*}
|
|
- CORS_ALLOWED_ORIGINS=${CORS_ALLOWED_ORIGINS:-}
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_started
|
|
|
|
redis:
|
|
image: redis:alpine
|
|
restart: unless-stopped
|
|
|
|
celery:
|
|
build:
|
|
context: .
|
|
restart: unless-stopped
|
|
command: celery -A werkout_api worker -l info
|
|
environment:
|
|
- DATABASE_URL=postgres://postgres:postgres@db:5432/werkout
|
|
- REDIS_URL=redis://redis:6379
|
|
- SECRET_KEY=${SECRET_KEY:-insecure-dev-secret-key-change-in-production}
|
|
- DEBUG=${DEBUG:-true}
|
|
depends_on:
|
|
- db
|
|
- redis
|
|
- web
|