docs: update configuration schema

This commit is contained in:
jo 2022-02-22 16:39:46 +01:00 committed by Kyle Robbertze
parent f088cc2873
commit 228585d434
2 changed files with 167 additions and 275 deletions

View File

@ -3,176 +3,168 @@ title: Configuration
sidebar_position: 20
---
The streaming host configuration for LibreTime is shown in the file `/etc/airtime/liquidsoap.cfg` which is automatically generated by the **Streams** page, found on the **System** menu of the LibreTime administration interface. For this reason, you would not normally edit the streaming configuration manually, as any changes are likely to be overwritten by the administration interface.
To configure LibreTime, you need to edit the `/etc/airtime/airtime.conf` file. This page describe the available options to configure your installation.
## Database and RabbitMQ hosts
## General
Optionally, you may wish to edit the file `/etc/airtime/airtime.conf` to set the PostgreSQL database host, and the username and password to connect to the database with.
You can also set options for RabbitMQ messaging and the LibreTime server in this file, although you shouldn't normally need to adjust the defaults unless you are running a large LibreTime system distributed across multiple servers. To run the LibreTime server in demo mode, which changes the greeting on the login page and prevents user accounts from being created or modified, set the value of _demo_ to 1.
```ini title="/etc/airtime/airtime.conf"
[database]
host = localhost
port = 5432
name = libretime
user = libretime
password = libretime
[rabbitmq]
host = 127.0.0.1
port = 5672
user = airtime
password = XXXXXXXXXXXXXXXXXXXX
vhost = /airtime
The `general` section configure anything related to the legacy and API services.
```ini
[general]
api_key = XXXXXXXXXXXXXXXXXXXXX
web_server_user = www-data
airtime_dir = /usr/share/airtime
base_url = libretime.example.com
base_port = 80
# The internal API authentication key, this field is required
api_key = some_random_generated_secret!
# The public url scheme
# Mutually exclusive with force_ssl
protocol =
# The public url hostname, default is localhost
base_url = localhost
# The public url port
base_port =
# The public url base path, default is /
base_dir = /
# Force https for generated urls, default is false
force_ssl = false
# How many hours ahead Playout should cache scheduled media files, default is 1
cache_ahead_hours = 1
[monit]
monit_user = guest
monit_password = airtime
[demo]
demo = 0
# Authentication adaptor to use for the legacy service, default is local
# Specify a class like LibreTime_Auth_Adaptor_FreeIpa to replace the built-in adaptor
auth = local
```
Save and close the file then, run the following commands to restart LibreTime's services:
In order to apply the changes made in this section, please restart the following services:
```bash
sudo systemctl restart libretime-liquidsoap
sudo systemctl restart libretime-playout
sudo systemctl restart libretime-celery
sudo systemctl restart libretime-analyzer
```
libretime-api
libretime-analyzer
libretime-celery
libretime-playout
```
## Apache max file size configuration
## Database
By default, the maximum upload file size is 40 MB, which may not be large enough for some stations, especially if they're uploading prerecorded shows. The setting for this is located in `/etc/apache2/sites-available/airtime.config`. Search for and update the following in megabytes:
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.
:::
```ini
; Maximum allowed size for uploaded files.
upload_max_filesize = 40M
; Must be greater than or equal to upload_max_filesize
post_max_size = 40M
[database]
# The hostname of the PostgreSQL server, default is localhost
host = localhost
# The port of the PostgreSQL server, default is 5432
port = 5432
# The name of the PostgreSQL database, default is libretime
name = libretime
# The username of the PostgreSQL user, default is libretime
user = libretime
# The password of the PostgreSQL user, default is libretime
password = some_random_generated_secret!
```
For quick reference, 1024 MB = 1 GB and 2048 MB = 2 GB, but most should be okay with rounding to the nearest thousand. After updating the config file, restart Apache with `sudo systemctl restart apache2`.
In order to apply the changes made in this section, please restart the following services:
## Playout settings
```
libretime-api
```
Settings for pypo, the playout engine used by LibreTime, are found in the file `/etc/airtime/airtime.conf`. After making changes to this file, run `sudo systemctl restart libretime-playout`.
## RabbitMQ
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.
:::
```ini
############################################
# pypo - configuration #
############################################
# Set the type of client you are using.
# Currently supported types:
# 1) "obp" = Open Broadcast Platform
# 2) "airtime"
#
api_client = airtime
############################################
# Cache Directories #
# *include* trailing slash !! #
############################################
cache_dir = /var/tmp/airtime/pypo/cache/
file_dir = /var/tmp/airtime/pypo/files/
tmp_dir = /var/tmp/airtime/pypo/tmp/
############################################
# Setup Directories #
# Do *not* include trailing slash !! #
############################################
cache_base_dir = /var/tmp/airtime/pypo
bin_dir = /usr/lib/airtime/pypo
log_base_dir = /var/log/airtime
pypo_log_dir = /var/log/airtime/pypo
liquidsoap_log_dir = /var/log/airtime/pypo-liquidsoap
############################################
# Liquidsoap settings #
############################################
ls_host = 127.0.0.1
ls_port = 1234
############################################
# RabbitMQ settings #
############################################
rabbitmq_host = localhost
rabbitmq_user = airtime
rabbitmq_password = XXXXXXXXXXXXXXXXXXXX
rabbitmq_vhost = /airtime
############################################
# pypo preferences #
############################################
# Poll interval in seconds.
#
# This will rarely need to be changed because any schedule changes are
# automatically sent to pypo immediately.
#
# This is how often the poll script downloads new schedules and files from the
# server in the event that no changes are made to the schedule.
#
poll_interval = 3600# in seconds.
# Push interval in seconds.
#
# This is how often the push script checks whether it has something new to
# push to liquidsoap.
#
# It's hard to imagine a situation where this should be more than 1 second.
#
push_interval = 1# in seconds
# 'pre' or 'otf'. 'pre' cues while playlist preparation
# while 'otf' (on the fly) cues while loading into ls
# (needs the post_processor patch)
cue_style = pre
[rabbitmq]
# The hostname of the RabbitMQ server, default is localhost
host = localhost
# The port of the RabbitMQ server, default is 5672
port = 5672
# The virtual host of RabbitMQ server, default is /libretime
vhost = /libretime
# The username of the RabbitMQ user, default is libretime
user = libretime
# The password of the RabbitMQ user, default is libretime
password = some_random_generated_secret!
```
## RabbitMQ hostname changes
If the Airtime logs indicate failures to connect to the RabbitMQ server, such as:
In order to apply the changes made in this section, please restart the following services:
```
2013-10-31 08:21:11,255 ERROR - [pypomessagehandler.py : main() : line
99] - Error connecting to RabbitMQ Server. Trying again in few seconds
libretime-api
2013-10-31 08:21:11,255 ERROR - \[pypomessagehandler.py : main() : line 99\] - Error connecting to RabbitMQ Server. Trying again in few seconds - See more at: https://forum.sourcefabric.org/discussion/16050/#sthash.W8OJrNFm.dpuf
libretime-analyzer
libretime-celery
libretime-playout
```
but the RabbitMQ server is running normally, this error might be due to a change in the server's hostname since LibreTime installation. Directory names under `/var/lib/rabbitmq/mnesia/` indicate that RabbitMQ's database files are organized according to the hostname of the server (ex. `rabbit@airtime`) where the hostname is `airtime.example.com`. If the hostname has changed, it may be necessary to reconfigure RabbitMQ manually, as follows:
## Playout
1. Delete the files in `/var/lib/rabbitmq/mnesia/`
The `playout` section configure anything related to the playout service.
```bash
sudo rm -r /var/lib/rabbitmq/mnesia/*
```ini
[playout]
# Liquidsoap connection host, default is localhost
liquidsoap_host = localhost
# Liquidsoap connection port, default is 1234
liquidsoap_port = 1234
# The format for recordings, allowed values are ogg|mp3, default is ogg
record_file_format = ogg
# The bitrate for recordings, default is 256
record_bitrate = 256
# The samplerate for recordings, default is 44100
record_samplerate = 44100
# The number of channels for recordings, default is 2
record_channels = 2
# The sample size for recordings, default is 16
record_sample_size = 16
```
2. Restart RabbitMQ:
In order to apply the changes made in this section, please restart the following services:
```bash
sudo systemctl restart rabbitmq-server
```
libretime-playout
```
3. Enter the following commands to set up authentication and grant permissions. The _rabbitmqctl add_user_ command requires the RabbitMQ password from the /etc/airtime/airtime.conf file as an argument. The _rabbitmqctl set_permissions_ command should be entered on one line, with the list of Airtime services repeated three times:
## LDAP
```bash
rabbitmqctl add_vhost /airtime
rabbitmqctl add_user airtime XXXXXXXXXXXXXXXXXXXX
rabbitmqctl set_permissions -p /airtime airtime
"airtime-pypo|pypo-fetch|airtime-analyzer|media-monitor"
"airtime-pypo|pypo-fetch|airtime-analyzer|media-monitor"
"airtime-pypo|pypo-fetch|airtime-analyzer|media-monitor"
The `ldap` section provide additional configuration for the authentication mechanism defined in `general.auth`, please see the [custom authentication documentation](../custom-authentication.md) for more details.
```ini
[ldap]
# Hostname of LDAP server
hostname = ldap.example.org
# Complete DN of user used to bind to LDAP
binddn = 'uid=libretime,cn=sysaccounts,cn=etc,dc=int,dc=example,dc=org'
# Password for binddn user
password = hackme
# Domain part of username
account_domain = INT.EXAMPLE.ORG
# Base search DN
basedn = 'cn=users,cn=accounts,dc=int,dc=example,dc=org'
# Name of the uid field for searching. Usually uid, may be cn
filter_field = uid
# Map user types to LDAP groups. Assign user types based on the group of a given user
# Key format is groupmap_*
groupmap_superadmin = 'cn=superadmin,cn=groups,cn=accounts,dc=int,dc=example,dc=org'
groupmap_admin = 'cn=admin,cn=groups,cn=accounts,dc=int,dc=example,dc=org'
groupmap_program_manager = 'cn=program_manager,cn=groups,cn=accounts,dc=int,dc=example,dc=org'
groupmap_host = 'cn=host,cn=groups,cn=accounts,dc=int,dc=example,dc=org'
groupmap_guest = 'cn=guest,cn=groups,cn=accounts,dc=int,dc=example,dc=org'
```

View File

@ -1,142 +1,61 @@
# ----------------------------------------------------------------------
# A I R T I M E C O N F I G U R A T I O N
# ----------------------------------------------------------------------
#
# This is an example configuration for Airtime. If you just want to
# get started with a basic Airtime setup, or don't know if you should
# be reconfiguring any of the following values, just move this file
# to '/etc/airtime/' and rename it 'airtime.conf'.
#
# ----------------------------------------------------------------------
# This is an example configuration file.
# ----------------------------------------------------------------------
# G E N E R A L S E T T I N G S
# ----------------------------------------------------------------------
#
# These settings are used for Airtime's webserver configuration, and
# for general-purpose properties.
#
# api_key: The API key for your Airtime installation.
# The value is generated the first time you use Airtime.
#
# base_url: The host name for your webserver.
# The default is localhost.
#
# base_port: The port for your webserver.
# The default is 80.
#
# base_dir: The root directory for your Airtime installation
# on your webserver, relative to the base_url.
# The default is /.
#
# force_ssl: Use HTTPS for all API calls and internal links,
# even if the web server is not operating on port
# 443. This is useful for working behind a reverse
# proxy.
# The default is False.
#
# protocol: Set the specific protocol if required. This is
# useful when using http on port 443. Mutually
# exclusive with force_ssl.
# Default is empty.
#
# cache_ahead_hours: How many hours ahead of time the Airtime playout
# engine (pypo) should cache scheduled media files.
# The default is 1.
#
# airtime_dir: Only used in saas, needed for compatibility.
#
# station_id: The Airtime station name.
# Only used in saas, needed for compatibility.
#
# auth: Auth adaptor to user
# Set to local to use the default db auth or specifiy
# a class like LibreTime_Auth_Adaptor_FreeIpa to replace
# the built-in adaptor
#
[general]
# The internal API authentication key, this field is required
api_key =
# The public url scheme
# Mutually exclusive with force_ssl
protocol = http
# The public url hostname, default is localhost
base_url = localhost
# The public url port
base_port = 80
# The public url base path, default is /
base_dir = /
force_ssl =
protocol =
# Force https for generated urls, default is false
force_ssl = false
# How many hours ahead Playout should cache scheduled media files, default is 1
cache_ahead_hours = 1
airtime_dir =
station_id =
# Authentication adaptor to use for the legacy service, default is local
# Specify a class like LibreTime_Auth_Adaptor_FreeIpa to replace the built-in adaptor
auth = local
#
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# D A T A B A S E
# ----------------------------------------------------------------------
#
# These settings are used to configure your database connection.
#
# host: The hostname of the database server.
# On a default Airtime installation, set this to localhost.
#
# port: The port of the database server.
# On a default Airtime installation, set this to 5432.
#
# name: The name of the Airtime database.
# The default is airtime.
#
# user: The username for the Airtime database user.
# The default is airtime.
#
# password: The password for the Airtime database user.
# The default is airtime.
#
[database]
# The hostname of the PostgreSQL server, default is localhost
host = localhost
# The port of the PostgreSQL server, default is 5432
port = 5432
# The name of the PostgreSQL database, default is libretime
name = airtime
# The username of the PostgreSQL user, default is libretime
user = airtime
# The password of the PostgreSQL user, default is libretime
password = airtime
#
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# RABBITMQ
# ----------------------------------------------------------------------
[rabbitmq]
# The host for the RabbitMQ service, default is localhost
# The hostname of the RabbitMQ server, default is localhost
host = localhost
# The port for the RabbitMQ service, default is 5672
# The port of the RabbitMQ server, default is 5672
port = 5672
# The virtual host for the RabbitMQ service, default is /libretime
# The virtual host of RabbitMQ server, default is /libretime
vhost = /airtime
# The user for the RabbitMQ user, default is libretime
# The username of the RabbitMQ user, default is libretime
user = airtime
# The password for the RabbitMQ user, default is libretime
# The password of the RabbitMQ user, default is libretime
password = airtime
# ----------------------------------------------------------------------
# S T O R A G E
# ----------------------------------------------------------------------
#
[current_backend]
storage_backend=file
# ----------------------------------------------------------------------
# M O N I T
# ----------------------------------------------------------------------
#
# These settings are only for backwards compatibility.
#
# user: The username for the monit user.
#
# password: The password for the monit user.
#
[monit]
user =
password =
#
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# PLAYOUT
# ----------------------------------------------------------------------
@ -157,46 +76,27 @@ record_channels = 2
# The sample size for recordings, default is 16
record_sample_size = 16
# ----------------------------------------------------------------------
# F A C E B O O K
# ----------------------------------------------------------------------
#
[facebook]
facebook_app_id = 0
facebook_app_url = http://example.org
facebook_app_api_key = 0
#
# ----------------------------------------------------------------------
# L D A P
# ----------------------------------------------------------------------
#
# hostname: Hostname of LDAP server
#
# binddn: Complete DN of user used to bind to LDAP
#
# password: Password for binddn user
#
# account_domain: Domain part of username
#
# basedn: base search DN
#
# filter_field: Name of the uid field for searching
# Usually uid, may be cn
#
# groupmap_*: Map LibreTime user types to LDAP groups
# Lets LibreTime assign user types based on the
# group a given user is in.
#
[ldap]
# Hostname of LDAP server
hostname = ldap.example.org
# Complete DN of user used to bind to LDAP
binddn = 'uid=libretime,cn=sysaccounts,cn=etc,dc=int,dc=example,dc=org'
# Password for binddn user
password = hackme
# Domain part of username
account_domain = INT.EXAMPLE.ORG
# Base search DN
basedn = 'cn=users,cn=accounts,dc=int,dc=example,dc=org'
# Name of the uid field for searching. Usually uid, may be cn
filter_field = uid
groupmap_guest = 'cn=guest,cn=groups,cn=accounts,dc=int,dc=example,dc=org'
groupmap_host = 'cn=host,cn=groups,cn=accounts,dc=int,dc=example,dc=org'
groupmap_program_manager = 'cn=program_manager,cn=groups,cn=accounts,dc=int,dc=example,dc=org'
groupmap_admin = 'cn=admins,cn=groups,cn=accounts,dc=int,dc=example,dc=org'
# Map user types to LDAP groups. Assign user types based on the group of a given user
# Key format is groupmap_*
groupmap_superadmin = 'cn=superadmin,cn=groups,cn=accounts,dc=int,dc=example,dc=org'
groupmap_admin = 'cn=admin,cn=groups,cn=accounts,dc=int,dc=example,dc=org'
groupmap_program_manager = 'cn=program_manager,cn=groups,cn=accounts,dc=int,dc=example,dc=org'
groupmap_host = 'cn=host,cn=groups,cn=accounts,dc=int,dc=example,dc=org'
groupmap_guest = 'cn=guest,cn=groups,cn=accounts,dc=int,dc=example,dc=org'