部署 Tiny Tiny RSS 遇见的坑

本文最后更新于:几秒前

部署 Tiny Tiny RSS 遇见的坑

笔者按照教程和文档[1] [2] [3],在 VPS 上部署了 Awesome Tiny Tiny RSS (以下简称 TTRSS)。在这个过程中,踩了很多坑,在此记录下来。

环境

  • Ubuntu 20.04 LTS
  • 宝塔面板
  • LNMP (用面板安装)
  • Docker (另行安装)

用管理员身份执行

安装 docker、部署 TTRSS、用 docker-compose 命令操作 TTRSS 时,每条命令都需要用管理员身份执行。

Postgres 数据库的密码

docker-compose.yml 文件中,POSTGRES_PASSWORDDB_PASS 这两项,需要在部署 TTRSS 之前就设置好。

这两项,需要在部署 TTRSS 之前就设置好

如果部署 TTRSS 之后再修改这两个密码,那么在访问 TTRSS 的 URL时,会得到一个空白页面(白屏)。

我不会重置密码,只能用 sudo rm -rf /root/postgres/data 命令强行删除全部的 Postgres 数据库 🤷‍♀️。

验证 TTRSS 是否运行

SSH 连接到 VPS,执行:

1
curl http://127.0.0.1:181/

如果 curl 返回如下内容:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE html>
<html>
<head>
<title>Startup failed</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="themes/light.css">
</head>
<body class="sanity_failed flat ttrss_utility">
<div class="content">
<h1>Startup failed</h1>

<p>Please fix errors indicated by the following messages:</p>

<div class="alert alert-danger">Please set SELF_URL_PATH to the correct value detected for your server: <b>http://127.0.0.1:181</b> (you're using: <b>https://ttrss.kukmoon.com</b>)</div>
<p>You might want to check tt-rss <a target="_blank" href="https://tt-rss.org/wiki.php">wiki</a> or the
<a target="_blank" href="https://community.tt-rss.org/">forums</a> for more information. Please search the forums before creating new topic
for your question.</p>
</div>
</body>
</html>

说明 TTRSS 已在后台运行,需要正确地配置反向代理。

配置 HTTPS 与反向代理

编辑 nginx 配置文件,加入以下内容:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#为了给Tiny Tiny RSS配置https加入下列内容
listen 443 ssl http2;
if ($ssl_protocol = "") { return 301 https://$host$request_uri; }

#给Tiny Tiny RSS配置反向代理
location / {
proxy_pass http://127.0.0.1:181/;
rewrite ^/(.*)$ /$1 break;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade-Insecure-Requests 1;
proxy_set_header X-Forwarded-Proto https;
}

在 nginx 配置文件中找到以下内容,注释掉,或者删除掉。

1
2
3
4
5
6
7
8
9
10
11
12
13
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
error_log /dev/null;
access_log off;
}

location ~ .*\.(js|css)?$
{
expires 12h;
error_log /dev/null;
access_log off;
}

TTRSS 的 iOS 客户端

笔者找到了TTRSS 的第三方 iOS 客户端:tiny Reader。它是免费的(有内购),有 macOS 与 iOS 版(其实 macOS 版没必要,用浏览器就好了)。注意,它是通过 TTRSS 本身的 API 来连接的,不是通过 Fever API!

App store 链接:https://apps.apple.com/us/app/tiny-reader-rss/id689519762

手机端登录方法

首先,在 TTRSS 的【偏好设置】→【偏好设置】→【通用】中勾选【启用 API:允许外部客户端通过 API 来访问该账户】。

启用 API

然后,在手机端启动 tiny Reader,它首次启动后会自动进入 Account 设置界面,将 SERVER ADDRESS 设置为 TTRSS 的 URL,LOGIN 设置为你设置的账号名(我在默认账号 admin 之外又建立了一个新的账号),PASSWORD 设置为你为账号设置的密码。这样就可以了。

设置服务器地址、账号、密码

图片版权

题图:自制(其中 Tiny Tiny RSS 的图标版权归开发者所有)

头图:https://www.wallpaperbetter.com/en/hd-wallpaper-tolen

参考文献


求扫码打赏
“我这么可爱,请给我钱 o(*^ω^*)o”

部署 Tiny Tiny RSS 遇见的坑
https://blog.kukmoon.com/fef91966/
作者
Kukmoon谷月
发布于
2022年12月1日
许可协议