mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
Minor docs fixes (#1071)
* sudo for migrate * Use sudo for cat * docker-compose version 2 or higher
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
|
||||
@@ -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}'"
|
||||
|
||||
Reference in New Issue
Block a user