Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

部署 TTRSS 时提示 Please set SELF_URL_PATH to the correct value for your server #19

Closed
FledgeXu opened this issue Mar 19, 2019 · 17 comments

Comments

@FledgeXu
Copy link

docker-compose 摘录如下

version: "3"
services:
  service.rss:
    image: wangqiru/ttrss:latest
    container_name: ttrss
    ports:
            - 181:80
    environment:
      - SELF_URL_PATH=http://feed.mydomin.com/
      - DB_HOST=127.0.0.1
      - DB_PORT=5432
      - DB_NAME=ttrss
      - DB_USER=postgres
      - DB_PASS=*********
    stdin_open: true
    tty: true
    restart: always

我把SELF_URL_PATH改成 http://ip/也无法启动。

这是为什么?

@HenryQW
Copy link
Owner

HenryQW commented Mar 19, 2019

所以你是需要 ip 直接访问? 地址 http://ip:181/

错误界面提示什么地址,就放什么地址。

@FledgeXu
Copy link
Author

我刚刚试了一下还是不行。依旧提示我要输入地址。

@HenryQW
Copy link
Owner

HenryQW commented Mar 19, 2019

麻烦贴配置,部署环境。

这就是为什么开 issue 要遵循模板

image

@FledgeXu
Copy link
Author

FledgeXu commented Mar 19, 2019

对不起,issue 开的太匆忙,没有注意到。

OS 信息:

PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

安装方式:

docker-compose 

Postgres 版本:

psql (PostgreSQL) 9.6.11

错误提示:

ttrss              | You might want to check tt-rss wiki or the forums for more information.
ttrss              | Please search the forums before creating new topic for your question.
ttrss              | Tiny Tiny RSS was unable to start properly. This usually means a misconfiguration or an incomplete upgrade.
ttrss              | Please fix errors indicated by the following messages:
ttrss              |
ttrss              |  * Please set SELF_URL_PATH to the correct value for your server (possible value: <b>http://</b>)

配置文件

version: "3"
services:
  service.rss:
    image: wangqiru/ttrss:latest
    container_name: ttrss
    ports:
            - 181:80
    environment:
      - SELF_URL_PATH=http://139.162.42.137:181/
      - DB_HOST=127.0.0.1
      - DB_PORT=5432
      - DB_NAME=ttrss
      - DB_USER=postgres
      - DB_PASS=*************
    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
    expose:
      - 3000
    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
    expose:
      - 3000
    restart: always

@FledgeXu
Copy link
Author

我试了一下直接用 docker run 运行,结果也是一样。

@HenryQW
Copy link
Owner

HenryQW commented Mar 20, 2019

刚跑的,没有任何问题:

version: "3"
services:
  database.postgres:
    image: sameersbn/postgresql:latest
    container_name: postgres
    environment:
      - PG_PASSWORD=ttrss # please change the password
      - DB_EXTENSION=pg_trgm
    restart: always

  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_HOST=database.postgres
      - DB_PORT=5432
      - DB_NAME=ttrss
      - DB_USER=postgres
      - DB_PASS=ttrss # please change the password
    stdin_open: true
    tty: true
    restart: always
    command: sh -c 'sh /wait-for database.postgres:5432 -- php /configure-db.php && exec s6-svscan /etc/s6/'

image

@FledgeXu
Copy link
Author

可能是 postgres 配置有问题?我现在没用 docker 直接搭好了。

@HenryQW
Copy link
Owner

HenryQW commented Mar 20, 2019

DB_HOST=127.0.0.1 当然不可能成功,意味着尝试连接到容器内的 127.0.0.1,而不是宿主。

@FledgeXu
Copy link
Author

明白了,谢谢。

@hao1707
Copy link

hao1707 commented May 29, 2019

我也同样出现这个问题。
image网上有解决办法,发现很多个版本都有这个问题。楼主能否在镜像配置上更新一下,让它启动的时候不要check,技术小白不知道怎么改。

@Raikyou
Copy link

Raikyou commented Jun 5, 2019

同遇见这个问题,添加 define('_SKIP_SELF_URL_PATH_CHECKS', true)到 config.php中,但是不知道 docker中这个文件在哪里,作者能不能更新以下,或者告知下

@HenryQW
Copy link
Owner

HenryQW commented Jun 5, 2019

不知道为什么你们会遇到这个问题,采用了多个域名指向同一个 ttrss?nginx 配置错误?这是我能想到的唯二可能性。我并不打算增加这个选项,它可能会导致不可知的影响。

我相信按照文档正常部署的用户没有这个问题。
config.php 是从官方 git repo 在 build 的时候实时 clone 下来的,需要增加额外的逻辑来添加这个选项,请参考 src/configure-db.php。

@majie1993
Copy link

这个问题一般都是 nginx 配置 https 有点问题导致的。最简单的解决办法是把 nginx.conf 里proxy_set_header 这个字段直接设置成你的域名+对应的端口,这样发送给 ttrss 后端的 header 就是当前访问的地址

@HenryQW
Copy link
Owner

HenryQW commented Sep 6, 2019

论好好阅读文档的重要性。
我知道自己动手两小时可以省去阅读文档五分钟的时间。
https://ttrss.henry.wang/#configure-https

@thinkways
Copy link

我也出现此问题。新系统,按步骤来,没装nginx。

@Boshishengworkh
Copy link

必须怒答一波,看到红色的SELF_URL_PATH 错误没有了,出现白色tiny tiny RSS登录界面好开心。大部分人看到这种解决办法就很懵逼,“添加define('_SKIP_SELF_URL_PATH_CHECKS', true)到 config.php中”,config.php到底在哪啊,如何添加啊,真是哭。好吧,其实不用添加就可以解决,首先我是采用docker-compose装的tiny tiny RSS,对小白来说真的超级省事友好,像我这种真正的小白,弄这个也不得不看个5分钟docker快速入门来糊弄一下,不然连docker-compose都搞不定。如果你装好了docker-compose里的4种自带软件:
Tiny Tiny RSS 本身
PostgreSQL 数据库服务
Mercury 全文抓取服务
OpenCC 简体、繁体中文转换服务
这时你去访问 {服务器 IP}:181,就是红色的错误提示。这是因为你还没有装nginx,config.php就算要修改也是要先装好nginx才有。
装好后,我们打开这Nginx 的配置文件 nano/etc/nginx/nginx.conf,在 http 项下,server 项前定义 upstream 服务:
upstream ttrssdev { server 127.0.0.1:181; keepalive 64; } 127.0.0.1就是你的IP名。
我到这就解决问题了!小白一枚,任何试图纠正我原理和名词的都是枉然,能解决问题就最好了!
详细步骤来自这里:
https://zhuanlan.zhihu.com/p/93005645

@HenryQW
Copy link
Owner

HenryQW commented Apr 27, 2020

必须怒答一波,看到红色的SELF_URL_PATH 错误没有了,出现白色tiny tiny RSS登录界面好开心。大部分人看到这种解决办法就很懵逼,“添加define('_SKIP_SELF_URL_PATH_CHECKS', true)到 config.php中”,config.php到底在哪啊,如何添加啊,真是哭。好吧,其实不用添加就可以解决,首先我是采用docker-compose装的tiny tiny RSS,对小白来说真的超级省事友好,像我这种真正的小白,弄这个也不得不看个5分钟docker快速入门来糊弄一下,不然连docker-compose都搞不定。如果你装好了docker-compose里的4种自带软件:
Tiny Tiny RSS 本身
PostgreSQL 数据库服务
Mercury 全文抓取服务
OpenCC 简体、繁体中文转换服务
这时你去访问 {服务器 IP}:181,就是红色的错误提示。这是因为你还没有装nginx,config.php就算要修改也是要先装好nginx才有。
装好后,我们打开这Nginx 的配置文件 nano/etc/nginx/nginx.conf,在 http 项下,server 项前定义 upstream 服务:
upstream ttrssdev { server 127.0.0.1:181; keepalive 64; } 127.0.0.1就是你的IP名。
我到这就解决问题了!小白一枚,任何试图纠正我原理和名词的都是枉然,能解决问题就最好了!
详细步骤来自这里:
https://zhuanlan.zhihu.com/p/93005645

Happy RSSing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants