Adds the ability to alias/map secrets#1439
Merged
djmb merged 1 commit intobasecamp:mainfrom Mar 10, 2025
Merged
Conversation
djmb
reviewed
Mar 4, 2025
Collaborator
djmb
left a comment
There was a problem hiding this comment.
Definitely something we need to fix and this seems like a good solution. Just had one minor suggestion
966acc0 to
973fa1a
Compare
Contributor
Author
|
@djmb ready for another review, LMK if you intended something else: https://github.com/basecamp/kamal/pull/1439/files#diff-712f1f995500a82c490e99de70b1622438c2c2d87250b77bc4d245b03d432c57R31 |
visini
added a commit
to visini/kamal
that referenced
this pull request
Mar 22, 2025
Aliasing for secrets was introduced in basecamp#1439, but only supported "top-level" secrets. This adds for aliasing/mapping secrets within tags.
visini
added a commit
to visini/kamal
that referenced
this pull request
Mar 22, 2025
Aliasing for secrets was introduced in basecamp#1439, but only supported "top-level" secrets. This adds support for aliasing/mapping secrets for tags.
visini
added a commit
to visini/kamal
that referenced
this pull request
Mar 22, 2025
Aliasing for secrets was introduced in basecamp#1439, but only supported "top-level" secrets. This adds support for aliasing/mapping secrets for tags.
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.
If you find yourself in a situation where you need to declare secrets for an accessory, etc. but the value of the secret is defined in your
.kamal/secretsbut under a different name, with the current implementation ofkamal, there is no way to support this concept of aliasing/mapping.The use case here is when you have two (or more) accessories that require the same ENV variable name, but the value is different for each accessory. For example, when defining two different Postgres backup accessories, one for your main Rails database, and another accessory for a supplementary/other database, it is not possible to have the two accessories have their own
DB_PASSWORD, for example.This PR modifies the way secrets work to support the concept of aliasing/mapping by using
:as a separator. This will then allow you to declare secrets like:Where your
.kama/secretscould look like: