diff --git a/docs/docs/administer/migrate.mdx b/docs/docs/administer/migrate.mdx index 0c5fb213d..a6b8c578b 100644 --- a/docs/docs/administer/migrate.mdx +++ b/docs/docs/administer/migrate.mdx @@ -26,13 +26,14 @@ snapshot if possible. 1. Install the latest version of [**Docker** ](https://docs.docker.com/engine/install/) and [Docker Compose ](https://docs.docker.com/compose/install/linux/#install-compose) -for your OS. We recommend using Docker Server for Linux. Docker +for your OS. **Docker Compose version 2 or higher is required**. +We recommend using Docker Server for Linux. Docker Desktop will work too, but is not preferred for production use cases at this time because it rewrites packets under some conditions and may cause unexpected issues with Firezone. 1. Download and run the migration script: ```bash -sudo -E bash -c "$(curl -fsSL https://github.com/firezone/firezone/raw/master/scripts/docker_migrate.sh)" +bash <(curl -fsSL https://github.com/firezone/firezone/raw/master/scripts/docker_migrate.sh) ``` This will ask you a few questions, then attempt to migrate your installation to Docker. If all goes well, your Firezone instance should be running with Docker, data intact. diff --git a/docs/docs/deploy/docker/README.mdx b/docs/docs/deploy/docker/README.mdx index 6a3772268..c78d96c83 100644 --- a/docs/docs/deploy/docker/README.mdx +++ b/docs/docs/deploy/docker/README.mdx @@ -21,8 +21,9 @@ deploying Firezone. Docker offers a number of benefits over the old ## Step 1: Prerequisites -* Ensure you're on a [supported platform](supported-platforms) with a recent - version of [docker-compose](https://docs.docker.com/compose/install/) installed. +* Ensure you're on a [supported platform](supported-platforms) with [ + docker-compose](https://docs.docker.com/compose/install/) **version 2 + or higher** installed. * Ensure port forwarding is enabled on your firewall. The default Firezone configuration requires the following ports to be open: * `80/tcp` (optional): For automatically issuing SSL certificates. diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 10fd34fda..74b90a3a2 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -73,7 +73,7 @@ const config = { docs: { routeBasePath: '/', sidebarPath: require.resolve('./sidebars.js'), - editUrl: 'https://github.com/firezone/firezone/tree/master', + editUrl: 'https://github.com/firezone/firezone/tree/master/docs', docLayoutComponent: "@theme/DocPage", docItemComponent: "@theme/ApiItem", }, diff --git a/scripts/docker_migrate.sh b/scripts/docker_migrate.sh index 05f4c2e1d..751fe7e38 100755 --- a/scripts/docker_migrate.sh +++ b/scripts/docker_migrate.sh @@ -62,7 +62,7 @@ condIns () { file=$2 if [ -s "$dir/$file" ]; then - val=$(cat $dir/$file) + val=$(sudo cat $dir/$file) val=$(echo $val | sed 's/"/\\"/g') if [ $file = "EXTERNAL_URL" ]; then val=$(echo $val | sed "s:/*$::") @@ -163,23 +163,23 @@ migrate () { # optional vars if test -f $env_files/DATABASE_PASSWORD; then - db_pass=$(cat $env_files/DATABASE_PASSWORD) + db_pass=$(sudo cat $env_files/DATABASE_PASSWORD) else db_pass=$(/opt/firezone/embedded/bin/openssl rand -base64 12) fi echo "DATABASE_PASSWORD=\"${db_pass}\"" >> $installDir/.env if test -f $env_files/DEFAULT_ADMIN_PASSWORD; then - echo "DEFAULT_ADMIN_PASSWORD=\"$(cat $env_files/DEFAULT_ADMIN_PASSWORD)\"" >> $installDir/.env + echo "DEFAULT_ADMIN_PASSWORD=\"$(sudo cat $env_files/DEFAULT_ADMIN_PASSWORD)\"" >> $installDir/.env fi # END env vars that matter } doDumpLoad () { echo "Dumping existing database to $installDir/firezone_omnibus_backup.sql" - db_host=$(cat /opt/firezone/service/phoenix/env/DATABASE_HOST) - db_port=$(cat /opt/firezone/service/phoenix/env/DATABASE_PORT) - db_name=$(cat /opt/firezone/service/phoenix/env/DATABASE_NAME) - db_user=$(cat /opt/firezone/service/phoenix/env/DATABASE_USER) + db_host=$(sudo cat /opt/firezone/service/phoenix/env/DATABASE_HOST) + db_port=$(sudo cat /opt/firezone/service/phoenix/env/DATABASE_PORT) + db_name=$(sudo cat /opt/firezone/service/phoenix/env/DATABASE_NAME) + db_user=$(sudo cat /opt/firezone/service/phoenix/env/DATABASE_USER) /opt/firezone/embedded/bin/pg_dump -h $db_host -p $db_port -d $db_name -U $db_user > $installDir/firezone_omnibus_backup.sql @@ -204,10 +204,10 @@ dumpLoadDb () { doBoot () { echo "Stopping Omnibus Firezone..." - firezone-ctl stop + sudo firezone-ctl stop echo "Tearing down network..." - firezone-ctl teardown-network + sudo firezone-ctl teardown-network echo "Disabling systemd unit..." systemctl disable firezone-runsvdir-start.service @@ -244,7 +244,7 @@ EOF bootstrapDb () { echo "Bootstrapping DB..." - db_name=$(cat /opt/firezone/service/phoenix/env/DATABASE_NAME) + db_name=$(sudo cat /opt/firezone/service/phoenix/env/DATABASE_NAME) DATABASE_PASSWORD=$db_pass $dc -f $installDir/docker-compose.yml up -d postgres sleep 5 $dc -f $installDir/docker-compose.yml exec postgres psql -U postgres -h 127.0.0.1 -c "ALTER ROLE postgres WITH PASSWORD '${db_pass}'"