feat(installer): load .env file to persistent install config

This commit is contained in:
jo 2022-07-06 14:44:58 +02:00 committed by Kyle Robbertze
parent f1270fed6f
commit 0bb792d047
2 changed files with 12 additions and 0 deletions

View File

@ -137,6 +137,15 @@ LIBRETIME_PACKAGES_EXCLUDES='liquidsoap' \
https://libretime.example.com https://libretime.example.com
``` ```
You can persist the install configuration in a `.env` file next to the install script. For example, the above command could be persisted using the `.env` file below, and you should be able to run the install script without arguments:
```
LIBRETIME_PACKAGES_EXCLUDES='liquidsoap'
LIBRETIME_LISTEN_PORT='8080'
LIBRETIME_SETUP_POSTGRESQL=false
LIBRETIME_PUBLIC_URL='https://libretime.example.com'
```
:::note :::note
The install script will use randomly generated passwords to create the PostgreSQL user, RabbitMQ user and to update the default Icecast passwords. Those passwords will be saved to the configuration files. The install script will use randomly generated passwords to create the PostgreSQL user, RabbitMQ user and to update the default Icecast passwords. Those passwords will be saved to the configuration files.

View File

@ -93,6 +93,9 @@ EOF
done <<< "$(grep -A1 '^# >' "$0")" done <<< "$(grep -A1 '^# >' "$0")"
} }
# Load .env file if exists
[[ -f "$SCRIPT_DIR/.env" ]] && source "$SCRIPT_DIR/.env"
# Configuration # Configuration
# > User used to run LibreTime. # > User used to run LibreTime.
LIBRETIME_USER=${LIBRETIME_USER:-"www-data"} LIBRETIME_USER=${LIBRETIME_USER:-"www-data"}