From d1f93ea0becfa4966ef73c05ec6bc75b2bdf42bf Mon Sep 17 00:00:00 2001 From: azrdev Date: Fri, 24 Nov 2023 22:12:52 +0100 Subject: [PATCH] docs: add instructions to get pw from environment variable tested with vdirsyncer 0.19.2 on archlinux --- docs/keyring.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/keyring.rst b/docs/keyring.rst index 747553d..a7ef946 100644 --- a/docs/keyring.rst +++ b/docs/keyring.rst @@ -78,3 +78,19 @@ You can also simply prompt for the password:: type = "caldav" username = "myusername" password.fetch = ["prompt", "Password for CalDAV"] + +Environment variable +=============== + +To read the password from an environment variable:: + + [storage foo] + type = "caldav" + username = "myusername" + password.fetch = ["command", "printenv", "DAV_PW"] + +This is especially handy if you use the same password multiple times +(say, for a CardDAV and a CalDAV storage). +On bash, you can read and export the password without printing:: + + read -s DAV_PW "DAV Password: " && export DAV_PW