Aleksei Pavlov b02bdba4e6 fix(zero): URL-mode photo sending + static AVAILABLE_POSES (no fs check)
Problem: engine container has no mount to /var/www/zeropost-uploads/, so
fs.existsSync() always returned false. This made image_url=null for every
Zero draft, and the TG runner fell back to sendMessage (text-only, no avatar).

Fix:
  - zeroCharacter.js: drop fs.existsSync entirely; AVAILABLE_POSES is now a
    static Set synced with what's actually on uploads-server (23 poses
    including avatar/eureka/lock/gears/etc. — earlier I incorrectly thought
    there were only 10). FALLBACK_POSE = 'coffee' (more on-brand than avatar).
  - zeroNotes.js: image_url unconditionally '/uploads/zero-{pose}.webp';
    pickPose now also looks at the generated content (not only theme).
  - zeroNotesRunner.js: sendPhoto by URL (Telegram fetches the image itself).
    No more form-data/createReadStream — full URL composed from
    ZERO_PUBLIC_BASE_URL setting (default https://zeropost.ru).
  - zeroAdmin.js: ZERO_PUBLIC_BASE_URL added to CONFIG_KEYS so it's editable
    via /admin/zero settings panel.

Existing draft #1 backfilled via SQL UPDATE (pose=eureka → image_url set).
2026-06-19 12:17:53 +03:00
2026-05-30 18:27:07 +00:00

zeropost-engine

ZeroPost - zeropost-engine

S
Description
ZeroPost - zeropost-engine
Readme 953 KiB
Languages
JavaScript 100%