Closed keyslapperdev closed 3 years ago
Thanks for your contribution! I'm in the middle of something, I'll take a look later!
Just an idea, why not store the password in an environment variable like PBGOPY_TOKEN
or PBGOPY_PASS
.
@name-schema Thank you! Left some comments.
@jcwillox Nice idea. Can you open an issue for that?
And I'm sorry but could you resolve the conflicts?
Working on that today, was out of pocket.
Thank you! I'm in the middle of something, so will take a look this weekend!
In commands/copy.go Created new function getPasswordFromEnv to work as a fallback password if the -p flag is not set. Important to note, the -p flag takes priority over the env var, as it should. Updated logic to check password length before using it to encrypt
In commands/env.go Added new env const: const pbgopyPasswordFileEnv = "PBGOPY_PASSWORD_FILE"
In commands/paste.go Updated logic to check password length before using it to decrypt
Fixes: https://github.com/nakabonne/pbgopy/issues/5