Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
281d51b
Translate Chinese to English in version.py
claude Feb 10, 2026
bd10e92
Translate Chinese to English in .env.example
claude Feb 10, 2026
0e7aad5
Translate Chinese to English in .gitignore
claude Feb 10, 2026
0f1d4e3
Translate Chinese to English in .dockerignore
claude Feb 10, 2026
f51090a
Translate Chinese to English in Dockerfile
claude Feb 10, 2026
2702a2d
Translate Chinese to English in docker-compose.yml
claude Feb 10, 2026
36999aa
Translate Chinese to English in main.py
claude Feb 10, 2026
b588a6f
Translate Chinese to English in enums/enums.py
claude Feb 10, 2026
440977a
Translate Chinese to English in message_listener.py
claude Feb 10, 2026
8c697ec
Translate Chinese to English in README.md
claude Feb 10, 2026
a1a6d70
Translate Chinese to English in utils/media.py
claude Feb 10, 2026
739ec65
Translate Chinese to English in ai/gemini_provider.py
claude Feb 10, 2026
3976c09
Translate Chinese to English in utils/settings.py
claude Feb 10, 2026
ac76cb0
Translate Chinese to English in ai/openai_base_provider.py
claude Feb 10, 2026
be7ebf8
Translate Chinese to English in scheduler/summary_scheduler.py
claude Feb 10, 2026
3a4a9fe
Translate Chinese to English in ai/openai_provider.py
claude Feb 10, 2026
fdd3e2f
Translate Chinese to English in ai/__init__.py
claude Feb 10, 2026
bfe2807
Translate Chinese to English in scheduler/chat_updater.py
claude Feb 10, 2026
32b97bc
Translate Chinese to English in filters/rss_filter.py
claude Feb 10, 2026
a2ccc4e
Translate Chinese to English in ai/base.py
claude Feb 10, 2026
47ea54d
Translate Chinese to English in utils/common.py
claude Feb 10, 2026
1118b7a
Translate Chinese to English in ai/claude_provider.py
claude Feb 10, 2026
57383dc
Translate Chinese to English in utils/constants.py
claude Feb 10, 2026
25cfd78
Translate Chinese to English in ufb/ufb_client.py
claude Feb 10, 2026
a078d1f
Translate Chinese to English in filters/sender_filter.py
claude Feb 10, 2026
12e6456
Translate Chinese to English in rss/main.py
claude Feb 10, 2026
14bfb87
Translate Chinese to English in utils/file_creator.py
claude Feb 10, 2026
ca13fb6
Translate Chinese to English in handlers/prompt_handlers.py
claude Feb 10, 2026
2232e01
Translate Chinese to English in utils/log_config.py
claude Feb 10, 2026
1849af7
Translate Chinese to English in utils/auto_delete.py
claude Feb 10, 2026
bba0d3e
Translate Chinese to English in filters/push_filter.py
claude Feb 10, 2026
c52335e
Translate Chinese to English in filters/replace_filter.py
claude Feb 10, 2026
2b536a8
Translate Chinese to English in models/db_operations.py
claude Feb 10, 2026
b5641a3
Translate Chinese to English in rss/app/routes/rss.py
claude Feb 10, 2026
d5fd2c7
Translate Chinese to English in filters/reply_filter.py
claude Feb 10, 2026
45a85f1
Translate Chinese to English in handlers/user_handler.py
claude Feb 10, 2026
172e4fe
Translate Chinese to English in filters/media_filter.py
claude Feb 10, 2026
baa3a8d
Translate Chinese to English in models/models.py
claude Feb 10, 2026
8f0484a
Translate Chinese to English in filters/process.py
claude Feb 10, 2026
da99535
Translate Chinese to English in rss/app/services/feed_generator.py
claude Feb 10, 2026
9ff3da6
Translate Chinese to English in filters/filter_chain.py
claude Feb 10, 2026
a670a20
Translate Chinese to English in managers/state_manager.py
claude Feb 10, 2026
9ffdab4
Translate Chinese to English in rss/app/crud/entry.py
claude Feb 10, 2026
c49c2f0
Translate Chinese to English in filters/info_filter.py
claude Feb 10, 2026
b872641
Translate Chinese to English in rss/app/models/entry.py
claude Feb 10, 2026
07b7d35
Translate Chinese to English in filters/init_filter.py
claude Feb 10, 2026
92de855
Translate Chinese to English in filters/keyword_filter.py
claude Feb 10, 2026
db67d8a
Translate Chinese to English in rss/app/routes/auth.py
claude Feb 10, 2026
9e550ee
Translate Chinese to English in rss/app/core/config.py
claude Feb 10, 2026
9e3d2ff
Translate Chinese to English in filters/comment_button_filter.py
claude Feb 10, 2026
16b4938
Translate Chinese to English in filters/context.py
claude Feb 10, 2026
b43cc39
Translate Chinese to English in filters/delay_filter.py
claude Feb 10, 2026
a3540f9
Translate Chinese to English in filters/delete_original_filter.py
claude Feb 10, 2026
c34f983
Translate Chinese to English in filters/edit_filter.py
claude Feb 10, 2026
4703794
Translate Chinese to English in rss/app/api/endpoints/feed.py
claude Feb 10, 2026
a8234a5
Translate Chinese to English in rss/app/configs/title_template.json
claude Feb 10, 2026
8f25e8b
Translate Chinese to English in filters/ai_filter.py
claude Feb 10, 2026
1907e89
Translate Chinese to English in rss/app/__init__.py
claude Feb 10, 2026
d20aae2
Translate Chinese to English in filters/base_filter.py
claude Feb 10, 2026
fd0f0a6
Translate Chinese to English in handlers/command_handlers.py
claude Feb 10, 2026
54f6950
Translate Chinese to English in handlers/link_handlers.py
claude Feb 10, 2026
bc1f31a
Translate Chinese to English in handlers/list_handlers.py
claude Feb 10, 2026
3940412
Translate Chinese to English in rss/app/templates/rss_dashboard.html
claude Feb 10, 2026
805b374
Translate Chinese to English in rss/app/templates/login.html
claude Feb 10, 2026
dcf5f55
Translate Chinese to English in handlers/bot_handler.py
claude Feb 10, 2026
0670c82
Translate Chinese to English in rss/app/templates/register.html
claude Feb 10, 2026
ec48667
Translate Chinese to English in handlers/button/callback/other_callba…
claude Feb 10, 2026
43506d0
Translate Chinese to English in handlers/button/callback/push_callbac…
claude Feb 10, 2026
3906b1c
Translate Chinese to English in handlers/button/settings_manager.py
claude Feb 10, 2026
9e8ed1a
Translate Chinese to English in handlers/button/callback/callback_han…
claude Feb 10, 2026
6c3d850
Translate Chinese to English in handlers/button/callback/media_callba…
claude Feb 10, 2026
2ad82ac
Translate Chinese to English in handlers/button/callback/ai_callback.py
claude Feb 10, 2026
d6ef9db
Translate Chinese to English in handlers/button/button_helpers.py
claude Feb 10, 2026
0e5aedc
Fix remaining Chinese text in handlers/button/callback/other_callback.py
claude Feb 10, 2026
235191c
Fix remaining Chinese text in handlers/command_handlers.py
claude Feb 10, 2026
30b95ed
Fix remaining Chinese filename in .gitignore
claude Feb 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
# 忽略环境变量文件
# Ignore environment variable files
.env
.env.example

# 忽略数据库文件
# Ignore database files
*.db
db/forward.db1

# 忽略 Python 生成的缓存文件
# Ignore Python generated cache files
**/__pycache__/
*.py[cod]
*$py.class

# 忽略虚拟环境
# Ignore virtual environments
**/venv/
**/env/
**/ENV/

# 忽略 Telethon 会话文件
# Ignore Telethon session files
*.session
*.session-journal
*.session-journal

# 忽略 IDE 配置文件
# Ignore IDE configuration files
.idea/
ufb/.idea

# 忽略示例和临时配置文件
# Ignore example and temporary configuration files
/example
/config/*
ufb/config/*

# 忽略无用的图片和测试目录
# Ignore unused image and test directories
**/test/
**/images/

# 忽略 RSS 相关数据和临时文件
# Ignore RSS related data and temporary files
/rss/media/*
/rss/data/*

# 忽略日志文件
# Ignore log files
logs/*

# 忽略临时文件夹
# Ignore temporary folders
/temp/*

# 额外忽略 `.git` 和 Docker 相关文件,防止意外复制
# Additionally ignore .git and Docker related files to prevent accidental copying
.git
.gitignore
.dockerignore
Expand Down
103 changes: 51 additions & 52 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,141 +1,140 @@
######### 必填项 #########
# Telegram API 配置 (从 https://my.telegram.org/apps 获取)
######### Required #########
# Telegram API configuration (obtain from https://my.telegram.org/apps)
API_ID=
API_HASH=

# 用户账号登录用的手机号 (格式如: +8613812345678)
# Phone number for user account login (format: +8613812345678)
PHONE_NUMBER=

# Bot Token
BOT_TOKEN=

# 用户ID (从 @userinfobot 获取)
# User ID (obtain from @userinfobot)
USER_ID=



################ 以下均为可选项 ##################
################ All below are optional ##################

# 管理员列表(此处填user_id,留空默认上方的USER_ID,多个用户用逗号分隔)
# Admin list (enter user_id here, leave empty to default to USER_ID above, separate multiple users with commas)
ADMINS=

# bot消息删除时间 (秒),0表示立即删除, -1表示不删除
# Bot message deletion timeout (seconds), 0 means delete immediately, -1 means do not delete
BOT_MESSAGE_DELETE_TIMEOUT=300

# 是否自动删除用户发送的指令消息 (true/false)
# Whether to automatically delete command messages sent by users (true/false)
USER_MESSAGE_DELETE_ENABLE=false

# 默认最大媒体文件大小限制(单位:MB)
# Default maximum media file size limit (unit: MB)
DEFAULT_MAX_MEDIA_SIZE=15

# 默认时区
# Default timezone
DEFAULT_TIMEZONE=Asia/Shanghai

# 自动更新数据库中聊天窗口名字时间 (24小时制)
# Time to auto-update chat names in the database (24-hour format)
CHAT_UPDATE_TIME=03:00

# 数据库配置
# Database configuration
DATABASE_URL=sqlite:///./db/forward.db

######### UI 布局配置 #########
######### UI Layout Configuration #########
AI_MODELS_PER_PAGE=10
KEYWORDS_PER_PAGE=10
PUSH_CHANNEL_PER_PAGE=10

# 总结列表(行)
SUMMARY_TIME_ROWS=10
# 总结列表(列)
# Summary list (rows)
SUMMARY_TIME_ROWS=10
# Summary list (columns)
SUMMARY_TIME_COLS=6

# 延迟时间列表(行)
# Delay time list (rows)
DELAY_TIME_ROWS=10
# 延迟时间列表(列)
# Delay time list (columns)
DELAY_TIME_COLS=6

# 媒体大小列表(行)
# Media size list (rows)
MEDIA_SIZE_ROWS=10
# 媒体大小列表(列)
# Media size list (columns)
MEDIA_SIZE_COLS=6

# 媒体扩展名列表(行)
# Media extension list (rows)
MEDIA_EXTENSIONS_ROWS=10
# 媒体扩展名列表(列)
# Media extension list (columns)
MEDIA_EXTENSIONS_COLS=6

# 每页显示的规则数量
# Number of rules displayed per page
RULES_PER_PAGE=20

######### AI设置 #########
######### AI Settings #########

# 默认AI模型
# Default AI model
DEFAULT_AI_MODEL=gemini-2.0-flash

# OpenAi API Key
OPENAI_API_KEY=your_openai_api_key
# 留空使用官方接口 https://api.openai.com/v1
OPENAI_API_BASE=
# Leave empty to use the official API https://api.openai.com/v1
OPENAI_API_BASE=

# Claude API Key
CLAUDE_API_KEY=your_claude_api_key
# 留空使用官方接口
# Leave empty to use the official API
CLAUDE_API_BASE=

# Gemini API Key
# 默认使用官方接口
# Uses the official API by default
GEMINI_API_KEY=your_gemini_api_key
# 兼容OpenAI接口标准的第三方API Base,如官方的:https://generativelanguage.googleapis.com/v1beta
# Third-party API Base compatible with OpenAI API standard, e.g. the official one: https://generativelanguage.googleapis.com/v1beta
GEMINI_API_BASE=

# DeepSeek API Key
DEEPSEEK_API_KEY=your_deepseek_api_key
# 留空使用官方接口 https://api.deepseek.com/v1
DEEPSEEK_API_BASE=
# Leave empty to use the official API https://api.deepseek.com/v1
DEEPSEEK_API_BASE=

# Qwen API Key
QWEN_API_KEY=your_qwen_api_key
# 留空使用官方接口 https://dashscope.aliyuncs.com/compatible-mode/v1
QWEN_API_BASE=
# Leave empty to use the official API https://dashscope.aliyuncs.com/compatible-mode/v1
QWEN_API_BASE=

# Grok API Key
GROK_API_KEY=your_grok_api_key
# 留空使用官方接口 https://api.x.ai/v1
GROK_API_BASE=
# Leave empty to use the official API https://api.x.ai/v1
GROK_API_BASE=

# 默认AI提示词
DEFAULT_AI_PROMPT=请尊重原意,保持原有格式不变,用简体中文重写下面的内容:
# Default AI prompt
DEFAULT_AI_PROMPT=Please respect the original meaning, keep the original format unchanged, and rewrite the following content in Simplified Chinese:

# 默认AI总结提示词
DEFAULT_SUMMARY_PROMPT=请总结以下频道/群组24小时内的消息。
# 默认总结时间 (24小时制)
# Default AI summary prompt
DEFAULT_SUMMARY_PROMPT=Please summarize the messages from the following channel/group within the past 24 hours.
# Default summary time (24-hour format)
DEFAULT_SUMMARY_TIME=07:00


# AI总结每次爬取消息数量
# Number of messages fetched per AI summary batch
SUMMARY_BATCH_SIZE=20
# AI总结每次爬取消息间隔时间(秒)
# Interval between AI summary message fetches (seconds)
SUMMARY_BATCH_DELAY=2


######### RSS配置 #########
# 是否启用RSS功能 (true/false)
######### RSS Configuration #########
# Whether to enable RSS functionality (true/false)
RSS_ENABLED=false

# RSS基础访问URL
# RSS base access URL
RSS_BASE_URL=

# RSS媒体文件基础URL
# RSS media file base URL
RSS_MEDIA_BASE_URL=


######### 扩展内容 #########
######### Extensions #########

# 是否开启与通用论坛屏蔽插件服务端的同步服务 (true/false)
# Whether to enable sync service with universal forum blocker plugin server (true/false)
UFB_ENABLED=false
# 服务端地址
# Server address
UFB_SERVER_URL=
# 用户API_KEY
# User API_KEY
UFB_TOKEN=




12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# 环境变量文件
# Environment variable files
.env

# 数据库文件
# Database files
*.db

# Python
__pycache__/
*.py[cod]
*$py.class

# 虚拟环境
# Virtual environments
venv/
env/
ENV/

# Telethon session 文件
# Telethon session files
*.session
*.session-journal
*.session-journal
/.idea
/example
/config
Expand All @@ -27,7 +27,7 @@ ufb/config/config.json
db/forward.db1
handlers/bot_handler copy.py
/temp
使用场景示例.md
usage_scenario_examples.md
/rss/media
/rss/data

Expand Down
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM python:3.11-slim

# 设置工作目录
# Set working directory
WORKDIR /app

# 设置Docker日志配置
# Set Docker log configuration
ENV DOCKER_LOG_MAX_SIZE=10m
ENV DOCKER_LOG_MAX_FILE=3

# 安装系统依赖
# Install system dependencies
RUN apt-get update && apt-get install -y \
tzdata \
&& ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
Expand All @@ -17,18 +17,18 @@ RUN apt-get update && apt-get install -y \
python3-dev \
&& rm -rf /var/lib/apt/lists/*

# 复制依赖文件并安装
# Copy dependency files and install
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# 创建临时文件目录
# Create temporary file directory
RUN mkdir -p /app/temp

# 复制应用代码
# Copy application code
COPY . .

# 设置环境变量
# Set environment variables
ENV PYTHONUNBUFFERED=1

# 启动命令
# Start command
CMD ["python", "main.py"]
Loading