RSS 服务器端
- FreshRSS 自建
FreshRSS
安装 (Docker)
Docker 方式运行: (文档)
mkdir -p /root/files/appdata/freshrss/data /root/files/appdata/freshrss/extensions
docker network create nginx
docker run -d --restart unless-stopped --log-opt max-size=10m \
-v /root/files/appdata/freshrss/data:/var/www/FreshRSS/data \
-v /root/files/appdata/freshrss/extensions:/var/www/FreshRSS/extensions \
-e 'CRON_MIN=*/5' \
-e TZ=Asia/Shanghai \
--net nginx \
--env "VIRTUAL_HOST=freshrss.example.com" \
--env "LETSENCRYPT_HOST=freshrss.example.com" \
--name freshrss freshrss/freshrss
说明
- CRON_MIN 是 freshrss 定时任务(负责后台更新feeds数据) 的 crontab 的 MINUTES 字段值。
- 使用 nginx-proxy 配置了 HTTPS 反向代理,域名 freshrss.example.com。
- 如果是 arm64 环境, 使用 arm (或 "-arm" prefix)这个 tag 的镜像。参考资料。
浏览器打开 https://freshrss.example.com , 会显示初始安装界面,配置管理员用户名和密码等即可(数据库配置为默认的 sqlite 即可)。
配置
按照官方文档 步骤开启 API。
- Under the section “Authentication”, enable the option “Allow API access (required for mobile apps)”.
- Under the section “Profile”, fill-in the field “API password (e.g., for mobile apps)”.
- Every user must define an API password.
- The reason for an API-specific password is that it may be used in less safe situations than the main password, and does not grant access to as many things.
feeds 数据刷新频率:
FreshRSS 页面 - Configuration - Archiving - Do not automatically refresh more often than 配置项。默认1h (1小时), 页面上最短可以设置为 20m (20分钟) (点击主界面右上角齿轮图标 - 点击 Configuration 分组里的 Archiving 菜单项,"Do not automatically refresh more often than" 设置项). FreshRSS 两次拉取同一个 feed 的时间间隔不会少于这个值(不管是页面上手动刷新还是后台 cronjob 任务自动刷新)。如果需要修改为 < 20m 的值:
cd /root/files/appdata/FreshRSS-data
vi users/admin/config.php
<?php
return array (
'ttl_default' => 300,
)
文件路径中的 admin 是需要修改配置的用户名。修改 ttl_default 值(秒数)即可。由于 FreshRSS 使用世界上最好的语言 PHP 开发,修改后立即生效。
API
(API 需要手动开启。参考上面说明)
- API 说明页面: https://freshrss.example.com/api/
- Google Reader compatible API: https://freshrss.example.com/api/greader.php
- Fever compatible API: https://freshrss.example.com/api/fever.php
使用 Google Reader API / Fever API 兼容的客户端连接时,指定 API endpoint 为对应的地址,然后配置用户名和 API 密码即可。
使用
- FreshRSS 添加某些 (RSSHub 生产的) RSS 源时需要在 url 后加上 "#force_feed", 否则报错。
RSSHub (Github)
使用 RSSHub 为各种网站创建 RSS 源。
官方服务: https://rsshub.app/ (部分反爬严格的网站无法工作,需要自建)
例如:
- cnbeta RSS : https://rsshub.app/cnbeta (文档)
RSSHub 使用 node.js 开发。自建支持 Docker / heroku 等部署方式。
Docker + docker-compose 部署
mkdir -p /root/files/appdata/rsshub && cd $_
vim docker-compose.yml
docker-compose up -d
docker-compose.yml : (在官方基础上修改)
version: '3'
services:
rsshub:
image: diygod/rsshub
#network_mode: bridge
restart: always
#ports:
# - '1200:1200'
environment:
NODE_ENV: production
CACHE_TYPE: redis
REDIS_URL: 'redis://redis:6379/'
PUPPETEER_WS_ENDPOINT: 'ws://browserless:3000'
VIRTUAL_PORT: 1200 # nginx-proxy
VIRTUAL_HOST: "rsshub.example.com" # nginx-proxy
LETSENCRYPT_HOST: "rsshub.example.com" # nginx-proxy
depends_on:
- redis
- browserless
browserless:
# See issue 6680
image: browserless/chrome:1.43-chrome-stable
#network_mode: bridge
restart: always
ulimits:
core:
hard: 0
soft: 0
redis:
image: redis:alpine
#network_mode: bridge
restart: always
volumes:
- redis-data:/data
volumes:
redis-data:
# 以下配置配合 nginx-proxy 使用时需要
networks:
default:
external: true
name: nginx
以上同样使用 nginx-proxy 在 https://rsshub.example.com 地址提供反向代理(nginx-proxy 运行在 docker 的 "nginx" network 里),注意 RSSHub 的官方 Docker 镜像 http 服务跑在 tcp/1200 端口。
RSS 阅读器
fluent-reader
- Windows 客户端 (不要从 Microsoft Store 下载, 有毒)
- Fluent Reader Lite (Mobile app)
- Android apk 下载 (me.hyliu.fluent_reader_lite)
newsboat (CLI RSS 阅读器)
最新版(2023-10 check) 2.33。Debian / Ubuntu 默认 repository 里的版本很旧,不支持 FreshRSS 类型的源。可以使用 snap 版:
# apt-get install snapd # if you have uninstalled snap before
snap install newsboat
配置文件:
- 标准: /etc/newsboat/config
- snap 版: /root/snap/newsboat/
/.newsboat/config
配置文件示例:
browser sensible-browser
urls-source "freshrss"
freshrss-url "https://freshrss.example.com/api/greader.php"
freshrss-login "admin"
freshrss-password "freshrss_app_password"
freshrss-show-special-feeds "false"
unbind-key j
unbind-key k
bind-key j down
bind-key k up