Server Secrets or .ENV for private information in seperate Compose Files/Stacks #27

Closed
opened 2023-12-16 14:40:49 -05:00 by sickprodigy · 2 comments
Owner

Trying to figure out the best way to handle this.

I want to start updating my configs through git so I can take note of changes made and what was working for and when it all went to shit etc.

Just makes more sense. So to do that, I need to hide private information at the same time that are setup in config files.

Docker says the best thing to do is use secrets:
https://docs.docker.com/compose/use-secrets/

Trying to figure out the best way to handle this. I want to start updating my configs through git so I can take note of changes made and what was working for and when it all went to shit etc. Just makes more sense. So to do that, I need to hide private information at the same time that are setup in config files. Docker says the best thing to do is use secrets: https://docs.docker.com/compose/use-secrets/
Author
Owner

Well i forgot how to do this and want to clarify here

https://gitea.rcs1.top/sickprodigy/docker-containers2/src/branch/main/karakeep/docker-compose.yml

normally looks like so:

    env_file:
      - .env

but replace with:


    env_file:
      - stack.env

for docker compose file within portainer. Then you manually load in the .env file in the gui

Well i forgot how to do this and want to clarify here https://gitea.rcs1.top/sickprodigy/docker-containers2/src/branch/main/karakeep/docker-compose.yml normally looks like so: ``` env_file: - .env ``` but replace with: ``` env_file: - stack.env ``` for docker compose file within portainer. Then you manually load in the .env file in the gui
sickprodigy added the Kind/Security
Priority
High
labels 2025-06-29 21:08:21 -04:00
Author
Owner

Instead of doing this, I really just made a script to take all my passwords and api links out of everything. Because taking .env updating example.env all the time was rather annoying. And maybe I would forget something. No thanks. Just copy all my files to a new directory I want to upload. Have my scripts pull out secrets,etc. Upload to git. Don't have to worry about forgetting to updating .env variables that may have updated eventually or something.

Instead of doing this, I really just made a script to take all my passwords and api links out of everything. Because taking .env updating example.env all the time was rather annoying. And maybe I would forget something. No thanks. Just copy all my files to a new directory I want to upload. Have my scripts pull out secrets,etc. Upload to git. Don't have to worry about forgetting to updating .env variables that may have updated eventually or something.
Sign in to join this conversation.