[Feature Request] File based Environment Variables #704
Labels
No Label
dependencies
duplicate
help wanted
invalid
kind/bug
kind/feature
needs reproduction
question
security
wontfix
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/api#704
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
Hello, thank you. I just tried Vikunja and love it so much. Can we have file based environment variables like in Docker official image or Linuxserver.io do?
For example:
VIKUNJA_SERVICE_JWTSECRET_FILE=/path/to/file
Thank you
You mean specifying some variables through a file?
Or a regular config file? Because that's already possible.
No, I want to use docker secrets to store my sensitive data like this: https://medium.com/@adrian.gheorghe.dev/using-docker-secrets-in-your-environment-variables-7a0609659aab
For example, instead of defining env var like this:
VIKUNJA_SERVICE_JWTSECRET=(secret)
I can use:
VIKUNJA_SERVICE_JWTSECRET_FILE=/path/to/file
Only for the jwt secret and third party API tokens?
It will be better if you can do them all, just a simple script like the one in the link I posted above. But if you want me to make a list of must have ones, they are:
Do you want to send a pr?
Sorry I don't know how to code 😭
Everyone started as a beginner once 🙂
On another note, I opened an issue about this at the viper repo (the config library Vikunja is using): https://github.com/spf13/viper/issues/1022
I'm learning, but thank you, awesome to get quick responses from the main author 😁
Looks like there's been an open PR since 2015 about this: https://github.com/spf13/viper/pull/94
Sorry, it's been a long while and I don't really need this feature anymore. But as this issue is still open until now, I want to point out that this feature should not be in the source code, but in the container runtime.
This is how Docker official images are implementing it:
cb0bb9ac8d/10.8/docker-entrypoint.sh (L21-L40)
cb0bb9ac8d/10.8/docker-entrypoint.sh (L42-L52)
cb0bb9ac8d/10.8/docker-entrypoint.sh (L213-L217)
Basically just create a script and call the script in
Dockerfile
as entrypoint. The script should find environment variables and set another environment variables based on the content inside that env. Easy version should be:It's not really needed in Kubernetes as I'm using it now, but it's really needed if you're using docker secret to store env.
That sounds like a good way to do this, thanks for pointing it out.
If anyone wants to implement this, I'd be open for a PR.
@konrad isn't that possible now?
@dpschen no