RSSHub + FreshRSS搭建私人RSS订阅

发表于
更新于
11

1. RSSHub部署

直接参考官方文档部署(Docker Compose方式):

https://docs.rsshub.app/zh/deploy/#docker-compose-%E9%83%A8%E7%BD%B2-%E6%8E%A8%E8%8D%90
services:
    rsshub:
        # two ways to enable puppeteer:
        # * comment out marked lines, then use this image instead: diygod/rsshub:chromium-bundled
        # * (consumes more disk space and memory) leave everything unchanged
        image: diygod/rsshub
        restart: always
          # ports:
          # - "127.0.0.1:1200:1200"
        environment:
            NODE_ENV: production
            CACHE_TYPE: redis
            REDIS_URL: "redis://redis:6379/"
            PUPPETEER_WS_ENDPOINT: "ws://browserless:3000" # marked
        healthcheck:
            test: ["CMD", "curl", "-f", "http://localhost:1200/healthz"]
            interval: 30s
            timeout: 10s
            retries: 3
        depends_on:
            - redis
            - browserless # marked
        networks:
            - shared_net

    browserless: # marked
        image: browserless/chrome # marked
        restart: always # marked
        ulimits: # marked
            core: # marked
                hard: 0 # marked
                soft: 0 # marked
        healthcheck: # marked
            test: ["CMD", "curl", "-f", "http://localhost:3000/pressure"] # marked
            interval: 30s # marked
            timeout: 10s # marked
    redis:
        image: redis:alpine
        restart: always
        volumes:
            - redis-data:/data
        healthcheck:
            test: ["CMD", "redis-cli", "ping"]
            interval: 30s
            timeout: 10s
            retries: 5
            start_period: 5s

volumes:
    redis-data:

networks:
  shared_net:
    external: true
    name: freshrss_rsshub_net

我这边对Docker Compose文件有一些修改,比如:

  1. 不暴露RSSHub的1200端口(后续直接通过FreshRSS访问RSSHub,避免直接暴露在公网),将该部分注释掉:

  1. 创建一个共享网络,并在RSSHub的Docker Compose文件中配置该网络:
    2.1 执行docker命令(这里我给网络命名为freshrss_rsshub_net):docker network create freshrss_rsshub_net
    2.2 在Docker Compose文件中添加该网络:

2. FreshRSS部署

部署方式也是参考官方文档(Docker Compose方式):

https://github.com/FreshRSS/FreshRSS/tree/edge/Docker#docker-compose
volumes:
  data:
  extensions:

services:
  freshrss:
    image: freshrss/freshrss:latest
    # # Optional build section if you want to build the image locally:
    # build:
    #   # Pick #latest (slow releases) or #edge (rolling release) or a specific release like #1.21.0
    #   context: https://github.com/FreshRSS/FreshRSS.git#latest
    #   dockerfile: Docker/Dockerfile-Alpine
    container_name: freshrss
    hostname: freshrss
    restart: unless-stopped
    logging:
      options:
        max-size: 10m
    volumes:
      - data:/var/www/FreshRSS/data
      - extensions:/var/www/FreshRSS/extensions
    ports:
      # If you want to open a port 8080 on the local machine:
      - "127.0.0.1:8079:80"
    environment:
      TZ: Asia/Shanghai
      CRON_MIN: '3,33'
      TRUSTED_PROXY: 172.16.0.1/12 192.168.0.1/16
    networks:
      - shared_net
networks:
  shared_net:
    external: true
    name: freshrss_rsshub_net

改动的地方也是网络相关:

  1. 设置端口映射,并仅监听127.0.0.1,避免docker开放的端口绕过ufw防火墙:

  2. 将FreshRSS放入之前创建的docker共享网络中:

3. 成功部署RSSHub和FreshRSS后,添加订阅测试效果

在FreshRSS中,只需要通过http://rsshub:1200 + 路由地址即可添加订阅。

例如:少数派路由为:/sspai/index,那么添加订阅的时候只需要配置:http://rsshub:1200/sspai/index即可。


0
下一篇 部署Beszel监控