olcf / pkpass

PKI based password manager
https://pkpass.readthedocs.io/en/latest/
Other
16 stars 3 forks source link

Make pkpass easier to run without a .pkpassrc file #2

Closed rmadamson closed 6 years ago

rmadamson commented 6 years ago

Fails with:

ryan@lappy486:~/git/pkpass$ ./pkpass.py listrecipients
Traceback (most recent call last):
  File "./pkpass.py", line 8, in <module>
    Cli()
  File "/Users/ryan/git/pkpass/libpkpass/commands/cli.py", line 33, in __init__
    self.actions[self.parsedargs.subparser_name].run(self.parsedargs)
  File "/Users/ryan/git/pkpass/libpkpass/commands/command.py", line 47, in run
    self._run_command_setup(parsedargs)
  File "/Users/ryan/git/pkpass/libpkpass/commands/command.py", line 60, in _run_command_setup
    config_args = self._get_config_args( cli_args['config'] )
  File "/Users/ryan/git/pkpass/libpkpass/commands/command.py", line 98, in _get_config_args
    with open(config, 'r') as f:
IOError: [Errno 2] No such file or directory: '.pkpassrc'

We should continue with defaults ($HOME/.passdb/(certs|keys|passwords)?) and maybe let the user know that they don't have a pkpassrc file. Or maybe not.

ginsburgnm commented 6 years ago

This seems unnecessary with the setup script. I think we should just make that raise a PKPassError like we are doing in the other exceptions issue.

rmadamson commented 6 years ago

Should we be able to run pkpass without a .pkpassrc file? It seems like something that would be okay, if we set reasonable default paths for things like the cert and password repositories

ginsburgnm commented 6 years ago

It should be fine, I don't see anything particularly wrong with it. I just think it would be better to encourage users to use the setup script we are developing; but if there is a particular reason we would like to run without a .pkpassrc file maybe that will help me understand the actual need here.