Tiny Tiny RSS: Community

Ttrss-app overwrites data in html volume

I tried to edit files in the “html” docker volume and I noticed that every time ttrss-app restarts, it overwrites my changes. Please forgive me if I’m mistaken, but I believe Docker best practice is for Docker containers to respect user changes to the volumes because the purpose of volumes is to persist user changes between container instances. If ttrss overwrites the “html” volume every time it starts, what’s the point of even putting the www code inside a volume?

If you agree, it would be very helpful if the Dockerfile for ttrss-app would be edited so it would not make changes to the html volume, unless the html volume is 100% empty and is being initially created.

Details about the problem I was trying to fix:
My reverse proxy was fighting the SELF_URL_PATH enforcement and index.php redirection, and resulting in infinite redirect loops. I deleted the /index.php that redirects to /tt-rss/, and I moved the contents of /tt-rss/ to the root directory of the html volume. But the next time I started ttrss-app, the index.php was overwritten with the redirection code and all the files were back in /tt-rss/ again.

Thank you for the excellent web app and your devotion to it!

ah yes an excellent idea. so the container is not going to update ever again unless you manually recreate the storage volume then? have you tried to think for a bit before posting this gem of wisdom?

live code is stored on a storage volume because it’s more straightforward than creating a mess of symlinks to a path in the container base image. this does not necessarily mean that the volume is persisted as-is. i’m sorry to disappoint you but this particular alleged best practice exists sorely in your misinformed head.

data is allowed to persist where it makes sense to do so, e.g. cache, local plugins and themes, etc. everything else is synchronized from master source (or latest docker hub image) to ensure you running latest master code.

people running latest master code with little effort has been one of the major goals behind this whole compose setup. it is not going to ever change. as far as i remember it’s even right there in the README.

you were not the first to bash your head against this particular decision (tt-rss in a separate location instead of root). instead of doing whatever you did there it would be smarter to search through the docker discussion thread because this has been discussed multiple times before.

You make a good point. In nicer words: “another separate use for Docker volumes is to share data between containers.”

My idea wasn’t completely absurd though: When installing Linux package updates, sometimes it says “A new version of configuration file x is available, but the version installed currently has been locally modified. Do you want to keep your version, the updated version, or manually merge them?”

Another solution to the goal of removing the tt-rss subdirectory is for ttrss to replace the redirection index.php and tt-rss folder with a virtual subdirectory setting in the web server which can be customized by the docker-compose env variables. That makes it super easy for users to use root or any subdirectory they want.

Of course, I respect that it’s your project and you can do whatever you want. I’m just trying to offer ideas to make things easier for everyone. A hard-coded subdirectory and redirection limits things for no obvious reason.

if you’re interested in making a PR with this implemented in a clean and backwards-compatible fashion, i promise to review it.