Four related fixes after Pete flooded a channel and ignored Ctrl-C: 1. Global daily cap (posting.daily_cap_total, default 5): hard ceiling on posts across ALL channels in a rolling 24h window. Checked before the per-channel min-interval and burst-cap. 2. Shutdown no longer flushes the queue. Previous drainAll posted every remaining item with rate limits disabled — which was literally the flood. Replaced with dropOnShutdown that clears queues and logs the count. 3. Poller respects ctx mid-loop. pollOnceWithErr now takes ctx and bails between items, so Ctrl-C doesn't have to wait for ~30s of network per pending story before shutdown can complete. 4. Double-image fix. PostStory now reports imageSent; the queue clears ImageURL before retry so a text-send failure after a successful image upload doesn't re-post the image.
86 lines
2.2 KiB
YAML
86 lines
2.2 KiB
YAML
matrix:
|
|
homeserver: "https://matrix.example.org"
|
|
user_id: "@pete:matrix.example.org"
|
|
password: "${PETE_PASSWORD}"
|
|
pickle_key: "${PETE_PICKLE_KEY}"
|
|
display_name: "Pete"
|
|
data_dir: "./data"
|
|
admin_room: "!adminroomid:matrix.example.org"
|
|
channels:
|
|
tech: "!techroomid:matrix.example.org"
|
|
politics: "!politicsroomid:matrix.example.org"
|
|
gaming: "!gamingroomid:matrix.example.org"
|
|
|
|
ollama:
|
|
base_url: "http://localhost:11434"
|
|
model: "gemma4:27b"
|
|
timeout_seconds: 30
|
|
|
|
posting:
|
|
min_interval_seconds: 300
|
|
burst_cap_count: 3
|
|
burst_cap_window_seconds: 1800
|
|
daily_cap_total: 5 # hard global cap across ALL channels (rolling 24h); 0 disables
|
|
|
|
storage:
|
|
db_path: "./data/pete.db"
|
|
recent_window_hours: 24
|
|
classification_log_days: 7
|
|
|
|
sources:
|
|
- name: "The Guardian — World"
|
|
feed_url: "https://www.theguardian.com/world/rss"
|
|
tier: 1
|
|
poll_interval_minutes: 20
|
|
feed_hint: "politics"
|
|
direct_route: "politics"
|
|
enabled: true
|
|
|
|
- name: "The Guardian — Technology"
|
|
feed_url: "https://www.theguardian.com/technology/rss"
|
|
tier: 1
|
|
poll_interval_minutes: 20
|
|
feed_hint: "tech"
|
|
direct_route: null
|
|
enabled: true
|
|
|
|
- name: "The Guardian — Politics"
|
|
feed_url: "https://www.theguardian.com/politics/rss"
|
|
tier: 1
|
|
poll_interval_minutes: 20
|
|
feed_hint: "politics"
|
|
direct_route: "politics"
|
|
enabled: true
|
|
|
|
- name: "The Guardian — US News"
|
|
feed_url: "https://www.theguardian.com/us-news/rss"
|
|
tier: 1
|
|
poll_interval_minutes: 20
|
|
feed_hint: "politics"
|
|
direct_route: "politics"
|
|
enabled: true
|
|
|
|
- name: "Ars Technica"
|
|
feed_url: "https://feeds.arstechnica.com/arstechnica/index"
|
|
tier: 1
|
|
poll_interval_minutes: 20
|
|
feed_hint: "tech"
|
|
direct_route: null
|
|
enabled: true
|
|
|
|
- name: "Ars Technica — Policy"
|
|
feed_url: "https://feeds.arstechnica.com/arstechnica/tech-policy"
|
|
tier: 1
|
|
poll_interval_minutes: 20
|
|
feed_hint: "tech+politics"
|
|
direct_route: null
|
|
enabled: true
|
|
|
|
- name: "Time Extension"
|
|
feed_url: "https://www.timeextension.com/feeds/news"
|
|
tier: 1
|
|
poll_interval_minutes: 20
|
|
feed_hint: "gaming"
|
|
direct_route: "gaming"
|
|
enabled: true
|