From a0da024b96aab7f848876a68c35641c614bfce99 Mon Sep 17 00:00:00 2001 From: Nir Cohen Date: Sun, 2 Apr 2017 11:01:05 +0300 Subject: [PATCH] v0.6.1 --- CHANGES | 14 ++++++++++++++ README.md | 35 +++++++++++++++++++++++++---------- ghost.py | 13 +++++++------ setup.py | 2 +- 4 files changed, 47 insertions(+), 17 deletions(-) diff --git a/CHANGES b/CHANGES index 152587d..26a509a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,17 @@ +**0.6.1** (2017.04.02) + +* Remove official Python2.6 support! Most things will probably work, but not guaranteed. +* Add `ghost ssh` connecting through proxy using ProxyCommand. +* Add `ghost put` `--add` flag to add values to an existing key. +* Fix init in TinyDB and SqlAlchemy backends not idempotent. +* Fix SqlAlchemy backend not creating a non-existing database on non-SQLite storage. +* Allow to pass arbitrary directives to any ssh command via the `extend` value in an `ssh` type key. +* Delete stale stash when initializing a stash without being able to write its passphrase file due to filesystem access errors. +* Disallow using a stash before it is initialized. +* Fix `ghost ssh` failing miserably on non-existing key. +* Fix load not working due to it using the wrong passphrase. + + **0.6.0** (2017-03-26) * Allow to use multiple stashes on the same backend diff --git a/README.md b/README.md index c0fff98..91da572 100644 --- a/README.md +++ b/README.md @@ -61,17 +61,17 @@ Options: -h, --help Show this message and exit. Commands: - delete Delete a key from the stash + delete Delete a key export Export all keys to a file - get Retrieve a key from the stash - init Init a stash - list List all keys in the stash If `KEY_NAME` is... - load Load all keys from an exported key file to... - lock Lock a key - migrate Migrate all keys from a source stash to a... - purge Purge the stash from all of its keys - put Insert a key to the stash - ssh Use an ssh type key to connect to a machine... + get Retrieve a key + init Initialize a stash + list List keys + load Load keys from backup + lock Lock a key to protect it + migrate Migrate keys from source to destination stash + purge Purge all keys + put Insert a new key + ssh Use a key to SSH-connect to a machine unlock Unlock a key @@ -303,6 +303,21 @@ An added nicety is that you don't actually have to have key files stored on your Note that ghost will force you to provide the `conn` and one of `ssh_key` or `ssh_key_path` values when using the `--type=ssh` key type. +You can also use a ProxyCommand based `ssh` method to connect to a machine through a proxy: + +```bash +$ ghost put machine-through-proxy --type ssh conn=ubuntu@10.10.1.10 key_file_path=~/.ssh/key.pem proxy=ubuntu@172.16.31.8 proxy_key_path=~/.ssh/my_proxy_key + +$ ghost ssh my-machine +... + +``` + +You can also use `proxy_key` to provide the string of the key instead of `ssh_key_path`. + +Additionally, any string put under the `extend` value in the key will be concatenated to the resulting ssh command. + + ## Purging a stash To allow for extreme measures when necessary, ghost provides the `purge` API (and command). If you quickly need to delete all keys from a stash, you can use it. To purge a stash you'll have to provide a mandatory `force` flag as precautionary measure. diff --git a/ghost.py b/ghost.py index cec8965..0682db4 100644 --- a/ghost.py +++ b/ghost.py @@ -1213,7 +1213,7 @@ def init_stash(stash_path, passphrase, passphrase_size, backend): 'If lost, you will lose access to your stash.') -@main.command(name='put', short_help='Insert a key to the stash') +@main.command(name='put', short_help='Insert a new key') @click.argument('KEY_NAME') @click.argument('VALUE', nargs=-1, required=True) @click.option('-d', @@ -1326,7 +1326,7 @@ def unlock_key(key_name, sys.exit(ex) -@main.command(name='get', short_help='Retrieve a key from the stash') +@main.command(name='get', short_help='Retrieve a key') @click.argument('KEY_NAME') @click.argument('VALUE_NAME', required=False) @click.option('-j', @@ -1384,7 +1384,7 @@ def get_key(key_name, click.echo('\n' + _prettify_dict(key)) -@main.command(name='delete', short_help='Delete a key from the stash') +@main.command(name='delete', short_help='Delete a key') @click.argument('KEY_NAME') @stash_option @passphrase_option @@ -1465,7 +1465,7 @@ def list_keys(key_name, click.echo(_prettify_list(keys)) -@main.command(name='purge') +@main.command(name='purge', short_help='Purge all keys') @click.option('-f', '--force', required=True, @@ -1510,7 +1510,7 @@ def export_keys(output_path, stash, passphrase, backend): sys.exit(ex) -@main.command(name='load') +@main.command(name='load', short_help='Load keys from backup') @click.argument('KEY_FILE') @click.option('--origin-passphrase', help='The passphrase of the origin stash') @@ -1529,7 +1529,8 @@ def load_keys(key_file, origin_passphrase, stash, passphrase, backend): click.echo('Import complete!') -@main.command(name='migrate') +@main.command(name='migrate', + short_help='Migrate keys from source to destination stash') @click.argument('SOURCE_STASH_PATH', type=click.STRING) @click.argument('DESTINATION_STASH_PATH', type=click.STRING) @click.option('-sp', diff --git a/setup.py b/setup.py index 68a75e9..8cc9e05 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ def read(*parts): setup( name='ghost', - version="0.6.0", + version="0.6.1", url='https://github.com/nir0s/ghost', author='nir0s', author_email='nir36g@gmail.com',