Remote workers, Postgres and S3, all chosen by configuration. - Pull-based worker protocol over HTTP: claim (long poll), heartbeat, complete, fail, upload, source, probe. Workers need no inbound ports - cmd/worker: standalone stateless worker with health endpoint and scheduled yt-dlp self-update - Per-worker bearer tokens, stored hashed, revocable; identity always taken from the token; actions only on jobs the worker holds a lease for - Tags: site_tags routes a site's jobs and lookups to workers that carry the required tags - Drain, /workers, /ytdlp update, and "core worker add|revoke|list" - Link lookups can run on remote workers (PROBE_MODE), so the core needs no yt-dlp and no residential address - Postgres backend with pgx, same schema and queries; per-user advisory lock and job row lock where SQLite's serial writes were relied on - The whole test suite runs on SQLite and on Postgres - S3 storage backend with presigned worker uploads, sharing a conformance suite with the local backend - Dockerfile with core, worker and faketelegram targets, docker-compose with optional Postgres and local Bot API server, systemd units - deploy/acceptance/kill-worker.sh: kills a worker mid-job and checks that the other one delivers the file - Fixes found on the way: /cancel could let the next playlist item start; a refund note could be missing when the sweep refunded first Docker was not available on the build machine: the compose files were validated with "docker compose config" only. The acceptance scenario was run with real processes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
34 lines
1.0 KiB
Bash
34 lines
1.0 KiB
Bash
# Configuration of a standalone worker (the "worker" binary). Copy to .env
|
|
# on the worker machine. A worker needs nothing from the core's .env.
|
|
# See docs/WORKERS.md.
|
|
|
|
# Base URL of the core. Use https across the internet.
|
|
CORE_URL=https://bot.example.com
|
|
# This worker's token, from "core worker add <name>" on the core.
|
|
WORKER_TOKEN=
|
|
|
|
# What this worker can do or where it runs, for example residential,eu.
|
|
WORKER_TAGS=
|
|
# Downloads at the same time.
|
|
WORKER_CONCURRENCY=2
|
|
# Scratch space. Each worker process needs its own directory.
|
|
WORKER_TEMP_DIR=data/worker-tmp
|
|
# Link lookups running next to the downloads.
|
|
WORKER_PROBE_SLOTS=2
|
|
# Must be well under the core's QUEUE_LEASE (30s by default).
|
|
WORKER_HEARTBEAT=10s
|
|
# Local health endpoint, or "off".
|
|
WORKER_HEALTH_LISTEN=:8081
|
|
|
|
YTDLP_PATH=yt-dlp
|
|
FFMPEG_PATH=ffmpeg
|
|
# Added to every yt-dlp call, for example a proxy.
|
|
YTDLP_EXTRA_ARGS=
|
|
# How often yt-dlp updates itself. 0 turns it off.
|
|
YTDLP_AUTO_UPDATE=24h
|
|
DOWNLOAD_TIMEOUT=30m
|
|
PROBE_TIMEOUT=45s
|
|
|
|
LOG_LEVEL=info
|
|
LOG_FORMAT=json
|