From bff52590e11286aee5057be74af28bb881cb5355 Mon Sep 17 00:00:00 2001 From: Jamil Date: Fri, 13 Jan 2023 17:43:44 -0800 Subject: [PATCH] Migrate DB before using for the first time (#1310) --- docs/docs/deploy/docker/README.mdx | 4 ++++ scripts/install.sh | 2 ++ 2 files changed, 6 insertions(+) diff --git a/docs/docs/deploy/docker/README.mdx b/docs/docs/deploy/docker/README.mdx index 78003fce2..0d4027b6d 100644 --- a/docs/docs/deploy/docker/README.mdx +++ b/docs/docs/deploy/docker/README.mdx @@ -77,6 +77,10 @@ installation process, follow the steps below to install manually. ``` 1. At a minimum, change the `ADMIN_EMAIL` and `EXTERNAL_URL` variables. Optionally modify other secrets as needed. +1. Migrate the database: + ```shell + docker compose run --rm firezone bin/migrate + ``` 1. Create the first admin: ```shell docker compose run --rm firezone bin/create-or-reset-admin diff --git a/scripts/install.sh b/scripts/install.sh index 0ec599f42..d994a06eb 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -160,6 +160,8 @@ firezoneSetup() { $dc -f $installDir/docker-compose.yml logs postgres 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 "Migrating DB..." + $dc -f $installDir/docker-compose.yml run -e TELEMETRY_ID="${tid}" --rm firezone bin/migrate echo "Creating admin..." $dc -f $installDir/docker-compose.yml run -e TELEMETRY_ID="${tid}" --rm firezone bin/create-or-reset-admin echo "Upping firezone services..."