Fix bug pass: async offload, resource leaks, media/parse correctness, deploy hardening
bot.py: - Run all yt-dlp/ffmpeg/ffprobe/file-IO/base64 work off the event loop via asyncio.to_thread, bounded by a Semaphore(2); the loop no longer freezes bot-wide during downloads/encodes. - download_attachments=False; VideoTracker fetches only video attachments lazily instead of the library base64-ing every attachment of every message. - last_video keyed per (group, sender) with group-latest fallback so /speed and /rev stop silently targeting a stranger's video; proactive TTL sweeps free the big base64 blobs and bound recent_urls growth. - _reencode guards 0/NaN ffprobe duration and adds -maxrate/-bufsize; /rev now size-checks + re-encodes + faststart like the other paths. - Twitter URL regex no longer merges space-separated links (keeps i/web/status); dedupe repeated URLs within a message; mark-handled only on success/no-media so a corrective edit can retry; 'unsupported url' surfaced instead of silently dropped. - All sends wrapped (catch SendMessageError); base64 decode guarded; edit/sync attachment envelopes handled; /cookies temp file created 0600. deploy: - Pin signalbot==1.1.0, yt-dlp floor, add missing yt-dlp-ejs. - Pin signal-cli-rest-api by digest + add /v1/health healthcheck. - Restart=always (the library never exits non-zero when wedged). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+11
-1
@@ -1,6 +1,10 @@
|
||||
services:
|
||||
signal-cli-rest-api:
|
||||
image: bbernhard/signal-cli-rest-api:latest
|
||||
# Pinned by digest so a re-pull/recreate can't silently swap in a build with
|
||||
# a protocol change (the getServerGuid-style breakage). This digest is
|
||||
# signal-cli-rest-api with signal-cli 0.100 (build 2). Upgrade deliberately:
|
||||
# `docker pull bbernhard/signal-cli-rest-api:latest`, test, then update this.
|
||||
image: bbernhard/signal-cli-rest-api@sha256:2399d449123cdad56c4d859277e3b9127e1a00c4d2ab4601c239882609286cf8
|
||||
container_name: signal-cli-rest-api
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
@@ -9,3 +13,9 @@ services:
|
||||
- "127.0.0.1:8080:8080"
|
||||
volumes:
|
||||
- ./signal-cli-data:/home/.local/share/signal-cli
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:8080/v1/health"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
|
||||
Reference in New Issue
Block a user