Skip to content

Commit

Permalink
Merge pull request #166 from vimc/vimc-6335
Browse files Browse the repository at this point in the history
Use centre vault
  • Loading branch information
r-ash committed Apr 7, 2022
2 parents 20db9f5 + 1952be1 commit 88e66be
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
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

0 comments on commit 88e66be

Please sign in to comment.