Commit Graph
20 Commits
Author SHA1 Message Date
Mak5er 32c4f22d09 chore(compose): restore pull_policy to always for downloader-bot 2026-09-15 00:15:25 +03:00
Mak5er 57c5050b67 docker: set downloader-bot pull_policy to missing so local builds are preserved 2026-09-15 00:10:39 +03:00
Mak5er 6fcd834383 chore(compose): set pull_policy to always for downloader-bot 2026-09-14 23:52:58 +03:00
Mak5er 635e50b407 feat(settings): add media quality & file options, ZIP multi-photo archives, and categorized /settings UI
- Add video_quality, as_document, audio_format, and file_button to user settings schema and Alembic migrations.
- Categorize /settings into Media & Quality, Appearance & Buttons, and Chat & Clean-up with dynamic back navigation.
- Implement strict document delivery with disable_content_type_detection=True to prevent Telegram video player fallback when as_document is ON.
- Add multi-photo ZIP archive packaging for photo carousels in as_document mode.
- Differentiate DB media file cache entries between video and document types (url#document vs url#video) to eliminate cache collisions.
- Hide redundant Download File inline button when as_document setting is active.
- Remove obsolete referral system (/ref command and links).
2026-07-22 13:18:09 +03:00
Mak5er 2911b8d7ba fix: mount backups as host directory instead of docker volume 2026-06-20 20:30:45 +03:00
Mak5er a0098a92e9 feat: add local PostgreSQL with automated backup/restore
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
2026-06-20 20:04:45 +03:00
Mak5er 62050a0f2c perf: comprehensive production audit and hardening (Phase 1-4)
43 files changed, 828 insertions, 408 deletions. Key changes:

== Phase 1 - Critical fixes ==
- Fix shared mutable state in ResilientDownloader (class-level _inflight_downloads)
- Add threading.Lock to request dedup (race condition on concurrent claims)
- Fix ban_middleware fail-closed: DB error -> fallback to 'active' instead of 'restricted'
- Fix COUNT(*) anti-pattern: 5 methods fetched entire user table into memory
- Remove 6 duplicated function definitions in user_messages.py (silent shadowing)
- Extract metadata from Cobalt responses (Instagram no longer discards descriptions)
- Add SSRF validation for COBALT_API_URL (private IP blocking, scheme enforcement)
- Docker: healthcheck, resource limits, restart: on-failure:5
- Fix migration crash-loop (try/except guardrails + dialect detection bug)

== Phase 2 - Performance hardening ==
- Exponential backoff+jitter in cobalt_client and retry_async_operation (removed 9 fixed delays)
- Add asyncio.wait_for timeouts to Instagram/Pinterest downloads
- TikTok preflight size check before download
- SQLAlchemy pool event listeners (perf metrics on checkout/overflow)
- DownloadedFile TTL cleanup (date_added index + daily cron cleanup)
- Per-request UUID request_id in ChatTrackerMiddleware for end-to-end tracing
- private_chat_guard caching (60s TTL, reduces Telegram API calls)
- Antiflood O(k) eviction instead of O(n) full scan
- TikTok: Semaphore(3)+sliding-window rate limiter instead of global asyncio.Lock

== Phase 3 - CI hardening ==
- CI: lint job (ruff + mypy), docker smoke tests migrations, --cov-fail-under=80
- Upgrade dependency-audit Python 3.12 -> 3.14
- Fix 7 '# type: ignore' decorators with ParamSpec
- Migration 000005: ix_analytics_events_user_id + ix_downloaded_files_date_added
- Race-condition tests for dedup, queue shutdown, per-user slots

== Phase 4 - Architecture ==
- .dockerignore (exclude .git, tests, __pycache__, .env from Docker image)
- Consolidate 3 FakeYoutubeDL/DummyYDL classes into conftest.py
- Extract _download_youtube_media() from 70-line closure
- BasePlatformMediaService ABC in services/platforms/__init__.py
- Remove empty profiling/ directory

Tests: 349 passed, 0 failed (4 skipped: PostgreSQL-dependent)
2026-06-16 01:01:06 +03:00
Mak5er 37b694c276 fix: restore youtube access helpers and migration head 2026-05-25 17:38:31 +03:00
Mak5er 77c4cda0b8 Refactor logging paths and stabilize db tests 2026-04-10 00:42:21 +03:00
Mak5er dae8cbfab9 fix: harden CI and docker deploy checks 2026-04-10 00:17:37 +03:00
Mak5er a6471eea1a Add GHCR publishing workflow
# Conflicts:
#	README.md
2026-03-14 12:30:43 +02:00
Mak5er 8adca9f43d Refactor inline delivery, cleanup dependencies, and overhaul logging
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
2026-03-13 00:18:29 +02:00
Mak5er 8052625d93 updated youtube downloading 2025-03-23 13:51:24 +02:00
Mak5er 6cc7b3df58 Update docker-compose.yml 2025-02-20 22:52:30 +02:00
Mak5er 2384078db0 added pytube custom OAuth 2024-08-24 13:51:10 +03:00
Mak5er 3bfdcb2f35 Update docker-compose.yml 2024-07-21 15:01:29 +03:00
Mak5er 3acfa1cecb Update docker-compose.yml 2024-07-21 14:45:16 +03:00
Mak5er 09c81440a1 Update docker-compose.yml 2024-07-21 14:39:37 +03:00
Mak5er 51d7e9f08f Update docker-compose.yml 2024-07-21 14:23:34 +03:00
Mak5er dfc4dfb80a add docker 2024-06-21 17:24:00 +03:00