A highly customizable, production-ready RSS to Telegram bot with persistent message queue, rate limiting, and advanced content processing capabilities.
- Persistent Message Queue - SQLite-backed queue with automatic crash recovery
- Rate Limiting - Sequential message processing with configurable delay (p-queue)
- First Run Detection - Silently saves history on initial setup to avoid flooding
- Queue Monitoring - Track pending task count in real time
- Auto Cleanup - Periodic cleanup of completed tasks and expired history
- Media Embedding - Automatic image/video extraction from RSS content
- Template Engine - Nunjucks-powered message templates
- Content Filtering - Regex-based include/exclude filters with remote URL support
- Remote Filter Lists - Fetch filter patterns from URLs with optional function transforms
- Content Rules - Transform RSS fields with regex or custom functions
- Proxy Support - HTTP/HTTPS proxy with authentication (via Bun native fetch)
- Cloudflare Bypass - FlareSolverr integration for protected feeds
- Intranet Detection - Automatic proxy bypass for local network feeds
- RSS Monitoring - Telegram notifications for invalid/expired RSS links
- Structured Logging - Winston-based logging with daily rotation
- Database Persistence - All tasks and history stored in SQLite
- Type Safety - Full TypeScript with Zod schema validation
-
Install Docker
-
Create
docker-compose.yaml:services: fr2t: image: ghcr.io/apocalypsor/fr2t container_name: fr2t restart: always volumes: - ./data:/app/config - ./logs:/app/logs
-
Configure RSS and Bot:
- Copy sample configs from docs to
./data/ - Create
./data/config.yaml(see Configuration) - Create
./data/rss.yaml(see RSS Configuration)
- Copy sample configs from docs to
-
Start the service:
docker-compose up -d
# Install Bun (if not installed)
curl -fsSL https://bun.sh/install | bash
# Install dependencies
bun install
# Start development server with hot reload
bun run dev
# Run production
bun start# Cleanup interval (days)
expireTime: 30
# RSS check interval (minutes)
interval: 10
# User agent for RSS requests
userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
# FlareSolverr endpoint (optional)
flaresolverr: http://127.0.0.1:8191/
# Telegram chat ID for RSS monitoring notifications (optional)
notifyTelegramChatId: 111111111
# Proxy configuration (optional)
proxy:
enabled: true
protocol: http # http or https
host: 127.0.0.1
port: 1080
auth:
username: user
password: pass
# Telegram bot configuration (required)
telegram:
- name: default
token: YOUR_BOT_TOKEN
chatId: YOUR_CHAT_ID
parseMode: MarkdownV2 # Markdown or MarkdownV2
disableNotification: false
disableWebPagePreview: falserss:
- name: GitHub Commits
url: https://github.com/user/repo/commits.atom
sendTo: default # or list: [bot1, bot2]
# Optional settings
disableNotification: false
disableWebPagePreview: false
fullText: true
embedMedia: true
embedMediaExclude:
- https://example.com/.+
# Content transformation rules
rules:
- obj: title
type: regex # or func
matcher: ^(\[.+?\])?(.+?)$
dest: tag
- obj: content
type: func
matcher: |
return obj.replace(/pattern/, 'replacement');
dest: processed_content
# Content filters
filters:
# Static regex filter
- obj: title
type: in # include only matching
matcher: important
- obj: content
type: out # exclude matching
matcher: spam|ads
# Remote filter: fetch URL content as regex
- obj: author
type: out
matcher:
url: https://example.com/blocklist.txt
# Remote filter with function transform
- obj: author
type: out
matcher:
url: https://example.com/blocklist.json
func: |
const list = JSON.parse(data);
return list.users.map(u => u.username).join('|');
# Message template (Nunjucks)
text: |
**{{ title }}**
{{ content }}
[Read more]({{ link }})
_Tags: {{ tag }}_From RSS feed (via rss-parser):
title,link,content,contentSnippetauthor,pubDate,guid- Any custom fields from your RSS feed
Custom variables:
rss_name- Name of the RSS feedrss_url- URL of the RSS feed- Any fields created by
rules(e.g.,tag,processed_content)
Apache-2.0 License - see LICENSE for details.
- rss-parser - RSS feed parsing
- Drizzle ORM - TypeScript ORM
- Bun - Fast JavaScript runtime
- Nunjucks - Template engine
- ky - HTTP client
- p-queue - Promise queue with concurrency control
