Docker-compose + tt-rss

Hello! I am trying to enable password recovery by email using an external SMTP server.

To do that, I have installed, enabled and configured the system plugin ttrss-mailer-smtp.

But then when I try to recover a password for an account, I get this error: Extension missing: openssl

After looking online a bit, this seems to be caused by php not having the openssl extension installed and/or enabled in php.ini.

Thus I looked into the app Dockerfile (from ttrss-docker-compose, branch static-dockerhub), and noticed that php7-openssl is not part of the installed modules, and that php.ini is not modified to enable openssl.

Is it possible to update the Dockerfile to add these changes, to give people the possibility to use plugins that require openssl, such as the mailer?

thanks in advance and thanks for your work! cheers

yes, this makes sense. i would appreciate if you filed a PR (i’ll need your gogs account to give you necessary permissions) otherwise i’ll make a note to take a look at this when i have some time.

Sure, I just created my account on your gogs instance with the username “Ezwen”.

I’ll try to make a PR soon.

Quick slightly off-topic question: is there a way to specify an SMTP port with the ttrss-mailer-smtp plugin? I seem to understand that it connects to port 25 by default (line 61 of init.php), but with my server configuration I have no choice but to use port 587.

alright, you should have necessary privileges now.

i’ll take a look a bit later, it could be made configurable if it’s currently not, i’m reasonably certain phpmailer should support it. either that or you take a look and file another PR :slight_smile:

the README.md in git.tt-rss org/fox/ttrss-mailer-smtp, the git repo referenced in the init.php, says

define('SMTP_SERVER', '');
// Hostname:port combination to send outgoing mail (i.e. localhost:25).

i don’t think that could be any clearer. but just in case there was any disparity between the documentation and the code (apart from a bug in the implementation), i reviewed init.php and it splits SMTP_SERVER into the SMTP host and port based on the semicolon.

$pair = explode(":", SMTP_SERVER, 2);
$phpmailer->Host = $pair[0];
$phpmailer->Port = $pair[1];

(which is immediately above the line that you referenced where the port defaults to port 25, though it’s line 31 and not 61, but maybe the plugin version you have is not the current git master, ie commit eebc18f00e).

@undefined Indeed I focused too much on the variables names (here SMTP_SERVER), and did not correctly read the documentation… I guess my brain was expecting too much a variable naled SMTP_PORT. Thanks for the clarification :slight_smile:. I changed my configuration and now everything is working.

@fox I have sent my PR which simply adds php7-openssl to the Dockerfile.

merged, thanks! /20char

Hello!

I tried the installation steps using docker-compose here: /fox/ttrss-docker-compose/src/static-dockerhub/README.md (I can’t post links, so I stripped the domain name git[dot]tt-rss[dot]org)

But I am blocked in a waiting loop on the DB, with this message on repeat:

updater_1  | + pg_isready -h db -U postgres
app_1      | + pg_isready -h db -U postgres
updater_1  | db:5432 - no response
updater_1  | + echo waiting 'until' db is ready...
updater_1  | + sleep 3
updater_1  | waiting until db is ready...
app_1      | db:5432 - no response
app_1      | + echo waiting 'until' db is ready...
app_1      | + sleep 3
app_1      | waiting until db is ready...

What did I miss?
Thank you!

Lets pretend you are a complete beginner to docker and after doing lots of reading and being confused you wanted to know how to actually backup the database, where would you start such a journey?
Do you need to backup the whole “ttrss-docker_db” volume or create another container that mounts it and then runs a command to backup the database itself?

Have you tried an internet search for “how to back up postgresql database running in a docker container”? I just did and there seems to be a variety of answers on StackOverflow, in blog posts, and even implemented on Github. Hint: pg_dump & pg_dumpall can work over a network connection, so it doesn’t really matter if the DB is containerized or not.

alternatively to the above you can run pg_dump from the container i.e. docker exec --user postgres $CONTAINER pg_dump ... > backup.sql etc

well, is your db container actually running? if it does run, this means that for some reason containers can’t communicate properly, which could be a docker/iptables issue.

Should I be starting the DB container myself? I thought the docker-compose.yml was in spinning it up.

no, docker compose should handle it, but it could fail to start for some reason, for example.

you have decided to not post any logs related to the db container so i can’t really help you any further.

Sorry I thought I was doing something wrong and that the solution was probably obvious.

Here is my .env (technically vanilla, I just changed the password) and the docker-compose output:

Still can’t post links, so here add gist[dot]github[dot]com before /MightyCreak/db297be9357c2fc38f415d045f484b7e

Thank you!

it’s hard to say what could be wrong from your log. at least db container is running.

you can try running sh in the app container and see if you can communicate with the db one, either by hostname or IP. start with ping.

my uneducated guess would be a networking issue of some kind related to virtual docker networks. check iptables, etc.

e: you can also try restarting dockerd.

I’m on Fedora (32) which can be pretty strict on the security side (especially with SElinux). Though I thought what happen within docker containers would prevent from having security issues with the hosting OS.

I’ve sh’d in the app container and I can ping all the other containers (db, updater, web) and I verified they all have different IPs. When I run pg_isready -h db -U postgres, I also get db:5432 - no response (as in the logs), with echo $? returning 2.

I don’t known postgres enough to know if it is properly running. I sh’d into the db container and tried pg_isready -h db -U postgres and I got a valid result this time: db:5432 - accepting connections

It seems like the postgres port in the db container is not bound to the exterior of the container (I guess it’s the swarm in this case?).


Don’t know if it helps, here’s the output of docker-compose ps db:

      Name                     Command              State    Ports  
--------------------------------------------------------------------
ttrss-docker_db_1   docker-entrypoint.sh postgres   Up      5432/tcp

i don’t think your problem is related to tt-rss per se, asking docker or fedora people for help might be a better idea in this situation.

personally i can suggest using a better fitting distro to run servers on (in the rpm world that would be centos or oracle linux i suppose), unless you really want to be an unpaid alpha-tester for redhat for whatever reason, dealing with issues similar to the above.

I am trying on Fedora, well first, because I like it, and because it is my distro on my desktop, my server distro is an Ubuntu Server, but due to the nature of Docker, I wouldn’t be surprise to have the same issue on any modern distro – if it’s not in 20.04, it would be in the next one, or the one after.