mirror of
https://github.com/moghtech/komodo.git
synced 2026-03-09 07:13:36 -05:00
Periphery environment variables causing issues with postgres #178
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @june012006 on GitHub (Jan 11, 2025).
When setting up Immich, based on the 'official' compose file, I kept getting a password error in the immich app. The compose file uses a .env file with a DB_PASSWORD variable to set the password for all services, which is a fairly common practice. During troubleshooting, I logged in to the pg container for immich, and checked what POSTGRES_PASSWORD was set to, and it had no relation to what the environment variable should've been. It persisted through multiple redeployments. I realized it has to be coming from somewhere, so I logged in to the periphery container, and found the DB_PASSWORD environment variable was the same.
The issue in my compose file is this line POSTGRES_PASSWORD: ${DB_PASSWORD}, it should be getting the variable from the env file, but instead it's being overridden by the periphery value. This is a fairly common environment setting. Can we get the variable for the periphery changed to something less generic? so it doesn't interfere with other projects?
@mbecker20 commented on GitHub (Jan 12, 2025):
This is a good point that I did overlook, thanks, I'll use another Komodo-specific env variable to avoid any overlap. You may also consider moving to the more secure "docker compose secrets": https://docs.docker.com/compose/how-tos/use-secrets/#advanced. The secret env variables like
KOMODO_DATABASE_PASSWORDall support_FILEto use with docker compose secrets. Ref: https://github.com/mbecker20/komodo/blob/main/config/core.config.toml#L260@MFDoombino commented on GitHub (Jan 21, 2025):
I cannot get this to work no matter what I try.
Stack DIR is already /etc/komodo/stacks
I've tried not using environment variables at all, tried using secrets, nothing is working.
@Smiie-2 commented on GitHub (Feb 1, 2025):
I'm having a similar issue. recently moved from dockage to komodo, hence I moved all my stacks from /opt/stacks to /etc/komodo/stacks. Everything but immich is working great.
DB_location=./postgress in my .env. When starting immich via komodo it for some reason I can't understand, sets the variable as /opt/stacks/immich. If I go to /etc/komodo/stacks/ and run docker compose up, it correctly reads the env file and uses /etc/komodo/stacks/immich/.
Even setting a static path does nothing to change this behavior.
@MFDoombino commented on GitHub (Feb 1, 2025):
@Smiie-2 I edited the Environment file of Komodo itself which for me is at /opt/komodo/compose.env and changed the variable names to not be
DB_USERNAMEorDB_PASSWORDand changed them to be more specific.KOMODO_DB_USERNAMEetc. Make sure you update the references in the yaml file as well. I believe @mbecker20 said this will be fixed in an upcoming update.The trick that took me a bit is you then have to compose down Komodo and rebuild it to make sure it uses the new environment variables.
@mbecker20 commented on GitHub (Aug 26, 2025):
They have all been KOMODO_* for a while now