Boot minimal app for DB changes (#1305)

Adds a minimal supervision tree for making DB changes from the
`FzHttp.Release` module. This allows the `bin/create-or-reset-admin` and
`bin/create-api-token` commands to be with `docker compose exec` or
`docker compose run --rm` indiscriminately.

Starting the FzHttp.Repo directly is more involved it's not compiled
into the release as an OTP app.
This commit is contained in:
Jamil
2023-01-13 13:45:18 -08:00
committed by GitHub
parent e2e1dd441b
commit 330cafbbe5
7 changed files with 30 additions and 10 deletions

View File

@@ -161,7 +161,7 @@ firezoneSetup() {
echo "Resetting DB password..."
$dc -f $installDir/docker-compose.yml exec postgres psql -p 5432 -U postgres -d firezone -h 127.0.0.1 -c "ALTER ROLE postgres WITH PASSWORD '${db_pass}'"
echo "Creating admin..."
$dc -f $installDir/docker-compose.yml exec firezone bin/create-or-reset-admin
$dc -f $installDir/docker-compose.yml run --rm firezone bin/create-or-reset-admin
echo "Upping firezone services..."
$dc -f $installDir/docker-compose.yml up -d firezone caddy