sashk
64
Iām somewhat confused: is this change live in master? Because when I removed config.php ā code starts complaining that it is missing:both updater and app. When I start using .env file, it complains that none of the variables are defined. Basically, old config stopped working, but new does not yet work.
gbcox
65
Re-read the very first post in this thread. It says:
-
Unless you are using compose, you will have to migrate your old config.php defaults into the new⦠format. Then gives you a link to the example. Basically it involves changing the word ādefineā to āputenvā and adding the prefix of āTTRSS_ā to the variable names.
-
config.php is becoming optional. The keyword here is ābecomingā which is in the future. So, unless youāre told otherwise, you still need it.
I just edited my config.php file which took about 1 minute, saved it and restarted. Problem solved, havenāt had any issue.
I didnāt have to do anything with an .env file. The instructions above didnāt mention it, and I havenāt looked for it. That is for docker-compose users.
Remember, you are overriding the settings of ā¦/classes/config.php. Donāt change that file. Change only config.php in the base directory. Again, the instructions are fairly clear on what to do. Go to the URL mentioned in the first post.
sashk
66
The whole first post is saying something about future. For me updating config.php to use putenv() based format did not work. Then I tried .env based (since Iām using my own version of docker-compose) and it didnāt work either. So question was and is: did tip-config-ojbect branch got merged into master?
Doing various git diffs suggests that it did, but future-versioned wording in top post makes things too confusing.
gbcox
67
Quick answer, replace the contents of your config.php file with the following, filling in your values between the = and ā sign. For example if you are using pgsql, the first variable line would be:
putenv(āTTRSS_DB_TYPE=pgsqlā);
<?php
// *******************************************
// *** Overrides for classes/config.php ***
// *******************************************
putenv('TTRSS_DB_TYPE=');
putenv('TTRSS_DB_HOST=');
putenv('TTRSS_DB_USER=');
putenv('TTRSS_DB_NAME=');
putenv('TTRSS_DB_PASS=');
putenv('TTRSS_SELF_URL_PATH=');
putenv('TTRSS_SINGLE_USER_MODE=');
putenv('TTRSS_SIMPLE_UPDATE_MODE=');
putenv('TTRSS_SMTP_FROM_NAME=');
putenv('TTRSS_SMTP_FROM_ADDRESS=');
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