gdamjan
68
hahaha, I personally am running tt-rss as a systemd portable service (you can consider it a lighter weight container image), so this new config system will actually help and vastly improve my setup (I can put the config in systemd EnvironmentFile= file).
ps.
it’s also build with Nix GitHub - gdamjan/tt-rss-service: tt-rss systemd portable service built on Nix
fox
69
yes, anything that uses systems similar to .env is going to benefit from this approach. that was the major goal behind this change.
also, easily adjustable defaults stored in a sane fashion.
e: imagine dealing with something like config.php through ansible 

gdamjan
70
I guess the config.php in the root directory is no longer required - since environment variables can come from anywhere.
I’m talking about this line:
include/sanity_check.php: if (!file_exists("config.php")) {
fox
71
yeah, definitely. i’ll remove it.
sashk
72
What am I doing wrong? PHP 7.4.xx or php 8…
PHP Fatal error: Uncaught Error: Class 'Config' not found in /app/include/functions.php:39
Stack trace:
#0 /app/update_daemon2.php(12): require_once()
#1 {main}
thrown in /app/include/functions.php on line 39
I can no more longer login to my ttrss instance. 2FA is enabled. After fill in TOTP and click continue butten the website is rederiected to the Authentication site with hint „Incorrect username or password“.
Username, password and TOTP are correct.
config.php:
<?php
// *******************************************
// *** Database configuration (important!) ***
// *******************************************
putenv('TTRSS_DB_TYPE=mysql');
putenv('TTRSS_DB_HOST=db');
putenv('TTRSS_DB_USER=ttrss');
putenv('TTRSS_DB_NAME=ttrss');
putenv('TTRSS_DB_PASS=1234');
putenv('TTRSS_DB_PORT=3306');
putenv('TTRSS_SELF_URL_PATH=https://ttrss.domain.com/');
putenv('TTRSS_LOG_DESTINATION=');
I use docker PHP7.3 with Apache and ttrss from git.
All works before the changes for about 2 weeks ago.
No error in the web server log or in the firefox console output.
Is there something that is missing in the config.php or in the apache configuration?
fox
75
most likely you’re the second person (first one was @markwaters) still using a legacy OTP secret variant which got obsoleted years ago and finally dropped recently, yes.
i suggest disabling otp through the database and enabling it back through the UI with the new secret.
sorry about that, i was actually conflicted between supporting this further or finally removing it, but seriously, two people affected. two.
(supporting it further would mean checking three different OTP secrets and, well, it was simply too much)
In case someone struggle like me with the PG config as it is not just prefixing old config with TTRSS_, basically w/o a DB_NAME that can’t work and wasn’t needed before:
putenv('TTRSS_DB_TYPE=pgsql');
putenv('TTRSS_DB_HOST=localhost');
putenv('TTRSS_DB_NAME=ttrss');
putenv('TTRSS_DB_USER=ttrss');
putenv('TTRSS_DB_PASS=xxxx');
putenv('TTRSS_DB_PORT=5432');
putenv('TTRSS_SELF_URL_PATH=http://xxxx.com');
Small suggestion, a basic example in the documentation would help, or better in the default conf comments at it used to be.
fox
77
Wow, what a… nice answer! Great support and positivity.
I did follow that link, read that page, followed the instructions, to get an error message that was not understandable like cannot find db host=localhost…
I figured out the solution by looking at code.
All that waste of time could have been spared by what I’ve friendly suggested above.
Thanks fox, the legacy OTP was the problem.
The authentication works after OTP disabling in the database.
krak
80
How disable OTP? I can’t login.
Sorry. I found
update ttrss_users set otp_enabled=0 where id=1;
Following query worked for me:
UPDATE ttrss_users SET otp_enabled = false WHERE login = 'admin';
eiland
82
With me it really complained Exception while creating PDO object:SQLSTATE[HY000] [2002] Permission denied as long as I didn’t not clear the db port with putenv('TTRSS_DB_PORT=');
pffff
eiland
83
…and feeds weren’t updating, because the default PHP_EXECUTABLE was set to “/usr/bin/php” in classes/config.php
Changed it with putenv('TTRSS_PHP_EXECUTABLE=/usr/bin/php74'); in my legacy config.php
fox
84
i’m not sure why you decided to keep us all informed in trials and tribulations of your unsupported tt-rss install but it’s not nearly as interesting or useful as you might think.
“i’ve changed X to Y” is only useful to others if you describe the context and reasons for it, otherwise you’re just encouraging people to change random things around without any understanding, confusing everyone who might follow your hollow non-advice further.
in short, post this shit to your personal blog from now on.
j_d
85
Thanks a lot for all this information and tips in this thread. I did the update to the new config unintentionally and had some problems. I know reading helps, but if someone runs into the same problem, here is what I did and what you should avoid.
- I replaced
define() with putenv(), e.g. putenv('DB_HOST', 'myserver'); (This is wrong!)
- I adjusted the syntax, so
putenv('DB_HOST', 'myserver'); became putenv('DB_HOST=myserver'); (This is still wrong!)
- I added the
TTRSS_prefix: putenv('TTRSS_DB_HOST=myserver'); (This finally works)
If you do the update, please read the documentation at https://git.tt-rss.org/fox/tt-rss/wiki/GlobalConfig. It helps a lot!
Now that I have admitted my mistakes, another big thanks for the rebuild, my config is now significantly smaller.
Yeah, well, MY problem (last night) was a missing ’ at the end of one of the new env variables… Which wouldn’t have been so bad, except nothing happened. no error messages, nothing, same with update.php, run it, no output, nothing.
So, I tried the old tried and true “comment out all of my stuff and see what happens” routine, then add back lines until I found the broken one.
syntax highlighting would have helped me there, but didn’t have it on that system. Anyway, it’s all working now.
ekin
87
I just updated tt-rss and had to update config.php as discussed in this thread. There was a clash of the option SELF_USER_AGENT in config.php with the definition in functions.php reported in the event log. I commented out the line in functions.php to make sure the definition in config.php is used. I am modifying SELF_USER_AGENT because otherwise some RSS servers that I use refuse connections from tt-rss. At least that’s how it was last time I checked (some months ago). Is the SELF_USER_AGENT option gone for good, or is there a chance that it can be reintroduced?