From 4e82d60cbc96995a67f2b2b6306b5ac0f975b66a Mon Sep 17 00:00:00 2001 From: pedro-bento Date: Sun, 4 Oct 2026 17:25:17 +0100 Subject: [PATCH] fix: harden Postiz integration and align docs/CLI/n8n after review - Postiz URL is now required (no built-in host); a key can never be sent to a default instance - /api/postiz/scheduled normalizes scheduled_date and widens the default window - Disabled channels are refused for posting; frontend excludes them from connected platforms - 4xx instead of 500 on missing clip URL / bad schedule date; Postiz error bodies truncated - Add tests/test_postiz.py (24 tests); fix remaining cloud-removal test drift - CLI defaults to localhost:8000; n8n workflows fixed against the real routes - Remove dead media-token auth code, stale copy (download_url/402) and doc drift --- .env.example | 28 +- CLAUDE.md | 10 +- README.md | 6 +- app.py | 91 +++++-- cli/README.md | 4 +- cli/openshorts_cli.py | 11 +- dashboard/seo/landing-fallback.js | 2 +- dashboard/seo/pages.js | 8 +- dashboard/src/App.jsx | 85 ++++-- dashboard/src/Landing.jsx | 4 +- dashboard/src/components/ResultCard.jsx | 113 ++------ dashboard/src/components/ThumbnailStudio.jsx | 4 +- dashboard/src/main.jsx | 2 +- docs/compliance/retencion.md | 1 - examples/n8n/README.md | 25 +- examples/n8n/openshorts-clip-and-notify.json | 15 +- examples/n8n/openshorts-content-machine.json | 180 ++++++------- media_auth.py | 147 +---------- postiz.py | 29 +- restoring_static.py | 39 ++- skills/openshorts/README.md | 2 +- skills/openshorts/SKILL.md | 5 +- skills/openshorts/reference.md | 5 +- tests/test_audit_hardening.py | 30 +-- tests/test_postiz.py | 263 +++++++++++++++++++ tests/test_rerender_endpoint.py | 4 +- tests/test_restoring_static.py | 9 - 27 files changed, 607 insertions(+), 515 deletions(-) create mode 100644 tests/test_postiz.py diff --git a/.env.example b/.env.example index 8bcc541..a35ed09 100644 --- a/.env.example +++ b/.env.example @@ -7,9 +7,6 @@ AWS_S3_BUCKET=your-bucket-name # YouTube cookies (optional — paste Netscape-format cookies to bypass bot detection) # YOUTUBE_COOKIES=... -# Local dev: show the full pipeline logs (yt-dlp/ffmpeg/debug) in the UI. -# DEBUG_LOGS=true - # Pre-flight quality gate: warn before processing a YouTube source below this # height (720p default; 0 disables). Only applies to URL sources. # QUALITY_GATE_MIN_HEIGHT=720 @@ -71,14 +68,11 @@ GEMINI_IMAGE_MODEL=gemini-3.1-flash-image # absolute clip URLs in webhook payloads. # PUBLIC_API_URL=https://your-host -# /videos and /thumbnails are authenticated endpoints, not static mounts. -# MEDIA_TOKEN_TTL_SECONDS: life of the per-user token the dashboard appends to -#