Files
esh-pfi-infrastructure/stacks/news-digest/.env.example
T
vh d552e289cb news-digest: per-instance cron schedule via env
Hardcoded crontab → render at container start from
DIGEST_CRON_AM + DIGEST_CRON_PM. Defaults match the original
0800 / 2000 so existing deploys are no-ops.

scripts/add-digest-user.sh learns --am and --pm flags so each
teammate's stack can fire on their hours:

  scripts/add-digest-user.sh bob --am "0 6 * * *" --pm "0 17 * * *"
  scripts/add-digest-user.sh carol --pm "30 18 * * 1-5"   # weekdays only

Standard 5-field cron syntax; busybox crond honors the container's
\$TZ. Removed the now-unused stacks/news-digest/crontab file and
the matching COPY in the Dockerfile.
2026-04-28 14:29:55 -07:00

82 lines
4.1 KiB
Bash

# news-digest stack tunables. Copy to `.env` on ana-docker before
# deploying and fill in MINIFLUX_PASSWORD.
# ── image pin ────────────────────────────────────────────────────────
# Bump when you change Dockerfile / digest.py / templates / crontab
# to force a clean image build.
NEWS_DIGEST_TAG=v1
# ── network ──────────────────────────────────────────────────────────
# Host port for the static web container (nginx). Container 80.
# Reserved on ana-docker (sample): 5001 Dockge, 7878 task-board,
# 8000 (other), 8025/8088/8090/8100/8380/8780 (various), 8080 Miniflux.
# 8181 free.
NEWS_DIGEST_PORT=8181
NEWS_DIGEST_BIND=0.0.0.0
# Timezone — busybox crond honors this for fire-times.
NEWS_DIGEST_TZ=America/Los_Angeles
# ── llama-swap (LLM summarizer) ──────────────────────────────────────
# Model picked for one-shot summarization quality + low VRAM impact.
# qwen3.5-35-a3b is loaded in the persistent group on ana-ml2.
LLAMA_SWAP_URL=http://10.250.50.54:9292
# granite-4-small — small (~4B), fast (~1s/call), no extended-thinking
# phase that eats the token budget like qwen3.x do. Plenty of capability
# for the one-sentence-tldr + one-word-tag task. To swap to a larger
# model later, ones currently working: gemma4-26b-a4b, granite-4-small.
# Avoid: qwen3.5-35-a3b (model file broken — process exits on launch),
# qwen3.6-35-a3b (defaults to thinking mode, eats budget without output).
LLAMA_SWAP_MODEL=granite-4-small
LLAMA_SWAP_TIMEOUT=180
# ── miniflux (feed source for Tech aggregators + subreddit list) ─────
# In-cluster: miniflux container is on traefik-net so we can reach it
# by container hostname. From-host fallback: http://10.250.50.70:8080
MINIFLUX_URL=http://miniflux:8080
MINIFLUX_USER=lkraven
MINIFLUX_PASSWORD=CHANGE_ME
# Category in Miniflux holding non-Reddit feeds (HN, Lobste.rs, etc).
DIGEST_MINIFLUX_TECH_CATEGORY=Tech aggregators
# ── filtering knobs ──────────────────────────────────────────────────
# Reddit: only consider posts created in the last N hours, with
# at least N upvotes and an upvote ratio above threshold.
DIGEST_REDDIT_HOURS=12
DIGEST_MIN_SCORE=50
DIGEST_MIN_RATIO=0.85
DIGEST_MAX_PER_SUB=8
# Miniflux Tech aggregators: same look-back window + cap per source.
DIGEST_MINIFLUX_HOURS=12
DIGEST_MINIFLUX_MAX=8
# Miniflux World/Local headlines (high-volume, dense list, no LLM
# summarization). Categories must exist in miniflux — see
# stacks/news-digest/seed-headlines.py for the one-shot setup.
DIGEST_MINIFLUX_WORLD_CATEGORY=World
DIGEST_MINIFLUX_LOCAL_CATEGORY=Local
DIGEST_MINIFLUX_HEADLINES_HOURS=8
DIGEST_MINIFLUX_HEADLINES_MAX=15
# Cron schedule (standard 5-field). busybox crond honors $TZ above.
# Two fires per day by convention (morning / evening); change times
# per-user to match working hours.
DIGEST_CRON_AM=0 8 * * *
DIGEST_CRON_PM=0 20 * * *
# ── output dir on host (bind-mounted) ────────────────────────────────
# Separate from /opt/docker/conf/<stack>/ to keep generated content
# distinct from config. Owned by container UID; writes are atomic.
NEWS_DIGEST_OUTPUT_DIR=/opt/docker/data/news-digest
# ── multi-tenant (optional) ──────────────────────────────────────────
# Per-user instances are deployed via scripts/add-digest-user.sh, which
# materializes a per-user .env and sets DIGEST_PROJECT to namespace
# container names + homepage labels. Leave unset for the singleton
# install — defaults preserve the original "news-digest" naming.
# DIGEST_PROJECT=digest-alice
# DIGEST_HOMEPAGE_NAME=Alice's Digest
# DIGEST_HOMEPAGE_DESC=Personal news brief for Alice