Skip to content
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

add: allow reading secrets from files #47

Merged
merged 2 commits into from
Nov 29, 2024
Merged

add: allow reading secrets from files #47

merged 2 commits into from
Nov 29, 2024

Conversation

mgoetzegb
Copy link
Member

@mgoetzegb mgoetzegb commented Nov 28, 2024

What

Allow reading secrets from files.

Pass the path to the file containing the secret to the service by appending _FILE to the env var name which normally would contain the secret directly.

If both env vars SECRET and SECRET_FILE are set, SECRET takes precedence.

As the original way of supplying secrets is still supported, this is a backwards compatible change.

Why

Using the docker secrets feature results in files containing the secret being placed into the container filesystem.

References

VTI-300

Checklist

  • Tests

@mgoetzegb mgoetzegb requested review from a team as code owners November 28, 2024 11:14
@mgoetzegb mgoetzegb added the minor release Set label to create a minor release label Nov 28, 2024
Copy link

Conventional Commits Report

Type Number
Added 1

🚀 Conventional commits found.

Instead of supplying the secret via env var SECRET they can be also passed via env var SECRET_FILE. The secret is then read from the given file path. If the same secret is supplied in both ways, the value passed directly by env var takes precedence
@mgoetzegb
Copy link
Member Author

added explaining comment to config and missing trailing newline to compose file

@mgoetzegb mgoetzegb merged commit 1e68e44 into main Nov 29, 2024
10 checks passed
@mgoetzegb mgoetzegb deleted the secrets-from-files branch November 29, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor release Set label to create a minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants