Commit graph

9 commits

Author SHA1 Message Date
Vadym Samoilenko
866ff126d7 fix: nginx client_max_body_size 100M + silent 429 fallback
nginx inside the Docker container defaults to 1MB body limit —
base64 image payloads exceed this and return a 413 HTML page,
causing the "Unexpected token '<'" JSON parse error on video_api.php.

Gemini 429 rate limit errors on prompt optimization now fall back
silently instead of surfacing an error to the user.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 18:21:36 +01:00
Vadym Samoilenko
53c4e9f8a3 fix: GD safety check + zlib-dev for robust Alpine build
- video_api.php: check function_exists('imagecreatefromstring') before calling GD
  — undefined function causes PHP fatal error even with @ suppressor, kills php-fpm
- Dockerfile: add zlib-dev (required for libpng on some Alpine versions)
- Dockerfile: verify GD loaded after install (build log confirmation)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 18:09:54 +01:00
Vadym Samoilenko
e43432e08c fix: correct Kling and Veo API parameter formats
Kling:
- camera_control.type: use preset name directly (down_back etc.), not 'predefined'
- camera_control.config: all 6 integer fields required even for preset types
- duration: cast to integer (API rejects strings)
- I2V images: use image_url/image_tail_url with data URI prefix (not plain base64 in image/image_tail)

Veo:
- image/lastFrame: use inlineData format (Gemini API), not bytesBase64Encoded (Vertex AI)
- durationSeconds: send as string "4"/"6"/"8", not integer

Docker:
- Add uploads.ini: post_max_size=100M, upload_max_filesize=100M, memory_limit=512M
  (ini_set cannot override these at runtime in php-fpm)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 17:59:56 +01:00
Vadym Samoilenko
3f10b53f9c fix: add GD extension, fix Kling video URLs and undefined variable
- Dockerfile: install GD (libpng + libjpeg) for Veo I2V image resizing
- Dockerfile: create generated_videos/ dir with write permissions
- kling_api.php: fix video URL /generated_videos/ → /lux-studio/api/generated_videos/ (nginx couldn't find files at old path)
- kling_api.php: fix undefined \$path → \$endpoint in error log

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 17:27:12 +01:00
Vadym Samoilenko
8c91232f30 fix: overwrite .env.production with .env.optical in Docker build
Vite loads .env.production with higher priority than .env in production
mode — optical URLs were being overridden by ai-sandbox values.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 16:30:26 +01:00
Vadym Samoilenko
498b667903 fix: copy PHP files before composer install (classmap needs them)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 16:20:41 +01:00
Vadym Samoilenko
234b13ee31 fix: use --no-security-blocking for older composer version
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 16:20:02 +01:00
Vadym Samoilenko
5591d46397 fix: skip composer audit for firebase/php-jwt advisory (SSO disabled)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 16:19:12 +01:00
Vadym Samoilenko
03671abcaa feat: add Docker setup for optical-prod deployment
Multi-stage Dockerfile (node:20 builder + php:8.2-fpm-alpine runtime),
nginx serving frontend SPA + PHP-FPM backend at /lux-studio/, supervisord
managing both processes. docker-compose.prod.yml on port 8085, .env.optical
mounted read-only, uploads in a named volume.
Apache include at deploy/apache-lux-studio.conf proxies /lux-studio/ → :8085.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 16:13:52 +01:00