diff --git a/.gitignore b/.gitignore index 993f45e..ccd388e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -awoolt.yml \ No newline at end of file +/awoolt.yml +/awoolt +/demo/vault.pid diff --git a/README.md b/README.md index 3a2a898..0bffabe 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ Interactively browse vault/openbao in the terminal. +![demo](demo/demo.gif) + ## 🚀 Installation ```bash diff --git a/demo/demo.gif b/demo/demo.gif new file mode 100644 index 0000000..d8e3036 Binary files /dev/null and b/demo/demo.gif differ diff --git a/demo/demo.tape b/demo/demo.tape new file mode 100644 index 0000000..1f722bd --- /dev/null +++ b/demo/demo.tape @@ -0,0 +1,40 @@ +Output demo/demo.gif + +Set Framerate 60 +Set Height 350 + +Hide +Type "./demo/setup.sh" +Enter +Type "export VAULT_ADDR=http://localhost:8200" +Enter +Type "export CLICOLOR_FORCE=1" +Enter +Type "alias awoolt='./awoolt > /dev/null' && clear" +Enter +Show + +Type "awoolt -e kv" +Enter +Sleep 1 +# select servers +Enter +Sleep 1 +# select vm01 +Enter +Sleep 1 +# select os +Enter +Sleep 1 +# select user02 +Down +Sleep 1 +Enter +Sleep 0.5 +Type "# Values should be printed here. No idea why the demo isn't working :(" +Enter +Sleep 3 + +Hide +Type "./demo/teardown.sh" +Enter diff --git a/demo/setup.sh b/demo/setup.sh new file mode 100755 index 0000000..06342e6 --- /dev/null +++ b/demo/setup.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +set -e + +# backup vault token if exists +if [ -f ~/.vault-token ]; then + mv ~/.vault-token ~/.vault-token.bak +fi + +# start vault server in backgroud and save pid +vault server -dev > /dev/null 2>&1 & +VAULT_PID=$! + +# write pid to file +echo $VAULT_PID > ./demo/vault.pid + +export VAULT_ADDR=http://localhost:8200 + +# wait for vault server to start +sleep 3 + +vault secrets enable kv > /dev/null +vault kv enable-versioning kv > /dev/null +vault kv put kv/servers/vm01/os/user01 username=root password=toor > /dev/null +vault kv put kv/servers/vm01/os/user02 username=root password=toor > /dev/null +vault kv put kv/servers/vm01/os/user03 username=root password=toor > /dev/null +vault kv put kv/servers/vm01/web/user01 username=root password=toor > /dev/null +vault kv put kv/servers/vm02/os/user01 username=root password=toor > /dev/null +vault kv put kv/servers/vm03/os/user01 username=root password=toor > /dev/null +vault kv put kv/servers/vm04/os/user01 username=root password=toor > /dev/null +vault kv put kv/servers/vm05/os/user01 username=root password=toor > /dev/null +vault kv put kv/servers/vm06/os/user01 username=root password=toor > /dev/null + +# disown the process +disown $VAULT_PID + +# build awoolt +go build . diff --git a/demo/teardown.sh b/demo/teardown.sh new file mode 100755 index 0000000..220af62 --- /dev/null +++ b/demo/teardown.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -e + +# read pid from file +VAULT_PID=$(cat ./demo/vault.pid) + +# restore vault token +if [ -f ~/.vault-token.bak ]; then + mv ~/.vault-token.bak ~/.vault-token +fi + +# stop vault server +kill "$VAULT_PID" + +# remove files +rm ./demo/vault.pid +rm awoolt