forked from djenriquez/vault-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-docker-compose-dev
executable file
·41 lines (36 loc) · 1.69 KB
/
run-docker-compose-dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
echo "------------- yarn install -------------"
yarn install
echo "------------- docker-compose up -d -------------"
docker-compose up -d
echo
echo "------------- docker-compose ps -------------"
docker-compose ps
echo
exec_in_vault() {
echo "------------- $@ -------------"
docker-compose exec -T vault "$@"
echo
}
exec_in_vault vault auth "$(docker-compose logs vault | grep 'Root Token:' | tail -n 1 | awk '{ print $NF }')"
exec_in_vault vault status
exec_in_vault vault auth-enable userpass
exec_in_vault vault auth-enable -path=userpass2 userpass
exec_in_vault vault auth-enable github
exec_in_vault vault auth-enable radius
exec_in_vault vault auth-enable -path=awsaccount1 aws-ec2
exec_in_vault vault policy-write admin /misc/admin.hcl
exec_in_vault vault write auth/userpass/users/test password=test policies=admin
exec_in_vault vault write auth/userpass2/users/john password=doe policies=admin
exec_in_vault vault write auth/userpass/users/lame password=lame policies=default
exec_in_vault vault write auth/radius/users/test password=test policies=admin
exec_in_vault vault write secret/test somekey=somedata
exec_in_vault vault mount -path=ultrasecret generic
exec_in_vault vault write ultrasecret/moretest somekey=somedata
exec_in_vault vault write ultrasecret/dir1/secret somekey=somedata
exec_in_vault vault write ultrasecret/dir2/secret somekey=somedata
exec_in_vault vault write ultrasecret/dir2/secret2 somekey=somedata
exec_in_vault vault write ultrasecret/admincantlistthis/butcanreadthis somekey=somedata
exec_in_vault vault write ultrasecret/admincantreadthis somekey=somedata
echo "------------- Vault Root Token -------------"
docker-compose logs vault | grep 'Root Token:' | tail -n 1