Ensure you have:
- Postgres installed
- the Rails demo running with Postgres on 5432
- You must also have run an
stash upload-config
for the Rails demo
- You must also have run an
- CipherStash-enabled psql on your path (something like
alias stash-psql='/path/to/github.com/cipherstash/driver/pq-ext/ext/build/bin/psql'
- The
CS_CLIENT_ID
andCS_CLIENT_KEY
exported (best to manage this with direnv and a.envrc
)
Then:
# set up the database
make init
# start the database server
make start
To do the backup and restore:
# backup from postgres on 5432 (Rails)
make backup
# restore to postgres on 5433
make restore
Tail the log:
tail -F ~/.cipherstash/*/decryptions.log
Then query the data:
stash-psql -p 5433 rails_demo
#> SELECT full_name, dob FROM patients LIMIT 5;
To reset the demo:
# shut down the database
make stop
# reset the database
make clean