Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use centre vault #166

Merged
merged 1 commit into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion annex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The password for su is stored in the vault.
```
git clone https://github.com/vimc/montagu-db ~/annex
~/annex/annex/vault-auth
vault read -field=password /secret/registry/vimc | \
vault read -field=password /secret/vimc/registry/vimc | \
docker login -u vimc --password-stdin
```

Expand Down
4 changes: 2 additions & 2 deletions annex/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ if docker volume inspect $ANNEX_VOLUME_NAME > /dev/null 2>&1; then
INITIAL_DEPLOY=0
else
echo "Fetching annex password"
export VAULT_ADDR=https://support.montagu.dide.ic.ac.uk:8200
export VAULT_ADDR=https://vault.dide.ic.ac.uk:8200
vault login -method=github
ANNEX_VIMC_PASSWORD=$(vault read -field=password /secret/annex/users/vimc)
ANNEX_VIMC_PASSWORD=$(vault read -field=password /secret/vimc/annex/users/vimc)

echo "Creating montagu db annex volume"
INITIAL_DEPLOY=1
Expand Down
2 changes: 1 addition & 1 deletion annex/restore-test/provision/setup-vault.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ else
fi

vault login -method=github
vault read -field=password /secret/registry/vimc | \
vault read -field=password /secret/vimc/registry/vimc | \
docker login -u vimc --password-stdin
2 changes: 1 addition & 1 deletion annex/restore-test/provision/test-restore.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cd montagu-backup
# Read data from the local database (just restored) and the real annex
vault login -method=github
set +x
export PGPASSWORD=$(vault read -field=value secret/annex/password)
export PGPASSWORD=$(vault read -field=value secret/vimc/annex/password)

set -x
test_query="SELECT * FROM burden_estimate_stochastic
Expand Down
2 changes: 1 addition & 1 deletion annex/restore-test/test-annex-restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -e
# --------------------------------------------------------------------
# Get access to Vault
# --------------------------------------------------------------------
export VAULT_ADDR='https://support.montagu.dide.ic.ac.uk:8200'
export VAULT_ADDR='https://vault.dide.ic.ac.uk:8200'
if [ "$VAULT_AUTH_GITHUB_TOKEN" = "" ]; then
echo -n "Please provide your GitHub personal access token for the vault: "
read -s token
Expand Down
2 changes: 1 addition & 1 deletion annex/vault-auth
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
export VAULT_ADDR='https://support.montagu.dide.ic.ac.uk:8200'
export VAULT_ADDR='https://vault.dide.ic.ac.uk:8200'
if [ -z $VAULT_AUTH_GITHUB_TOKEN ]; then
echo -n "Paste your github token: "
read -s VAULT_AUTH_GITHUB_TOKEN
Expand Down
4 changes: 2 additions & 2 deletions migrations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ We can manage this with Flyway's baseline feature. Once I have written this
initial suite of migrations we can run:

```
password=$(vault read -field=password secret/database/production/users/import)
password=$(vault read -field=password secret/vimc/database/production/users/import)
docker run --network=montagu_default \
vimc/montagu-migrate:master \
baseline -baselineVersion=2017.09.06.1055 \
Expand All @@ -54,4 +54,4 @@ a future date, to fix it you will need to
1. Rename the migration script in this repo to reflect the date it was actually run
2. Manually edit the `schema_version` table to reflect the new name. Use the
`montagu-data` repo to do this, as per [this](https://github.com/vimc/montagu-data/blob/9d500278adf683c85a75edf7506efb5ec580e443/2018-064-i2381-fix-migration/README.md)
example
example