Skip to content

Allow custom configuration file location when using Docker#1383

Open
iwitz wants to merge 3 commits intospiral-project:mainfrom
iwitz:main
Open

Allow custom configuration file location when using Docker#1383
iwitz wants to merge 3 commits intospiral-project:mainfrom
iwitz:main

Conversation

@iwitz
Copy link

@iwitz iwitz commented Jun 29, 2025

I've been playing with AppArmor lately and have been restricting access to /etc in many systems.

Doing this with IHateMoney installed on a server is possible since the configuration file's location can be changed from /etc to somewhere else. However in IHateMoney's Docker image the ability to change the configuration file's location was not implemented, so access to /etc within the container was mandatory.

This pull request implements that feature using the same environment variable (IHATEMONEY_SETTINGS_FILE_PATH) as is documented here : https://ihatemoney.readthedocs.io/en/latest/configuration.html

It allows the person running the containers to change the configuration's file location, for example if they wish to deny access to /etc. This also makes the app's behaviour consistent between servers and docker containers.

iwitz added 2 commits June 30, 2025 01:40
The IHATEMONEY_SETTINGS_FILE_PATH variable is not necessary but having it in the file is a way to show that it can be changed
@almet
Copy link
Member

almet commented Jun 30, 2025

Thanks for opening this PR. If I follow correctly, this means that you would need to add a different volume to the docker-compose and then point there in the settings, am I correct? If that's the case, I'm not sure about the mkdir -p $(dirname $IHATEMONEY_SETTINGS_FILE_PATH) line.

Can you explain why you need this in your case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants