nakabonne / pbgopy

Copy and paste between devices
MIT License
807 stars 30 forks source link

Issue #5 - Automating Password Entry #12

Closed keyslapperdev closed 3 years ago

keyslapperdev commented 3 years ago

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

nakabonne commented 3 years ago

Thanks for your contribution! I'm in the middle of something, I'll take a look later!

jcwillox commented 3 years ago

Just an idea, why not store the password in an environment variable like PBGOPY_TOKEN or PBGOPY_PASS.

nakabonne commented 3 years ago

@name-schema Thank you! Left some comments.

nakabonne commented 3 years ago

@jcwillox Nice idea. Can you open an issue for that?

nakabonne commented 3 years ago

And I'm sorry but could you resolve the conflicts?

keyslapperdev commented 3 years ago

Working on that today, was out of pocket.

nakabonne commented 3 years ago

Thank you! I'm in the middle of something, so will take a look this weekend!