mirror of
https://github.com/qdm12/ddns-updater.git
synced 2026-07-29 00:52:37 -04:00
Feature request: allow config.json to be provided as a Docker secret.
#143
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 @fresh2dev on GitHub (Sep 21, 2021).
Originally assigned to: @qdm12 on GitHub.
allow
config.jsonto be provided as a Docker secret (by providing a new CLI parameter, or environment variable).When using Docker Swarm, the most secure way to provide sensitive information to containers is using Docker secrets. Secrets are mounted into containers at the path
/run/secrets/<name>. See the example here.Using the Docker image,
qmcgaw/ddns-updater, there is no way to create a Docker secret ofconfig.jsonand reference it in the container at the path/run/secrets/....I tried setting
DATADIR=/run/secrets, but this doesn't work because the path is not writable forupdate.json.In this scenario, I usually resort to modifying the container entrypoint logic to symlink/copy the secret file to the expected path before invoking the app. However, I'm unable to do that with this image because there is no shell available.
For this to be possible, this app/image would need to do at least one of the following:
app --config-file /run/secrets/config.jsonCONFIG_FILE=/run/secrets/config.jsonThis would make the app/image more secure and also more portable since it could then rely on Docker secrets/volumes for
config.jsoninstead of a host-bind mount, eliminating the need to perform step 1 of the ddns-updater setup.@qdm12 commented on GitHub (Jun 17, 2024):
My apologies for the MASSIVE delay visiting this issue.
This is done in
ca85596e19with the env variableCONFIG_FILEPATH. By default it'sDATADIR+ config.json, but you can now set it to i.e./run/secrets/config.json.