Skip to content

Harris-H/courier

Repository files navigation

Courier 📬

A lightweight personal news digest bot — fetch, summarize, and push, all in one go.

中文文档

Features

  • 📰 Multi-source Fetching: Hacker News / Reddit / RSS (with RSSHub support)
  • 🤖 LLM-powered Summarization: Generate daily digests via OpenAI-compatible APIs
  • 📮 Multi-channel Push: Telegram / Feishu (Lark) / Email (SMTP with Markdown→HTML rendering)
  • Cron Scheduling: Flexible cron expression configuration
  • 💬 Chat Mode: Interactive conversations via Telegram bot
  • 🖥️ Web Dashboard: Vue.js-based management panel with real-time status
  • 🔄 Hot-reload Config: Update email, channel, and LLM settings without restarting
  • 🔒 Security: Optional API key authentication, sensitive data masking, input validation

Architecture

Source(HN/Reddit/RSS) → LLM(Summarize) → Channel(TG/Feishu/Email)
         ↑                                        ↑
         └──────── Scheduler(Cron) ───────────────┘
                        + Chat Mode
                        + Web Dashboard (Hot-reload)

Tech Stack

Component Technology
Backend Rust, Tokio, Axum
Frontend Vue 3, TypeScript, Tailwind CSS, Vite
Database SQLite (rusqlite)
LLM OpenAI-compatible API (async-openai)
Bot Teloxide (Telegram)
Email Lettre (SMTP), pulldown-cmark (Markdown→HTML)

Quick Start

Prerequisites

  • Rust 1.70+ (with Cargo)
  • Node.js 18+ (for frontend development)

1. Configure

cp config.example.toml config.toml
# Edit config.toml with your API keys and preferences

2. Run

cargo run --release

The dashboard will be available at http://localhost:9090.

3. Docker

# Build frontend first
cd web && npm install && npm run build && cd ..

# Build and run
docker build -t courier .
docker run -d \
  --name courier \
  -p 9090:9090 \
  -v ./config.toml:/app/config.toml:ro \
  -v courier_data:/app/data \
  -e TZ=Asia/Shanghai \
  courier

Configuration

See config.example.toml for all available options.

Supported LLM Models

Model ID Name Provider
doubao-seed-2-0-lite-260215 Doubao Seed 2.0 Lite (default) Volcengine (ARK)
glm-4-7-251222 GLM-4.7B Zhipu AI
deepseek-v3-2-251201 DeepSeek V3.2 DeepSeek
kimi-k2-thinking-251104 Kimi K2 Thinking Moonshot AI

Key Configuration Sections

  • Sources: Enable/disable HN, Reddit, RSS with per-source settings
  • LLM: API endpoint, model selection, custom prompts
  • Channels: Telegram bot token, Feishu webhook, Email SMTP
  • Schedules: Multiple cron jobs with different source/channel combinations

Timezone

Cron expressions are interpreted according to the timezone setting in [general]:

[general]
timezone = "Asia/Shanghai"  # Cron expressions use this timezone

If not specified, defaults to "UTC". With the above setting, cron = "0 0 10 * * *" triggers at 10:00 AM Beijing time.

Log timestamps also follow the TZ environment variable set in your Docker environment.

Note: The timezone config controls cron scheduling. The TZ environment variable (set in docker-compose.yml) controls log output timestamps. Make sure both are consistent.

Security

Courier supports optional API key authentication for the dashboard. Add the following to your config.toml:

[general]
api_key = "your-secret-api-key"

When configured, all API requests must include a Authorization: Bearer <api_key> header. If api_key is not set or empty, the dashboard is accessible without authentication.

Sensitive information (webhook URLs, API endpoints) is automatically masked in API responses, showing only the domain (e.g., https://example.com/*****).

Dashboard

The web dashboard provides:

  • 📊 Overview: Uptime, task count, success rate
  • Task Management: Edit schedules, rename tasks, switch push channels, trigger manual runs
  • 📋 Execution History: View past digests with expandable content
  • ⚙️ Configuration: Switch LLM models, adjust max tokens, configure email SMTP, update channel settings — all with hot-reload (no restart needed)

Email Channel

Courier supports sending digests via email with rich HTML rendering:

  • SMTP configuration via web dashboard (host, port, username, password, from, to)
  • Markdown content is automatically converted to styled HTML emails
  • Smart "from" address: provide just a display name and it auto-constructs "Name <smtp_username>"
  • Password security: never exposed in API responses, only has_password flag is returned
  • Hot-reload: enable/disable and update settings without restarting

Deployment

See DEPLOY.md for detailed Docker deployment instructions.

License

MIT

About

A lightweight personal news digest bot — fetch, summarize, and push

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors