自建RSS订阅-开源软件Tiny

NO.1
Tiny文档
git仓库

https://github.com/HenryQW/Awesome-TTRSS

安装方式

https://ttrss.henry.wang/zh/#%E9%80%9A%E8%BF%87-docker-compose-%E9%83%A8%E7%BD%B2

docker-compose部署

https://github.com/HenryQW/Awesome-TTRSS/blob/main/docker-compose.yml

NO.2
Tiny部署

在当前目录创建用于存放数据的文件夹

配置文件有用到,也可以按照自己的配置更改为对应文件夹

mkdir -p ./postgres/data/

编辑docker-compose.yml文件

nano docker-compose.yml

写入代码

version: "3"
services:
  service.rss:
    image: wangqiru/ttrss:latest
    container_name: ttrss
    ports:
      - 181:80
    environment:
      - SELF_URL_PATH=http://localhost:181/ # please change to your own domain
      - DB_PASS=ttrss # use the same password defined in `database.postgres`
      - PUID=1000
      - PGID=1000
    volumes:
      - feed-icons:/var/www/feed-icons/
    networks:
      - public_access
      - service_only
      - database_only
    stdin_open: true
    tty: true
    restart: always

  service.mercury: # set Mercury Parser API endpoint to `service.mercury:3000` on TTRSS plugin setting page
    image: wangqiru/mercury-parser-api:latest
    container_name: mercury
    networks:
      - public_access
      - service_only
    restart: always

  service.opencc: # set OpenCC API endpoint to `service.opencc:3000` on TTRSS plugin setting page
    image: wangqiru/opencc-api-server:latest
    container_name: opencc
    environment:
      - NODE_ENV=production
    networks:
      - service_only
    restart: always

  database.postgres:
    image: postgres:13-alpine
    container_name: postgres
    environment:
      - POSTGRES_PASSWORD=ttrss # feel free to change the password
    volumes:
      - ./postgres/data/:/var/lib/postgresql/data # persist postgres data to ~/postgres/data/ on the host
    networks:
      - database_only
    restart: always

  # utility.watchtower:
  #   container_name: watchtower
  #   image: containrrr/watchtower:latest
  #   volumes:
  #     - /var/run/docker.sock:/var/run/docker.sock
  #   environment:
  #     - WATCHTOWER_CLEANUP=true
  #     - WATCHTOWER_POLL_INTERVAL=86400
  #   restart: always

volumes:
  feed-icons:

networks:
  public_access: # Provide the access for ttrss UI
  service_only: # Provide the communication network between services only
    internal: true
  database_only: # Provide the communication between ttrss and database only
    internal: true

img

运行

docker-compose up

img

启动成功

使用IP:端口访问,默认端口为181

会报错访问的ip和配置文件中设置的不一样

修改docker-compose.yml文件中的SELF_URL_PATH

重新启动并设置后台运行

docker-compose up -d

再次访问正常进入登录页面

默认账户admin 默认密码password

登陆后弹出提示

需要修改默认密码

选择用户,点击要修改的账户,如admin

输入新密码即可

点击右上角,选择订阅信息源

输入对应的rss地址即可订阅

可以看到Tiny支持中文,相对友好

NO.3
tiny设置nginxhttps访问

nginx.conf文件

在http内

# 定义访问源 (放在sever的上面)
upstream ttrssdev {
    server 127.0.0.1:181;
    keepalive 64;
}

# 本地的80端口(http服务)
server {
    listen 80;
    # tiny
    server_name tiny.xxx.com;

    location / {
        # root   /var/www/html/client; #站点目录
        # index index.html index.htm;
        # 指向本地的nodejs服务器
        proxy_pass http://127.0.0.1:181;
        #设置请求头,并将头信息传递给服务器端
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        # 强制跳转https
        rewrite ^(.*)$  https://$host$1 permanent;
}

}



# tiny
server {
    listen 443;
    # tiny
    server_name tiny.xxx.com;
    ssl on;
    # root html;
    # index index.html index.htm;
    # SSL证书放在了同级目录tiny文件夹下面
    ssl_certificate cert/tiny/1_tiny.xxx.com_bundle.crt;
    ssl_certificate_key cert/tiny/2_tiny.xxx.com.key;
    ssl_session_timeout 5m;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;

    location / {
        proxy_redirect off;
        proxy_pass http://ttrssdev;

        proxy_set_header  Host                $http_host;
        proxy_set_header  X-Real-IP           $remote_addr;
        proxy_set_header  X-Forwarded-Ssl     on;
        proxy_set_header  X-Forwarded-For     $proxy_add_x_forwarded_for;
        proxy_set_header  X-Forwarded-Proto   $scheme;
        proxy_set_header  X-Frame-Options     SAMEORIGIN;

        client_max_body_size        100m;
        client_body_buffer_size     128k;

        proxy_buffer_size           4k;
        proxy_buffers               4 32k;
        proxy_busy_buffers_size     64k;
        proxy_temp_file_write_size  64k;
    }
}

END.