HenryQW / Awesome-TTRSS

🐋 Awesome TTRSS, a powerful Dockerised all-in-one RSS solution.
http://ttrss.henry.wang
MIT License
2.4k stars 499 forks source link

[BUG] 同一台 VPS 上的 TTRSS 不能订阅 RSSHub #514

Closed Kukmoon closed 4 months ago

Kukmoon commented 4 months ago

Bug 描述 我在同一台 VPS 上配置了 TTRSS 和 RSSHub,两者都使用 Nginx 做了反向代理以使用外网域名(按理说可以规避 TTRSS 不能订阅非 80、443 端口 Feed 的问题),前者是 ttrss.kukmoon.com,后者是 rsshub.kukmoon.com。但是 TTRSS 仍然不能订阅来自 RSSHub 的 Feed。

你谷歌/百度了吗? 是。发现 #184#195#207 可能与这个问题相关。但是,我按照 #207 的提示,修改环境变量增加了 ALLOW_PORTS=1200,并且注释掉了 command,仍然不行。

部署方法

部署环境

复现步骤 复现该 bug 的详细步骤

  1. 打开 'Awesome TTRSS'
  2. 点击 '右上角汉堡图标',选择 '添加订阅源',
  3. 复制粘贴来自自建 RSSHub 的 Feed,例如 'https://rsshub.kukmoon.com/rsshub/routes'
  4. 发现错误,Awesome TTRSS 提示 '无法从指定的网址下载:Client error: GET https://rsshub.kukmoon.com/rsshub/routes resulted in a 403 Forbidden response: `

预期结果 本应该成功订阅 Feed。

截屏 图片

错误日志 当错误发生时,通过终端执行 docker logs ttrss --tail 100 获取日志,并将相关错误日志粘贴于此处。

PDOException: SQLSTATE[08006] [7] connection to server at "database.postgres" (172.30.0.2), port 5432 failed: FATAL:  database "ttrss" does not exist in /initialize.php:172
Stack trace:
#0 /initialize.php(172): PDO->__construct()
#1 /initialize.php(181): connectDatabase()
#2 /initialize.php(90): checkConnection()
#3 {main}Database not found, creating.
Database table not found, applying schema...
[10:11:00/32] Lock: update.lock
[10:11:00/32] Proceeding to update without confirmation.
[10:11:00/32] Loading base database schema...
[10:11:00/32] Migration finished, current version: 147
[25-May-2024 10:11:01] NOTICE: fpm is running, pid 38
[25-May-2024 10:11:01] NOTICE: ready to handle connections

其他 任何有助于 bug 修复的信息。

TonyRL commented 4 months ago

Could you provide logs from RSSHub as well?

Kukmoon commented 4 months ago

Could you provide logs from RSSHub as well?

Excuse me. How could I get RSSHub's logs?

Kukmoon commented 4 months ago

突发奇想,是不是 TTRSS 不支持订阅处于同一个一级域名下面的 Feed?

我试着用 Awesome TTRSS 订阅我博客的 Feed https://blog.kukmoon.com/atom.xml,结果也失败了。

TonyRL commented 4 months ago

Could you provide logs from RSSHub as well?

Excuse me. How could I get RSSHub's logs?

docker logs rsshub --tail 100
Kukmoon commented 4 months ago

Could you provide logs from RSSHub as well?

Excuse me. How could I get RSSHub's logs?

docker logs rsshub --tail 100

以下是 RSSHub 的日志:

> rsshub@1.0.0 start
> cross-env NODE_ENV=production tsx lib/index.ts

(node:46) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
info: Redis connected.
info: 🎉 RSSHub is running on port 1200! Cheers!
info: 💖 Can you help keep this open source project alive? Please sponsor 👉 https://docs.rsshub.app/sponsor
info: 🔗 Local: 👉 http://localhost:1200
info: 🔗 Network: 👉 http://172.29.0.4:1200
info: <-- GET /
info: --> GET / 200 143ms
info: <-- GET /logo.png
info: --> GET /logo.png 200 13ms
info: <-- GET /favicon.ico
info: --> GET /favicon.ico 200 7ms
info: <-- GET /rsshub/routes
info: --> GET /rsshub/routes 200 9s
info: <-- HEAD /rsshub/routes
info: <-- GET /
info: <-- GET /rsshub/routes
info: --> GET / 200 7s
error: Request https://docs.rsshub.app/routes/picture fail: TypeError: fetch failed
error: Request https://docs.rsshub.app/routes/anime fail: TypeError: fetch failed
error: Request https://docs.rsshub.app/routes/programming fail: TypeError: fetch failed
error: Request https://docs.rsshub.app/routes/design fail: TypeError: fetch failed
error: Request https://docs.rsshub.app/routes/bbs fail: TypeError: fetch failed
error: Request https://docs.rsshub.app/routes/blog fail: TypeError: fetch failed
error: Request https://docs.rsshub.app/routes/traditional-media fail: TypeError: fetch failed
error: Request https://docs.rsshub.app/routes/new-media fail: TypeError: fetch failed
error: Request https://docs.rsshub.app/routes/program-update fail: TypeError: fetch failed
error: Request https://docs.rsshub.app/routes/multimedia fail: TypeError: fetch failed
error: Request https://docs.rsshub.app/routes/travel fail: TypeError: fetch failed
error: Request https://docs.rsshub.app/routes/shopping fail: TypeError: fetch failed
error: Request https://docs.rsshub.app/routes/university fail: TypeError: fetch failed
error: Request https://docs.rsshub.app/routes/forecast fail: TypeError: fetch failed
error: Request https://docs.rsshub.app/routes/live fail: TypeError: fetch failed
info: <-- GET /logo.png
info: --> GET /logo.png 200 8s
error: Error in /rsshub/routes: AbortError: This operation was aborted
info: --> GET /rsshub/routes 503 40s
error: Error in /rsshub/routes: TypeError: terminated
info: --> HEAD /rsshub/routes 503 43s
info: <-- GET /logo.png
info: --> GET /logo.png 200 5s
info: <-- HEAD /
info: --> HEAD / 200 40ms
info: <-- HEAD /test/cacge
info: --> HEAD /test/cacge 200 1s
info: <-- HEAD /test/cache
info: --> HEAD /test/cache 200 23ms
info: <-- GET /test/cache
info: --> GET /test/cache 200 11ms
info: <-- GET /rsshub/routes
info: --> GET /rsshub/routes 200 40s
info: <-- GET /favicon.ico
info: --> GET /favicon.ico 200 36ms
TonyRL commented 4 months ago

Your RSSHub instance is placed behind Cloudflare and the request from TTRSS is blocked by Cloudflare.

Kukmoon commented 4 months ago

Your RSSHub instance is placed behind Cloudflare and the request from TTRSS is blocked by Cloudflare.

Thank you for your kindly answer. I think Cloudflare has something to do with the hindrance to TTRSS.

But I think there are something that blocks TTRSS other than Cloudflare. I just bound a new domain name (with a new certificate but NOT proxied by Cloudflare) to my previously deployed RSSHub instance. However, Awesome TTRSS still can't subscribe to RSSHub feeds.

图片

TonyRL commented 4 months ago

Either the certificate is self-signed or the certificate chain is not complete. If those instances are running on the same machine, I would suggest subscribing RSSHub through localhost instead of domain name.

Kukmoon commented 4 months ago

Either the certificate is self-signed or the certificate chain is not complete. If those instances are running on the same machine, I would suggest subscribing RSSHub through localhost instead of domain name.

I tried as what you suggested (tryed remotely to subscribe one of RSSHub's feedings via 127.0.0.1 using Awesome TTRSS, both deployed on the same VPS). It's so difficult to run a GUI desktop on a remote VPS running Linux. But it still doesn't work...

图片

It is said that the problem could be solved by modifying php.ini. But I can't find it within docker containers.

Kukmoon commented 4 months ago

搞定了,是证书的问题,就是证书不完整。我换上完整的证书就好了。感谢楼上 @TonyRL

netdog2019 commented 2 months ago

搞定了,是证书的问题,就是证书不完整。我换上完整的证书就好了。感谢楼上 @TonyRL

我在群晖上部署,也碰到了同样的问题,请问大佬是怎么换上完整的证书的?谢谢,在群晖中如何操作有点提示么?感谢了。

Kukmoon commented 1 month ago

回复 @netdog2019 我不是大佬,只是简单说说经验,供参考。

我的完整的证书是用 CertifyTheWeb 客户端从 Let‘sEncrypt 手动申请的。一共是四个文件。这四个文件里面有一个是证书文件,一个是私钥文件。这个证书就是完整的证书。

之前,我图省事儿,从 Cloudflare 申请了有效期十五年的证书。这个证书只有两个文件,一个是证书文件,一个是私钥文件。这个证书文件是不完整的,只能配合 Cloudflare 来用。

在群晖部署我真的不会。我是在自己买的云服务器上部署的,操作系统是 Ubuntu Server,Web 服务端是 Nginx,把证书的路径写到 Nginx 的配置文件里。