Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Latest commit

 

History

History

perfect

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

This Perfect example checks if the environment variables DEMO_USERNAME and DEMO_PASSWORD have been set. If that's not the case, you'll receive an error message on http://localhost:8181.

Prerequisites

  1. Docker installed and running
  2. SecretHub installed
  3. A SecretHub repo that contains a username and password secret. To create it, run secrethub demo init.

Running the example

Set the SecretHub username in an environment variable

export SECRETHUB_USERNAME=<your-username>

Create a service account for the demo repo

secrethub service init --description demo_service \
--permission read --file demo_service.cred ${SECRETHUB_USERNAME}/demo

Build the Perfect docker demo

docker build . -t perfect-secrethub-demo

Run the docker demo with the secrets in the environment variables

docker run -p 8181:8181 \
  -e DEMO_USERNAME=secrethub://${SECRETHUB_USERNAME}/demo/username \
  -e DEMO_PASSWORD=secrethub://${SECRETHUB_USERNAME}/demo/password \
  -e SECRETHUB_CREDENTIAL=$(cat demo_service.cred) \
  perfect-secrethub-demo

If you now visit http://localhost:8181, you should see the welcome message including your username.