resticprofile icon indicating copy to clipboard operation
resticprofile copied to clipboard

Environment variables from file

Open mjmeintjes opened this issue 1 year ago • 3 comments

I'd like to get the sensitive environment variables (like S3 keys) from a file instead of having them directly in the config file.

So similar to the password-file option, maybe have an env-file in addition to the current env option.

mjmeintjes avatar Feb 12 '24 02:02 mjmeintjes

Yeah I suppose that shouldn't be difficult to implement 🤔

creativeprojects avatar Feb 12 '24 22:02 creativeprojects

@creativeprojects , I'll take this one.

Had some thoughts about it last year. E.g. this feature should have the following parts:

  • Multiple env files support ( e.g. https://github.com/joho/godotenv )
  • Env file monitoring and reloading between run steps.
  • Template func to create a temporary env file (special case of {{ tempFile "filename" }}) that can be used in shell hooks to pass variables around (like in github actions).

jkellerer avatar Feb 13 '24 11:02 jkellerer

~... and for later maybe: re-evaluate profile if env changed.~ ... removed as not relevant for now. Can be supported just in an init step to support dynamic config file creation (e.g. for #156 ), this is however out of topic for this request.

jkellerer avatar Feb 13 '24 11:02 jkellerer