Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passphrase from env #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,13 @@ Quickstart:
./loxodo.py -i
runs Loxodo in command line interactive mode


Getting the pass phrase from the environment:
---------------------------------------------

This is risky and is intended only for careful automation purposes.
Only consider this if you are confident you can keep the contents of your environment
variables secret. In particular, someone who gets hold of the same filesystem with both the password safe
file and the environment variable has, effecitvely, full access to all your passwords.

If you can live with the risk you can set VAULT_PASSWORD in the environment.
5 changes: 4 additions & 1 deletion src/frontends/cmdline/loxodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ def _encode_line(self, line):
def open_vault(self):
print("Opening " + self.vault_file_name + "...")
try:
self.vault_password = self._getpass("Vault password: ")
if os.environ.get('VAULT_PASSWORD'):
self.vault_password = os.environ['VAULT_PASSWORD']
else:
self.vault_password = self._getpass("Vault password: ")
except EOFError:
print("\n\nBye.")
raise RuntimeError("No password given")
Expand Down