rss-reader
Go to file
2023-10-15 19:27:35 +08:00
globals ws close to reload 2023-10-15 19:27:35 +08:00
models 调整代码结构 2023-10-15 01:16:07 +08:00
utils add fsnotify 2023-10-15 02:03:42 +08:00
config.json 添加日间时间 2023-10-15 01:18:30 +08:00
docker-compose.yml 删除部分挂载 2023-08-09 22:25:14 +08:00
Dockerfile 添加镜像时区为shanghai 2023-08-09 03:02:50 +08:00
go.mod update 2023-10-15 02:04:05 +08:00
go.sum add fsnotify 2023-10-15 02:03:42 +08:00
LICENSE Initial commit 2022-07-08 00:45:44 +08:00
main.go 兼容代码结构改变,增加夜间模式 2023-10-15 01:18:58 +08:00
mobile.png 更新说明 2023-09-23 00:01:38 +08:00
pc.png 更新说明 2023-09-23 00:01:38 +08:00
README.md add 2023-10-15 01:22:30 +08:00

简述

实时展示rss订阅最新消息。

特性

  • 打包后镜像大小仅有约20MB通过docker实现一键部署

  • 支持自定义配置页面数据自动刷新

  • 响应式布局,能够兼容不同的屏幕大小

  • 良好的SEO首次加载使用模版引擎快速展示页面内容

  • 支持添加多个RSS订阅链接

  • 简洁的页面布局,可以查看每个订阅链接最后更新时间

  • 支持夜间模式

  • config.json配置文件支持热更新

2023年7月28日进行了界面改版和升级

配置文件

配置文件位于config.jsonsources是RSS订阅链接示例如下

{
    "values": [
        "https://www.zhihu.com/rss",
        "https://tech.meituan.com/feed/",
        "http://www.ruanyifeng.com/blog/atom.xml",
        "https://feeds.appinn.com/appinns/",
        "https://v2ex.com/feed/tab/tech.xml",
        "https://www.cmooc.com/feed",
        "http://www.sciencenet.cn/xml/blog.aspx?di=30",
        "https://www.douban.com/feed/review/book",
        "https://www.douban.com/feed/review/movie",
        "https://www.geekpark.net/rss",
        "https://hostloc.com/forum.php?mod=rss&fid=45&auth=389ec3vtQanmEuRoghE%2FpZPWnYCPmvwWgSa7RsfjbQ%2BJpA%2F6y6eHAx%2FKqtmPOg"
    ],
    "refresh": 6,
    "autoUpdatePush": 7,
    "nightStartTime": "06:30:00",
    "nightEndTime": "19:30:00"
}
名称 说明
values rss订阅链接必填
refresh rss订阅更新时间间隔单位分钟必填
autoUpdatePush 自动刷新间隔默认为0不开启。效果为前端每autoUpdatePush分钟自动更新页面信息单位分钟非必填
nightStartTime 日间开始时间 ,如 06:30:00
nightEndTime 日间结束时间,如 19:30:00

使用方式

Docker部署

环境要求Git、Docker、Docker-Compose

克隆项目

git clone https://github.com/srcrs/rss-reader

进入rss-reader文件夹运行项目

docker-compose up -d

国内服务器将Dockerfile中取消下面注释使用 go mod 镜像

#RUN go env -w GO111MODULE=on && \
#    go env -w GOPROXY=https://goproxy.cn,direct

部署成功后通过ip+端口号访问

nginx反代

这里需要注意/ws若不设置proxy_read_timeout参数则默认1分钟断开。静态文件增加gzip可以大幅压缩网络传输数据

server {
    listen 443 ssl;
    server_name rss.lass.cc;
    ssl_certificate  fullchain.cer;
    ssl_certificate_key lass.cc.key;
    gzip on;
    gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
    location / {
        proxy_pass  http://localhost:8080;
    }
    location /ws {
        proxy_pass http://localhost:8080/ws;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Host $host;
        proxy_read_timeout 300s;
    }
}

server {
    listen 80;
    server_name rss.lass.cc;
    rewrite ^(.*)$ https://$host$1 permanent;
}