-
-
Notifications
You must be signed in to change notification settings - Fork 795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting backend passwords with docker compose secrets #3656
Setting backend passwords with docker compose secrets #3656
Conversation
@aljora this PR is in draft state, is that intentional? |
@@ -236,7 +236,7 @@ def OPENAI_ENABLED(self) -> bool: | |||
# Testing Config | |||
|
|||
TESTING: bool = False | |||
model_config = SettingsConfigDict(arbitrary_types_allowed=True, extra="allow") | |||
model_config = SettingsConfigDict(arbitrary_types_allowed=True, extra="allow", secrets_dir="/run/secrets") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't given thought to the full implications of this (or even looked at what SettingsConfigDict does), but I think we'd want this information reflected in the doco in some way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thank you.
Yes, I wanted to put this up there while I was confirming usage and writing documentation. I'll move it to the ready state. |
Hey, thanks for your work on this :) Tested it and works for me 👍 |
What type of PR is this?
What this PR does / why we need it:
This change would allow administrators to share their secrets with the mealie container without needing to enter them through the environment variables, which could possibly expose them to other processes.
It was chosen to hard-code the path to avoid needed to process environment variables before the pydantic object was created. By default Docker places all secrets in files according to their names into a single directory. This supports the default use case but would need further effort to support other paths.
Which issue(s) this PR fixes:
Fixes #3606
Special notes for your reviewer:
Automated testing was considered but I did not want to inconvenience all other developers on this project by making them declare secrets in their dev containers or machines. Is there a need to create a CI workflow that uses a custom container to run tests?
Testing
The change was verified by running the production container with and without the secrets directory present. With the secrets directory, the content of the secret was evident in the logs showing that the information reached the backend successfully. Note that this PR does not address whether or not secrets are compromised by appearing in the logs. With the directory absent, the logs include a warning per the pydantic docs.