The CLI tool interfaces with the API. The client can both start the server and interact with the server.
The Piggy Bank cli uses a config file. It defaults to
~/.piggybank.yaml. The config stores your server URL, manager password, and your user credentials.
server: http://localhost:8080 manager_pass: "mpeKlRCpRHBYPvp8SGJOahjhV9pbul1zOlX2fiNiJxE" piggy_user: jhooks piggy_pass: "DLyVQ3eDMFHuS5drLXTKlKQcyiPtn2hTPB1aF7yh99E"
To initialize the database run
You will get back a response like this:
Master decrypt password is xsU8v0E8AuqAw2LAqxK/ezOtjw6Joj1CwDsxSzyYHx0 User manager username: manager password: T0uND8wVnoNg7VntrKY72q5A33LHjWWLWSypqlUcCrI
|The decryption key is only available one time. If you lose it all data is lost.|
To add and remove users, use the
|To create or delete users you must have the manager credentials.|
To add a user to the local database users, run
./piggy user create -u <username>
Piggy Bank will return the user and their generated password.
User creation supports the
To add and delete credentials, use the
|Only database users can create, delete, and view credentials. The mananger account cannot.|
To add a credential run
./piggy cred create -a <application> -u <cred user> -p <cred password>
Multiple user/password pairs can be added to a single application.
To change a secret, just send another POST request with the new values.
To lookup a credential run
./piggy cred lookup -a <application> -u <cred user>.
Credential lookup supports the
You can backup the database in two ways. You can either specify a local backup to the server or locally to your client.
|The manager account is the ONLY account that can backup the database. The database is also encrypted, so you will still need the encryption key to decrypt the backup.|
To backup the database locally to where the server is running, just run
./piggy backup. It will create a file named
backup.db in the same location that the server is running.