Skip to content

Dynamic environment variables, env-command #634

@alan-null

Description

@alan-null

We have password-command for repository password

How about having something similar to this for environment variables, so I don't have to store keys in my profile or .env file?

profile

azure:
  repository: "azure:backup:/"
  password-command: "kwallet-query -l wallet -f folder -r repo-password"

  env:
    AZURE_ACCOUNT_NAME: "blob-account"
    AZURE_ACCOUNT_KEY: "[REDACTED]"

profile-concept

azure:
  repository: "azure:backup:/"
  password-command: "kwallet-query -l wallet -f folder -r repo-password"

  env-command: "AZURE_ACCOUNT_KEY = kwallet-query -l wallet -f folder -r azure"
  env:
    AZURE_ACCOUNT_NAME: "blob-account"

I am able to do something like this for rclone so I am looking for something similar for native restic sync (no rclone)

  env:
    RCLONE_PASSWORD_COMMAND: "kwallet-query -l alan -f restic -r rclone"

I am not sure how exactly it should work. Whether it should :

  • map resolved variables to env. variables
  • map content of output pretending it's a content of file (like "env-file" but content instead of path will be our input)

AFAIK there is no other way to achieve what I want (integration with cli password managers)
Please correct me if I am wrong.

I believe this addition would be really nice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions