Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added support for using secrets to store passwords and secrets.
The file
/etc/cont-init.d/02-load-secrets
, added to the base image, fetches the secrets from/run/secrets/
and stores them as new environment variables by creating a file with the name of the secret in/run/s6/container_environment/
. The s6 init system will then make the secrets available as environment variables.Note that there doesn't need to be an environment variable defining the location of the secrets, the existence of the secret in
/run/secrets/
(the default location) will make it available to the container. This should help prevent the need to edit any init or service run scripts.There is also a
SECRETS_DIR
environment variable added to theenv.example
file. This should be used to specify the directory on the host where the secrets are stored.gen-passwords.sh
has also been updated to useSECRETS_DIR
as the location to store the generated secrets.Edit: I just realised the environment variables could be left to exist and the use of secrets can be optional, the secrets will only replace the environment variables if they exist, otherwise the environment variables will remain untouched.