Adds cleanupUploads(): on startup and every hour, deletes files in
UPLOAD_DIR whose mtime is older than UPLOAD_TTL_HOURS (default 24).
Uses fs.promises + parallel stat/unlink, unref() the interval so it
never blocks process shutdown, ignore ENOENT races silently.
Storage is multer diskStorage so memory never holds a full file body,
but disk could grow without bound if uploads pile up unused. This
bounds the disk footprint without requiring a manual cron, and keeps
the 'temp upload' semantics: the URL is meant to be consumed within
the same session anyway.
README: document UPLOAD_TTL_HOURS / UPLOAD_DIR env vars, add design
note for the cleanup loop.
Adds POST /upload (multer diskStorage, max 8MB, image/* only) returning
a public URL under /uploads/* that can be passed directly to
generate_video.image_url. Uploads live in container temp storage and
are discarded on restart (no persistence, no auth).
generate_video tool description is now built at startup with the real
upload URL baked in (resolved from PUBLIC_BASE_URL env, falls back to
http://localhost:<port>) so the AI sees an exact curl command and
doesn't have to guess the host.
docker-compose: set PUBLIC_BASE_URL=https://video-gen.ai.foresh.com
README: new upload section, reverse-proxy note, FAQ entries
Translate the four strings introduced in baa04d9 (\u8c03\u6574\u90e8\u5206\u63d0\u793a\u8bcd) to clear English.
Other Chinese strings in this file (success summary, image-N labels, failure detail)
were not changed in that commit and are intentionally left untouched here.
The tool result content is consumed by AI agents (Claude/Cursor/...).
Converted four user-facing strings to clear English:
- Missing-token error message
- No-URL-in-response error message
- Success summary (added expiry note for AI to act on)
- Generation-failure error message
Code comments and tool description/describes are untouched in this commit.