Revisiting SELF_URL_PATH

i’m sure most would agree that having to set this variable up is the single most annoying part of installing tt-rss. looking through the code, i managed to find one valid use-case where SELF_URL_PATH is actually needed and we can’t figure it out from server/request variables - digest template, which is prepared and sent on the backend.

therefore, i’m changing this to work as follows: SELF_URL_PATH config option becomes a fallback value for the CLI SAPI where HTTP request variables are not available, in any other case we’ll just go with whatever got auto-detected and hope for the best.

i’ll set the default to example.com/tt-rss or something like that so it would be obvious where to dig, but otherwise it’s not going to prevent application startup or anything of that nature.

passing correct Host header through the reverse proxy remains your responsibility. :slight_smile:

1 Like

This is a message of thanks. Especially with the docker container this has been, as you indicated, a real pain.

THANKS FOX!

should we remove the SELF_URL_PATH from our .env files?

unless you’re using email digest and simply can’t live without correct tt-rss links in the template (it’s in the footer somewhere, i think), you shouldn’t need it anymore.

you can remove it or keep it, it won’t break anything.

1 Like

It is possible this broke ttrss-api-resize for the Android app? I’m no longer getting images (on either feed listing or article preview) unless I disable image resizing. I still have SELF_URL_PATH set.

Log file from Android app @ 10-23 10:37:31.845 10222 10222 D setupWidgetUpdates: interval= 90000010-23 10: - Pastebin.com, I don’t see anything obvious in there. There are no errors/warnings in the server logs.

Android app is 1.305-fdroid (539). tt-rss version is v23.10-c28955c8.

Edit: I do see GET requests logged in the web-nginx container. E.g.
2023/10/23 10:59:48 stdout 172.22.0.1 - - [23/Oct/2023:14:59:48 +0000] "GET /tt-rss/api/public.php?op=api_resize_media--api_resize&url=https%3A%2F%2Fassets.amuniversal.com%2F00c252a08484013be1bc005056a9545d&referrer=https%3A%2F%2Fwww.gocomics.com%2Fgarfield-classics%2F2023%2F10%2F23&width=1024&force_stamp=0 HTTP/1.1" 404 153 "-" "Dalvik/2.1.0 (Linux; U; Android 14; Pixel 7 Pro Build/UP1A.231005.007)"

Edit 2: Clarification, on the feed listing, there is just blank space, on the article preview, a broken image placeholder is shown. If I take the resized image URL call logged in the Android app, I get a 404 response.

yup its possible, i’ll try to take a look tomorow. i’m also seeing this.

the /api/ shouldn’t be there :slight_smile:

I set up my nginx to proxy tt-rss. before I was just using localhost:8280 I can get to the login page but when I enter my credentials I get a 404 and this UEL is shown in the address bar:

http://tester.fios-router.home/tt-rss/public.php?return=http%3A%2F%2Ftester.fios-router.home%2Ftt-rss%2F

could be my set up for reverse proxy but thought I’d share, in case. If I use the localhost:8280 it still works. Just using the server name (myserver.my-localnet.domain) that fails.

https://gitlab.tt-rss.org/tt-rss/tt-rss/-/commit/9826d2f07527e3259957628030adc87bde391b0c

this is a horrible hack but i don’t have any other ideas

make sure your reverse proxy passes correct Host & X-Forwarded-Proto headers.

alright the above hack doesn’t work in all cases either. :frowning:

e: adding a trailing slash to tt-rss url in the android client made this work properly. …

I was able to get the android mobile app working but not the browser.

wrong (or blank) Host being passed, most likely.

i think there’s an example in the FAQ

https://gitlab.tt-rss.org/tt-rss/tt-rss/-/wikis/InstallationNotes#how-do-i-put-this-container-behind-a-reverse-proxy

thanks. all working now. my issue was the php-fpm conflict. works with browser and android client.

https://gitlab.tt-rss.org/tt-rss/tt-rss/-/commit/69c1c629927cd78286fc6c8d61b5b5ad78245508#898cd773d0af28d98d673612f628dca67992ea25_490_489 :thinking: not proud of this hack but at least there’s a unit test for this method now

I just upgraded to v23.10-0a5507d3 and resized images are now working on the Android app.