Add postgres, db-init, and backup services to docker-compose.
Migrate database from Neon DB to self-hosted PostgreSQL 17.
- postgres:17-alpine with healthcheck and persistent volume
- db-init: auto-restore from local dump or Backblaze B2 on first start
- backup: scheduled pg_dump with B2 upload (daily at 3am)
- Host-side scripts: backup.sh, restore.sh, cron-backup.sh
- Fixed dynamic table ownership in restore (no hardcoded table names)
- Fixed pg_restore to use docker cp instead of stdin pipe
- Add Cobalt as first download attempt in download_video; falls back to
tikwm direct then yt-dlp when Cobalt is unavailable or fails
- Reorder _direct_video_candidates from hdplay→play→wmplay to
play→wmplay→hdplay so H.264/AVC streams are preferred over H.265/HEVC,
fixing gray-frame / audio-only playback on Telegram clients
- Update test to mock _download_via_cobalt and reflect new candidate order
Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
What changed:
- unified inline media delivery across TikTok, Instagram, Pinterest, SoundCloud, YouTube, and Twitter around a single editable-message flow with chosen-inline auto start and callback fallback
- added reusable inline request state/services, service icons, album deep links, and single-message inline progress/edit helpers
- enabled inline support for regular YouTube videos, Twitter inline media, and Twitter multi-photo album deep links; aligned Pinterest/Instagram/TikTok inline behaviors
- cleaned dead duplicated inline code, extracted shared inline request guards, and expanded tests around TikTok, Pinterest, SoundCloud, and YouTube handlers
- optimized project setup with trimmed runtime requirements, requirements-dev split, .dockerignore, Docker/compose improvements, and README updates
- rebuilt logging with structured context-aware adapters, request scoped flow decorators, JSONL event/perf logs, queue/download/cobalt timing events, and safer extra field sanitization to avoid LogRecord key collisions