calcurse-caldav: Read password from env variable
Add the option to read the basic authentication password from the CALCURSE_CALDAV_PASSWORD environment variable. Signed-off-by: Randy Ramos <rramos1295@gmail.com> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
parent
5b94be2246
commit
9be2c106e6
@ -508,6 +508,9 @@ authcode = args.authcode
|
||||
verbose = args.verbose
|
||||
debug = args.debug
|
||||
|
||||
# Read environment variables
|
||||
password = os.getenv('CALCURSE_CALDAV_PASSWORD')
|
||||
|
||||
# Read configuration.
|
||||
config = configparser.RawConfigParser()
|
||||
if verbose:
|
||||
@ -563,10 +566,8 @@ if config.has_option('Auth', 'UserName'):
|
||||
else:
|
||||
username = None
|
||||
|
||||
if config.has_option('Auth', 'Password'):
|
||||
if config.has_option('Auth', 'Password') and not password:
|
||||
password = config.get('Auth', 'Password')
|
||||
else:
|
||||
password = None
|
||||
|
||||
if config.has_section('CustomHeaders'):
|
||||
custom_headers = dict(config.items('CustomHeaders'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user