Wingysam / Christmas-Community

Christmas lists for families
GNU Affero General Public License v3.0
245 stars 41 forks source link

Set location of PouchDB log file with environment variable. #93

Closed bsiddans closed 6 days ago

bsiddans commented 11 months ago

As mentioned in #92 PouchDB attempts to create a logfile on startup at /usr/src/app/log.txt, and if it is unable to do, the application crashes. This issue occurs when running the application containerised as a non-root user.

This PR adds an enviroment variable to set the location of the DB log file, so that it can be set to a location that allows the application to start when running non-root, which addresses the issue. By default this is set to /dev/null, as the log does not appear to collect any data in normal operation, and logging to file seems less aligned with the intent of using inMemoryConfig. However this can be easily overridden if needed (for debugging, or preference) using the environment variable. Other logs written to console are unaffected by this change.

Wingysam commented 11 months ago

Thank you. I'll update this to use the config system and merge it.

Wingysam commented 6 days ago

Hey sorry that took me a while! Merging it in now.