Docker secrets as templates - #80
Open
hazzuk wants to merge 5 commits into
Open
Conversation
Will need to handle templates and secrets inside the same task file.
Required as each stack will now need a unique secrets directory created.
Otherwise causes issues with services like Pocket-ID. Where the file is treated as binary, so any CR/LF line terminator is treated as part of the secret.
Owner
Author
|
Secrets documentation changes complete: https://docs.karolabs.dev/dev/compose/secrets/ @mosslocker changes have been made since yesterday, which should further help to clarify how secrets work. |
Collaborator
What's the problem?After a conversation on 10-08-2026
Can we instead...
Current format:hazzuk_core_pocketid_enabled: false
hazzuk_core_pocketid_stack_defaults:
pocketid:
image: ghcr.io/pocket-id/pocket-id
version: v2.6.2@sha256:1cc51e5b36fa7ec31368d3efb24ba362be6dce20f3cc0a2852843527bd5110f0
log_level: info # debug, info, warn, error
encryption_key: "" # `openssl rand -base64 32`
maxmind_license_key: ""Example 1hazzuk_core_pocketid_enabled: false
hazzuk_core_pocketid_stack_defaults:
pocketid:
image: ghcr.io/pocket-id/pocket-id
version: v2.6.2@sha256:1cc51e5b36fa7ec31368d3efb24ba362be6dce20f3cc0a2852843527bd5110f0
log_level: info # debug, info, warn, error
encryption_key_secret: "" # `openssl rand -base64 32`
maxmind_license_key_secret: ""Example 2hazzuk_core_pocketid_enabled: false
hazzuk_core_pocketid_stack_defaults:
pocketid:
image: ghcr.io/pocket-id/pocket-id
version: v2.6.2@sha256:1cc51e5b36fa7ec31368d3efb24ba362be6dce20f3cc0a2852843527bd5110f0
log_level: info # debug, info, warn, error
secrets:
encryption_key: "" # `openssl rand -base64 32`
maxmind_license_key: ""Example 2 is my personal favourite, as it reduces word repetition in the individual variable names |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Docker secrets are now defined using templates (instead of convoluted defaults variables).
See hazzuk/karo-custom#23 for a reference implementation.
Changes
up.yml. Simplifying the role, and allowing for secrets to be templated.karo_compose_secrets_pathvariable, set dynamically at runtime per stack.Notes
Secrets as templates have some large advantages:
compose.dictionary variable can now be used to reference a stack variable.Checklist