Note that DB_PORT defaults to 5432 which means if you were setting DB_TYPE to mysql you now also need to set DB_PORT to 3306

Not a big deal but thought I’d share

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.

Re-read the very first post in this thread. It says:

  1. 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.

  2. 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.

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.

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=');

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

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 :confounded::gun:

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")) {

yeah, definitely. i’ll remove it.

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?

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.

https://git.tt-rss.org/fox/tt-rss/src/branch/master/config.php-dist#L16

you see how there’s a link there? now try following it.

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.

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';

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