docs: update install procedure

- update airtime migration guide
This commit is contained in:
jo 2022-06-06 17:00:48 +02:00 committed by Kyle Robbertze
parent 0d16960887
commit b3ff2defc4
5 changed files with 80 additions and 56 deletions

View File

@ -39,10 +39,16 @@ The `database` section configure the PostgreSQL connection.
:::caution
<!-- TODO: Add link to a guide on how to edit such values -->
Before editing this section be sure to update the PostgreSQL server with the desired values.
#### Changing a PostgreSQL user password
You can change the `libretime` PostgreSQL user password using:
```bash
sudo -u postgres psql -c "ALTER USER libretime PASSWORD 'new-password';"
```
:::
```yml
@ -71,10 +77,16 @@ The `rabbitmq` section configure the RabbitMQ connection.
:::caution
<!-- TODO: Add link to a guide on how to edit such values -->
Before editing this section be sure to update the RabbitMQ server with the desired values.
#### Changing a RabbitMq user password
You can change the `libretime` RabbitMQ user password using:
```bash
sudo rabbitmqctl change_password "libretime" "new-password"
```
:::
```yml

View File

@ -31,6 +31,20 @@ You can install LibreTime using the one of the following methods:
- 2 GB RAM recommended (1 GB required)
- A static external IP address ([How to setup a static ip using Netplan](../tutorials/setup-a-static-ip-using-netplan.md))
:::warning
Make sure that you have configured a **firewall** and it's not blocking connection to the desired ports.
- [How to setup a firewall using UFW](../tutorials/setup-a-firewall-using-ufw.md)
LibreTime requires the following default ports to be open:
- `80` for the web interface,
- `8000` for the Icecast streams,
- `8001` and `8002` for the live stream input endpoint.
:::
## Using the installer
The installer is shipped in the released tarballs or directly in the project repository.
@ -95,49 +109,48 @@ git checkout {vars.version}
### Run the installer
Install LibreTime with the recommended options:
Install LibreTime with the recommended options, be sure to replace `PUBLIC_URL` with the public url of your installation,
for example `https://libretime.example.com` or `http://192.168.10.100:80`:
```bash
sudo ./install -fiap
sudo ./install PUBLIC_URL
```
Additional options can be listed with the following command:
```bash
./install --help
```
:::info
:::caution
When upgrading be sure to run the installer using the same arguments you used during the initial install.
:::
Once the installation is completed, open [http://localhost:80](http://localhost:80) to complete the [setup wizard](#setup-wizard).
If you need to change some configuration, the install script can be configured using flags or environment variables. Changing the listening port of LibreTime or whether you want to install some dependency by yourself, you could run the following:
```bash
# Install LibreTime on your system with the following tweaks:
# - do not install the liquidsoap package (remember to install liquidsoap yourself)
# - set the listen port to 8080
# - do not run the PostgreSQL setup (remember to setup PostgreSQL yourself)
sudo \
LIBRETIME_PACKAGES_EXCLUDES='liquidsoap' \
./install \
--listen-port 8080 \
--no-setup-postgresql \
https://libretime.example.com
```
:::note
- If installed on a remote device, make sure to replace `localhost` with your server's remote address.
- If installed with a custom port, make sure to replace `80` with the custom port.
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.
:::
:::warning
:::info
Make sure that you have configured a **firewall** and it's not blocking connection to the desired ports.
- [How to setup a firewall using UFW](../tutorials/setup-a-firewall-using-ufw.md)
LibreTime requires the following ports to be open:
- `80` for the web interface,
- `8000` for the Icecast streams,
- `8001` and `8002` for the live stream input endpoint.
Consider putting your installation behind a [reverse proxy](./reverse-proxy.md) to increase the security.
By default, the install script will not restart any service for you, this is to prevent unwanted restarts on production environment. To let the install script restart the services, you need to pass the `--allow-restart` flag.
:::
Feel free to run `./install --help` to get more details.
#### Using hardware audio output
If you plan to output analog audio directly to a mixing console or transmitter, the user running LibreTime (by default `www-data`) needs to be added to the `audio` user group using the command below:
@ -146,24 +159,28 @@ If you plan to output analog audio directly to a mixing console or transmitter,
sudo adduser www-data audio
```
### Setup wizard
### Setup
The setup wizard walk you through the rest of the installation process.
Once the installation is completed, edit the [configuration file](./configuration.md) at `/etc/libretime/config.yml` to fill required information and to match your needs.
#### Changing default passwords
It's recommended that you change the passwords prompted in the setup wizard. Be sure to apply the changes on the server before going to any next step.
You can change the default PostgreSQL user password using:
Next, run the following commands to setup the database:
```bash
sudo -u postgres psql -c "ALTER USER airtime PASSWORD 'new-password';"
sudo -u www-data libretime-api migrate
```
You can change the default RabbitMQ user password using:
Synchronize the new Icecast passwords into the database:
```bash
sudo rabbitmqctl change_password "airtime" "new-password"
sudo libretime-api set_icecast_passwords --from-icecast-config
```
Finally, start the services, and check that they are running properly using the following commands:
```bash
sudo systemctl start libretime.target
sudo systemctl --all --plain | grep libretime
```
Once completed, it's recommended to [install a reverse proxy](./reverse-proxy.md) to setup SSL termination and secure your installation.

View File

@ -21,7 +21,7 @@ Follow [the backup guide](../backup.md) to make a backup of your current Airtime
## Install
Install LibreTime on a new system by following the [install guide](./install.md), and **don't run the setup wizard**.
Install LibreTime on a new system by [running the installer](./install.md#run-the-installer), and **don't run the setup tasks**.
## Restore the backup

View File

@ -11,6 +11,14 @@ You should always have proper backups and a rollback scenario in place before up
:::
## Stop the services
Run the following commands to apply the database migrations:
```bash
sudo systemctl stop libretime.target
```
## Make a backup
Follow [the backup guide](../backup.md) to make an extra backup of your installation and prepare a rollback scenario in case of accidental data loss during the upgrade process.
@ -28,7 +36,7 @@ Be sure to carefully read **all** the [releases notes](../../releases/README.md)
Run the following command to apply the database migrations:
```bash
libretime-api migrate
sudo -u www-data libretime-api migrate
```
## Restart the services
@ -36,14 +44,7 @@ libretime-api migrate
Restart all the services to make sure all the changes are applied.
```bash
sudo systemctl daemon-reload
sudo systemctl restart \
libretime-analyzer \
libretime-api \
libretime-celery \
libretime-playout \
libretime-liquidsoap \
apache2
sudo systemctl restart libretime.target
```
## Verify
@ -51,13 +52,7 @@ sudo systemctl restart \
Verify that all the services are still running after the install process:
```bash
sudo systemctl status \
libretime-analyzer \
libretime-api \
libretime-celery \
libretime-playout \
libretime-liquidsoap \
apache2
sudo systemctl --all --plain | egrep 'libretime|apache2'
```
Verify for any error in the logs after the install process:

View File

@ -16,7 +16,7 @@ The first Django migration is the initial schema creation using the `schema.sql`
:::
```
```mermaid
stateDiagram-v2
state is_django_migration_applied <<choice>>
[*] --> is_django_migration_applied: Is the django migration ID in the DB ?