chore: release 3.0.0-alpha.13

This commit is contained in:
jo 2022-07-15 12:24:53 +02:00 committed by Jonas L
parent de7703ffa0
commit 28cec5100a
121 changed files with 1426 additions and 634 deletions

View File

@ -25,7 +25,7 @@ jobs:
- name: Create Release
uses: softprops/action-gh-release@v1
with:
body_path: docs/releases/3.0.0-alpha.12.md
body_path: docs/releases/3.0.0-alpha.13.md
draft: true
prerelease: true
files: libretime-*.tar.gz

View File

@ -0,0 +1,280 @@
---
title: LibreTime 3.0.0 alpha 13
---
import ReleaseHead from './\_release-head.md';
<ReleaseHead date='TODO' version='3.0.0-alpha.13'/>
## :sparkling_heart: Contributors
The LibreTime project wants to thank the following contributors for authoring PRs to this release:
- @jooola
- @paddatrapper
- rinka
- Maxime Leroy
- Mykola
## :rocket: Features
- remove unused python3-venv package ([#1728](https://github.com/libretime/libretime/issues/1728))
- **api:** split api into multiple apps ([#1626](https://github.com/libretime/libretime/issues/1626))
- improve apache configuration ([#1784](https://github.com/libretime/libretime/issues/1784))
- **api:** replace uwsgi with gunicorn ([#1785](https://github.com/libretime/libretime/issues/1785))
- replace exploded base\_\* with public_url
- **shared:** compress logs with gz ([#1827](https://github.com/libretime/libretime/issues/1827))
- **shared:** remove unused abstract app ([#1828](https://github.com/libretime/libretime/issues/1828))
- replace click envar with auto_envvar_prefix ([#1829](https://github.com/libretime/libretime/issues/1829))
- **shared:** allow to disable log rotate/retention
- **legacy:** change logrotate config deploy path
- rotate logs using libretime user
- **legacy:** improve rabbitmq check ([#1839](https://github.com/libretime/libretime/issues/1839))
- **worker:** don't run with a dedicated user
- **playout:** remove unused liquidsoap_prepare_terminate.py ([#1854](https://github.com/libretime/libretime/issues/1854))
- **legacy:** check services using systemctl ([#1856](https://github.com/libretime/libretime/issues/1856))
- change config file format to yaml
- change config filename to config.yml
- change config dir path to /etc/libretime
- **installer:** rewrite install script
- replace php migration with django migration
- drop cc_locale table
- **api:** create set_icecast_passwords command
- **installer:** post install setup instructions
- add systemd libretime.target
- move allowed cors url to configuration file
- remove php web installer
- move storage path setting to configuration file
- **installer:** rename shared files path to /usr/share/libretime
- **shared:** add config trailing slash sanitizer ([#1870](https://github.com/libretime/libretime/issues/1870))
- rename default stream mount point to main
- **api:** rename user model fields ([#1902](https://github.com/libretime/libretime/issues/1902))
- remove unused cc_sess table ([#1907](https://github.com/libretime/libretime/issues/1907))
- remove unused cc_perms table ([#1909](https://github.com/libretime/libretime/issues/1909))
- **api:** rename podcasts models fields ([#1910](https://github.com/libretime/libretime/issues/1910))
- **analyzer:** move compute_md5 to shared library
- **api:** create bulk_import command
- **legacy:** compute md5 during early upload
- **api:** rename track type to library
- **legacy:** add Ukrainian language
- **legacy:** don't guess cors url from server
- **installer:** load .env file to persistent install config
- use dedicated 'libretime' user
- replace apache2 with nginx + php-fpm
- **api:** listen on unix socket with gunicorn
- **api:** use uvicorn as asgi server with gunicorn
- set default locale to en_US
- remove unused cc_country table
## :bug: Bug fixes
- add gettext for legacy locale generation ([#1720](https://github.com/libretime/libretime/issues/1720))
- **installer:** install software-properties-common when required
- **installer:** always install fresh packages
- **api:** prevent timing attacke on api key ([#1771](https://github.com/libretime/libretime/issues/1771))
- **legacy:** load vendors during config init
- **legacy:** bypass config validation during django migration
- **legacy:** the ini config parser requires a .conf ext
- **playout:** disable playout-notify log rotation
- don't set log folder permissions recursively
- **shared:** allow list settings ([#1837](https://github.com/libretime/libretime/issues/1837))
- **legacy:** station url always has a trailing slash ([#1838](https://github.com/libretime/libretime/issues/1838))
- **legacy:** check if libretime-api is running ([#1841](https://github.com/libretime/libretime/issues/1841))
- don't add track types only on migration
- correct cc_file.artwork column size
- **legacy:** remove not null constraint when using default
- **api:** missing build-essential to build psycopg2
- drop unused sequences
- **api:** allow updating default_icecast_password ([#1872](https://github.com/libretime/libretime/issues/1872))
- **deps:** update dependency [@cmfcmf](https://github.com/cmfcmf)/docusaurus-search-local to ^0.11.0 ([#1873](https://github.com/libretime/libretime/issues/1873))
- **legacy:** remove file directory metadata ([#1887](https://github.com/libretime/libretime/issues/1887))
- **api:** update model fields in set_icecast_passwords ([#1903](https://github.com/libretime/libretime/issues/1903))
- **api:** cascade when dropping table ([#1908](https://github.com/libretime/libretime/issues/1908))
- **legacy:** station-metadata api endpoint
- **legacy:** don't log 'could not obtain lock' exception ([#1943](https://github.com/libretime/libretime/issues/1943))
- **legacy:** check empty before iteration on files
- use constrained foreign key for files track_type
- **deps:** update dependency mermaid to v9.1.2 [security] ([#1948](https://github.com/libretime/libretime/issues/1948))
- **installer:** update version file unless tarball ([#1950](https://github.com/libretime/libretime/issues/1950))
- prevent data loose on track_types_id migration ([#1949](https://github.com/libretime/libretime/issues/1949))
- use track_type_id in smartblock criteria
- **legacy:** no invalid track type in smartblock criteria
## :fire: Deprecation and removal
### Allowed CORS origins configuration location
The allowed CORS origins configuration moved from the database to the configuration file. The field in the general preference form is deprecated and will be removed in the next release. Be sure to move your allowed CORS origins configuration to the [configuration file](../admin-manual/setup/configuration.md).
## :arrow_up: Before upgrading
:::caution
Please run this **before the upgrade procedure**!
:::
### Repair broken track types
The database files track type field was previously not constrained and this might have lead to files referencing a now renamed or missing track type. To preserve as much data as possible during the database migration process, you need to check whether some files have broken or missing track type references and fix them accordingly. To list broken track type references, you can run the following command:
```bash
sudo -u www-data libretime-api dbshell --command="
SELECT f.id, f.track_type, f.track_title, f.artist_name, f.filepath
FROM cc_files f
WHERE NOT EXISTS (
SELECT FROM cc_track_types tt
WHERE tt.code = f.track_type
)
AND f.track_type IS NOT NULL
AND f.track_type <> '';"
```
If the above command outputs the following, no file needs fixing.
```
id | track_type | track_title | artist_name | filepath
----+------------+-------------+-------------+----------
(0 rows)
```
In addition, the database smart block criteria value was previously referencing track types using codes, and should now reference track types using ids. You need to check whether some smart block have broken track type references and fix them accordingly. To list broken track type references, you can run the following command:
```bash
sudo -u www-data libretime-api dbshell --command="
SELECT b.name, c.criteria, c.modifier, c.value
FROM cc_blockcriteria c, cc_block b
WHERE c.block_id = b.id
AND NOT EXISTS (
SELECT FROM cc_track_types tt
WHERE tt.code = c.value
)
AND criteria = 'track_type';"
```
If the above command outputs the following, no smart block needs fixing.
```
name | criteria | modifier | value
------+----------+----------+-------
(0 rows)
```
### New configuration file
The configuration file name changed from `airtime.conf` to `config.yml`. Please rename your configuration file using the following command:
```bash
sudo mv /etc/airtime/airtime.conf /etc/airtime/config.yml
```
The configuration directory changed from `/etc/airtime` to `/etc/libretime`. Please rename your configuration directory using the following command:
```bash
sudo mv /etc/airtime /etc/libretime
```
The configuration file format changed to `yml` and the configuration schema changed. Please rewrite your [configuration file](../admin-manual/setup/configuration.md) using the [yaml format](https://yaml.org/). An example configuration file `installer/config.yml` is present in the sources.
The `general` section has been changed:
- the `general.protocol`, `general.base_url`, `general.base_port`, `general.base_dir` and `general.force_ssl` entries were replaced with a single `general.public_url` entry, be sure to use a valid url with the new configuration entry.
A new `storage` section has been added:
- the `storage.path` entry was added to move the storage configuration from the database to the configuration file, be sure to edit your configuration with the path to your storage. The default storage path value is `/srv/libretime`.
### Nginx, Apache and PHP
The `apache2` web server has been replaced with `nginx` and `php-fpm`, be sure to uninstall `apache2` and clean related configuration files:
```bash
sudo rm -f /etc/apache2/sites-*/{airtime,libretime}*
sudo rm -f /etc/php/*/apache2/conf.d/{airtime,libretime}*
sudo apt purge 'apache2' 'libapache2-mod-php*'
sudo find /var/lib/php/sessions -name 'sess_*' -delete
```
### Shared files path
The shared files path changed from `/usr/share/airtime` to `/usr/share/libretime`. The directory must be renamed:
```bash
sudo mv /usr/share/airtime /usr/share/libretime
```
### Systemd services path
The systemd services path changed from `/etc/systemd/system/libretime*` to `/usr/lib/systemd/system/libretime*`. The services must be moved:
```bash
sudo mv /etc/systemd/system/libretime* /usr/lib/systemd/system/
sudo systemctl daemon-reload
```
### Replaced uWSGI with Gunicorn
[uWSGI](https://uwsgi-docs.readthedocs.io) was replaced by [Gunicorn](https://gunicorn.org/), the packages and configuration file should be removed from the system:
```bash
# Remove the configuration file
sudo rm -f /etc/{airtime,libretime}/libretime-api.ini
# Remove the packages
sudo apt purge \
uwsgi \
uwsgi-plugin-python3
```
### Logrotate config filepath
The legacy logrotate config filepath was changed from `/etc/logrotate.d/airtime-php` to `/etc/logrotate.d/libretime-legacy`. The old configuration file must be removed:
```bash
# Remove the configuration file
sudo rm -f /etc/logrotate.d/airtime-php
```
### Worker user
The worker service no longer uses a dedicated `celery` user to run. The old `celery` user can be removed from the system:
```bash
# Remove the celery user
sudo deluser celery
```
## :arrow_up: Upgrading
### New installer
:::warning
Please be careful when running this new installer, it might not be bug free.
:::
The [bash installer](../admin-manual/setup/install.md#run-the-installer) has been rewritten, the flags and options changed, please run `./install --help` to get more details.
### LibreTime user
The LibreTime services now run using a dedicated `libretime` user instead of the default `www-data` user. Be sure to change the ownership of the LibreTime files:
```bash
# Configuration directory
sudo chown -R libretime:libretime /etc/libretime
# Logs directory
sudo chown -R libretime:libretime /var/log/libretime
# Runtime directory
sudo chown -R libretime:libretime /var/lib/libretime
# Storage directory
sudo chown -R libretime:libretime /srv/libretime
```
## :warning: Known issues
The following issues may need a workaround for the time being. Please search the [issues](https://github.com/libretime/libretime/issues) before reporting problems not listed below.
## :memo: Colophon

View File

@ -16,178 +16,8 @@ The LibreTime project wants to thank the following contributors for authoring PR
## :fire: Deprecation and removal
### Allowed CORS origins configuration location
The allowed CORS origins configuration moved from the database to the configuration file. The field in the general preference form is deprecated and will be removed in the next release. Be sure to move your allowed CORS origins configuration to the [configuration file](../admin-manual/setup/configuration.md).
## :arrow_up: Upgrading
### Repair broken track types
:::caution
Please run this **before the upgrade procedure**!
:::
The database files track type field was previously not constrained and this might have lead to files referencing a now renamed or missing track type. To preserve as much data as possible during the database migration process, you need to check whether some files have broken or missing track type references and fix them accordingly. To list broken track type references, you can run the following command:
```bash
sudo -u libretime libretime-api dbshell --command="
SELECT f.id, f.track_type, f.track_title, f.artist_name, f.filepath
FROM cc_files f
WHERE NOT EXISTS (
SELECT FROM cc_track_types tt
WHERE tt.code = f.track_type
)
AND f.track_type IS NOT NULL
AND f.track_type <> '';"
```
If the above command outputs the following, no file needs fixing.
```
id | track_type | track_title | artist_name | filepath
----+------------+-------------+-------------+----------
(0 rows)
```
In addition, the database smart block criteria value was previously referencing track types using codes, and should now reference track types using ids. You need to check whether some smart block have broken track type references and fix them accordingly. To list broken track type references, you can run the following command:
```bash
sudo -u libretime libretime-api dbshell --command="
SELECT b.name, c.criteria, c.modifier, c.value
FROM cc_blockcriteria c, cc_block b
WHERE c.block_id = b.id
AND NOT EXISTS (
SELECT FROM cc_track_types tt
WHERE tt.code = c.value
)
AND criteria = 'track_type';"
```
If the above command outputs the following, no smart block needs fixing.
```
name | criteria | modifier | value
------+----------+----------+-------
(0 rows)
```
### New configuration file
:::caution
Please run this **before the upgrade procedure**!
:::
The configuration file name changed from `airtime.conf` to `config.yml`. Please rename your configuration file using the following command:
```bash
sudo mv /etc/airtime/airtime.conf /etc/airtime/config.yml
```
The configuration directory changed from `/etc/airtime` to `/etc/libretime`. Please rename your configuration directory using the following command:
```bash
sudo mv /etc/airtime /etc/libretime
```
The configuration file format changed to `yml`. Please rewrite your [configuration file](../admin-manual/setup/configuration.md) using the [yaml format](https://yaml.org/). An example configuration file `installer/config.yml` is present in the sources.
### Nginx, Apache and PHP
:::caution
Please run this **before the upgrade procedure**!
:::
The `apache2` web server has been replaced with `nginx` and `php-fpm`, be sure to uninstall `apache2` and clean related configuration files:
```bash
sudo rm -f /etc/apache2/sites-*/{airtime,libretime}*
sudo rm -f /etc/php/*/apache2/conf.d/{airtime,libretime}*
sudo apt purge apache2 'libapache2-mod-php*'
sudo rm -f /var/lib/php/sessions/sess_*
```
### Shared files path
:::caution
Please run this **before the upgrade procedure**!
:::
The shared files path changed from `/usr/share/airtime` to `/usr/share/libretime`. The directory must be renamed:
```bash
sudo mv /usr/share/airtime /usr/share/libretime
```
### Replaced uWSGI with Gunicorn
[uWSGI](https://uwsgi-docs.readthedocs.io) was replaced by [Gunicorn](https://gunicorn.org/), the packages and configuration file should be removed from the system:
```bash
# Remove the configuration file
sudo rm -f /etc/airtime/libretime-api.ini
# Remove the packages
sudo apt purge \
uwsgi \
uwsgi-plugin-python3
```
### Logrotate config filepath
The legacy logrotate config filepath was changed from `/etc/logrotate.d/airtime-php` to `/etc/logrotate.d/libretime-legacy`. The old configuration file must be removed:
```bash
# Remove the configuration file
sudo rm -f /etc/logrotate.d/airtime-php
```
### Worker user
The worker service no longer uses a dedicated `celery` user to run. The old `celery` user can be removed from the system:
```bash
# Remove the celery user
sudo deluser celery
```
### LibreTime user
The LibreTime services now run using a dedicated `libretime` user instead of the default `www-data` user. Be sure to change the ownership of the LibreTime files:
```bash
# Configuration directory
sudo chown -R libretime:libretime /etc/libretime
# Logs directory
sudo chown -R libretime:libretime /var/log/libretime
# Runtime directory
sudo chown -R libretime:libretime /var/lib/libretime
# Storage directory
sudo chown -R libretime:libretime /srv/libretime
```
### New configuration schema
The configuration schema was updated.
The `general` section has been changed:
- the `general.protocol`, `general.base_url`, `general.base_port`, `general.base_dir` and `general.force_ssl` entries were replaced with a single `general.public_url` entry, be sure to use a valid url with the new configuration entry.
A new `storage` section has been added:
- the `storage.path` entry was added to move the storage configuration from the database to the configuration file, be sure to edit your configuration with the path to your storage. The default storage path value is `/srv/libretime`.
## :warning: Known issues
The following issues may need a workaround for the time being. Please search the [issues](https://github.com/libretime/libretime/issues) before reporting problems not listed below.

View File

@ -1,7 +1,7 @@
module.exports = {
title: "LibreTime",
description: "Radio Broadcast & Automation Platform",
version: "3.0.0-alpha.12",
version: "3.0.0-alpha.13",
website: "https://libretime.org",
repository: {
@ -22,7 +22,7 @@ module.exports = {
home: {
links: [
{ label: "Get started 🚀", to: "/docs/admin-manual" },
{ label: "Release note", to: "/docs/releases/3.0.0-alpha.12" },
{ label: "Release note", to: "/docs/releases/3.0.0-alpha.13" },
],
},

View File

@ -1,168 +0,0 @@
---
title: Configuration
sidebar_position: 20
---
To configure LibreTime, you need to edit the `/etc/airtime/airtime.conf` file. This page describe the available options to configure your installation.
## General
The `general` section configure anything related to the legacy and API services.
```ini
[general]
# 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
# 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
```
In order to apply the changes made in this section, please restart the following services:
```
libretime-api
libretime-analyzer
libretime-celery
libretime-playout
```
## Database
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
[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!
```
In order to apply the changes made in this section, please restart the following services:
```
libretime-api
```
## 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
[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!
```
In order to apply the changes made in this section, please restart the following services:
```
libretime-api
libretime-analyzer
libretime-celery
libretime-playout
```
## Playout
The `playout` section configure anything related to the playout service.
```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
```
In order to apply the changes made in this section, please restart the following services:
```
libretime-playout
```
## LDAP
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,125 +0,0 @@
---
title: Reverse proxy
sidebar_position: 30
---
In some deployments, the LibreTime server is deployed behind a reverse proxy,
for example in containerization use-cases such as Docker and LXC. LibreTime
makes extensive use of its API for some site features, which causes
[Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)
to occur. By default, CORS requests are blocked by your browser and the origins
need to be added to the **Allowed CORS URLs** block in
[**General Settings**](../../user-manual/settings.md). These origins should include any
domains that are used externally to connect to your reverse proxy that you
want handled by LibreTime. These URLS can also be set during the first run configuration
that's displayed when you first install LibreTime
### Reverse proxy basics
A reverse proxy allows the LibreTime server to not be connected to the open internet. In
this configuration, it's rather behind another server that proxies traffic to it from
users. This provides some advantages in the containerization space, as this means that
the containers can be on their own internal network, protected from outside access.
A reverse proxy also allows SSL to be terminated in a single location for multiple sites.
This means that all your traffic to the proxy from clients is encrypted, but the reverse
proxy's traffic to the containers on the internal network isn't. All the SSL certificates
live on the reverse proxy and can be renewed there instead of on the individual
containers.
### Setup
For SSL redirection to work, you need two domains: one for LibreTime and one for Icecast.
Here, these will be `libretime.example.com` and `icecast.example.com`.
You require two VMs, servers or containers. Alternatively the reverse proxy can
be located on the server, proxying connections to containers also on the host. Setting up
a containerization environment is beyond the scope of this guide. It assumes that you have
Nginx set up on `localhost` and LibreTime will be installed on `192.168.1.10`. You will need root
access on both. `192.168.1.10` also needs to be able to be accessed from `localhost`
(`ping 192.168.1.10` on `localhost`).
On `192.168.1.10`, install LibreTime as described in the [install guide](./install.md). Once it has installed, replace `<hostname>localhost</hostname>` in
`/etc/icecast2/icecast.xml` with the following:
```xml
<hostname>icecast.example.com</hostname>
```
This is the hostname that people listening to your stream will connect to and what
LibreTime will use to stream out to them. You will then need to restart Icecast using `sudo systemctl restart icecast2`.
On `localhost`, run the following:
```bash
cat << EOF | sudo tee /etc/nginx/sites-available/libretime.conf
server {
listen 80;
server_name libretime.example.com;
location / {
rewrite ^ https://$server_name$request_uri? permanent;
}
}
server {
listen 443 ssl;
server_name libretime.example.com;
ssl_certificate /etc/letsencrypt/live/libretime.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/libretime.example.com/privkey.pem;
add_header Strict-Transport-Security "max-age=15552000;";
add_header X-Frame-Options "SAMEORIGIN";
client_max_body_size 512M;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://192.168.1.10/;
}
}
EOF
```
This Nginx configuration ensures that all traffic uses SSL to the reverse proxy, and
traffic is proxied to `192.168.1.10`.
Next, the SSL certificate needs to be generated and the site activated.
```
sudo apt install certbot
sudo systemctl stop nginx
sudo certbot certonly -d libretime.example.com -a standalone
sudo systemctl start nginx
```
You can now go to `https://libretime.example.com` and go
through the installer. On `General Settings`, you need to change the Webserver Port to
`443` and add the following CORS URLs:
```
https://libretime.example.com
http://libretime.example.com
https://localhost
http://localhost
```
Finally, the configuration file needs updating. Under `[general]`, `force_ssl`
needs to be set to true:
```ini
[general]
...
force_ssl = true
```
## SSL Configuration
To increase the security of your server, you can enable encrypted access to the LibreTime administration interface, and direct your users towards this more secure login page. The main advantage of using this encryption is that your remote users' login names and passwords are not sent in plain text across the public Internet or untrusted local networks, such as shared Wi-Fi access points.
## Deploying a certificate with Certbot
One of the fastest, easiest, and cheapest ways to get an SSL certificate is through [Certbot](https://certbot.eff.org/), as created by the
Electronic Frontier Foundation. To use Certbot, your LibreTime installation must be open to the internet on port 80.
Follow [Certbot's documentation](https://certbot.eff.org/instructions) for your OS and webserver to install an SSL certificate. You'll need to renew the certificate every 90 days to keep your installation secure.
## Mixed encrypted and unencrypted content
Whether your certificate is self-signed or not, you will see browser security warnings whenever a https:// page is delivering unencrypted content, such as the stream from an Icecast server. In Firefox, an exclamation mark icon is displayed in the address bar of the **Listen** pop-up.

View File

@ -1,52 +0,0 @@
---
title: Troubleshooting
sidebar_position: 90
---
This guide walk you though the steps required to troubleshoot LibreTime.
## Services status
When facing a problem with LibreTime the first reflex is to verify whether the services are running.
In the web interface, go to **Settings** > **Status** to see the state of the services.
![](./troubleshooting-status-page.png)
If a service isn't running, you should search for details using the tool running those services.
On a common setup, you should use the systemd service status:
```bash
sudo systemctl status libretime-celery
```
:::note
Be sure to replace the service name with the problematic one.
:::
## Logs
The next place to search for details on potential errors are the log files.
On a common setup, you should search for the following files:
- `/var/log/libretime/analyzer.log` contains logs from the analyzer,
- `/var/log/libretime/api.log` contains logs from the api,
- `/var/log/libretime/legacy.log` contains logs from the legacy app,
- `/var/log/libretime/liquidsoap.log` contains logs from liquidsoap,
- `/var/log/libretime/playout.log` contains logs from playout.
For some LibreTime services, you can set a higher log level using the `LIBRETIME_LOG_LEVEL` environment variable, or by running the service by hand and using a command line flag:
```bash
sudo -u www-data libretime-analyzer --config /etc/airtime/airtime.conf --log-level debug
```
- `/var/log/syslog` contains most of the system logs combined. This log file may contain information that the application logger wasn't able to log, such as early startup errors. You can get the LibreTime logs using:
```bash
sudo tail -f "/var/log/syslog" | grep "libretime-"
```
- `/var/log/apache2/error.log` contains logs from the web server.

View File

@ -6,7 +6,7 @@ title: Built-in microsite
LibreTime includes a microsite, which can be accessed at _serverIP_ or a domain you've set up for your server. The site includes your
logo and station description (set under Settings > General), the login button to the LibreTime interface, the schedule for the next seven days,
podcast tabs, and a live feed of your station with information on the the currently playing artist and track.
podcast tabs, and a live feed of your station with information on the currently playing artist and track.
## Modifying the LibreTime radio page

View File

@ -21,7 +21,7 @@ Feel free to pick the backup software of your choice, but know that rsync and si
### Backup the configuration
On common setups, you need to backup the entire `/etc/airtime` folder.
On common setups, you need to backup the entire `/etc/libretime` folder.
### Backup the database

View File

@ -58,9 +58,9 @@ a [system account](https://www.freeipa.org/page/HowTo/LDAP#System_Accounts) that
set up beforehand.
You can configure everything pertaining to how LibreTime accesses LDAP in
`/etc/airtime/airtime.conf`. The default file has the following values you need to change.
`/etc/libretime/config.yml`. The default file has the following values you need to change.
```ini
```yml
#
# ----------------------------------------------------------------------
# L D A P
@ -83,27 +83,27 @@ You can configure everything pertaining to how LibreTime accesses LDAP in
# Lets LibreTime assign user types based on the
# group a given user is in.
#
[ldap]
hostname = ldap.example.org
binddn = 'uid=libretime,cn=sysaccounts,cn=etc,dc=int,dc=example,dc=org'
password = hackme
account_domain = INT.EXAMPLE.ORG
basedn = 'cn=users,cn=accounts,dc=int,dc=example,dc=org'
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'
groupmap_superadmin = 'cn=superadmin,cn=groups,cn=accounts,dc=int,dc=example,dc=org'
ldap:
hostname: ldap.example.org
binddn: "uid=libretime,cn=sysaccounts,cn=etc,dc=int,dc=example,dc=org"
password: hackme
account_domain: INT.EXAMPLE.ORG
basedn: "cn=users,cn=accounts,dc=int,dc=example,dc=org"
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"
groupmap_superadmin: "cn=superadmin,cn=groups,cn=accounts,dc=int,dc=example,dc=org"
```
### Enable FreeIPA authentication
After everything is set up properly you can enable FreeIPA auth in `airtime.conf`:
After everything is set up properly you can enable FreeIPA auth in `config.yml`:
```
[general]
auth = LibreTime_Auth_Adaptor_FreeIpa
```yml
general:
auth: LibreTime_Auth_Adaptor_FreeIpa
```
You should now be able to use your FreeIPA credentials to log in to LibreTime.

View File

@ -28,7 +28,7 @@ It is strongly recommended that you do this before exposing your server to the i
Make sure to include the semicolon at the end! A response of `ALTER ROLE` means that the command ran successfully.
3. Change the password for the _airtime_ user with `ALTER USER airtime WITH PASSWORD 'new_password';`
A response of `ALTER ROLE` means that the command ran successfully.
4. If all is successful, logout of PostgreSQL with `\q`, go back to `/etc/airtime/airtime.conf` to edit the password
4. If all is successful, logout of PostgreSQL with `\q`, go back to `/etc/libretime/config.yml` to edit the password
in the config file, and restart all services mentioned in the previous section.
## Icecast
@ -61,4 +61,4 @@ To change the default password for RabbitMQ, run the following command
sudo rabbitmqctl change_password airtime newpassword
```
and then update the `/etc/airtime/airtime.conf` file with the new password.
and then update the `/etc/libretime/config.yml` file with the new password.

View File

@ -0,0 +1,16 @@
---
title: Library management
sidebar_position: 30
---
This page describe the available options to manage the LibreTime library.
## Files bulk import
To scan a directory and import the files into the library, you can use the following command:
```bash
sudo -u libretime libretime-api bulk_import --path PATH_THE_DIRECTORY_TO_SCAN
```
See the command usage to get available options.

View File

@ -0,0 +1,174 @@
---
title: Configuration
sidebar_position: 20
---
To configure LibreTime, you need to edit the `/etc/libretime/config.yml` file. This page describe the available options to configure your installation.
## General
The `general` section configure anything related to the legacy and API services.
```yml
general:
# The public url, this field is REQUIRED
public_url: https://example.com
# The internal API authentication key, this field is REQUIRED
api_key: some_random_generated_secret!
# List of origins allowed to access resources on the server, default is []
# The public url origin is automatically included
allowed_cors_origins: []
# How many hours ahead Playout should cache scheduled media files, default is 1
cache_ahead_hours: 1
# 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
```
In order to apply the changes made in this section, please restart the following services:
```
libretime-api
libretime-analyzer
libretime-celery
libretime-playout
```
## Database
The `database` section configure the PostgreSQL connection.
:::caution
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
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!
```
In order to apply the changes made in this section, please restart the following services:
```
libretime-api
```
## RabbitMQ
The `rabbitmq` section configure the RabbitMQ connection.
:::caution
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
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!
```
In order to apply the changes made in this section, please restart the following services:
```
libretime-api
libretime-analyzer
libretime-celery
libretime-playout
```
## Playout
The `playout` section configure anything related to the playout service.
```yml
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
```
In order to apply the changes made in this section, please restart the following services:
```
libretime-playout
```
## LDAP
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.
```yml
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

@ -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,75 +109,87 @@ 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
```
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
- 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:
If you plan to output analog audio directly to a mixing console or transmitter, the user running LibreTime needs to be added to the `audio` user group using the command below:
```bash
sudo adduser www-data audio
sudo adduser libretime 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 libretime 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

@ -0,0 +1,150 @@
---
title: Reverse proxy
sidebar_position: 30
---
This guide walk you though the steps required to setup a reverse proxy in front of LibreTime.
Setting a reverse proxy in front of LibreTime is recommended, it prevents LibreTime to be
open to the Internet, adds security by enabling `https` and let's you manage your certificates in
a single place.
:::warning
The current input and output streams are Icecast based protocols and does not support being behind a reverse proxy. **Do not attempt** to [reverse proxy Icecast](#icecast) or the Liquidsoap harbor inputs.
Modern protocols such as [HLS](https://en.wikipedia.org/wiki/HTTP_Live_Streaming) and [SRT](https://en.wikipedia.org/wiki/Secure_Reliable_Transport) will be implement in the future to fix those limitations.
:::
Below is a schema that illustrate the goals when setting up a reverse proxy in front of LibreTime:
```mermaid
flowchart TD
internet[Internet]
subgraph internal[Your system or private network]
libretime[LibreTime service, listen on :8080]
icecast[Icecast service, listen on :8000]
liquidsoap[Liquidsoap service, listen on :8001 and 8002]
subgraph proxy[Your reverse proxy]
front_http[Listen on :80]
front_https[Listen on :443]
front_http -.-> |Redirect to https| front_https
router[Router]
front_https --> |Terminate https| router
end
router --> |If hostname is radio.example.com| libretime
end
internet ==> front_http
internet ==> front_https
internet ==> icecast
internet ==> liquidsoap
```
## Prerequisites
You need a domain name (`radio.example.com`) and a `tls` certificate for that domain. You can get certificates from Let's Encrypt by using [Certbot](https://certbot.eff.org/).
You need to identify the location of the services that should be exposed to the public:
- the LibreTime web server (usually `localhost:8080`, for documentation clarity we use `libretime:8080`).
:::info
If LibreTime is running on the same host as the reverse proxy, you need to change the LibreTime web server default listening port because the reverse proxy needs to listen on the `80`and `443` ports.
:::
:::caution
Be sure that your firewall and network allows communications from the reverse proxy to the services. You can use `ping`, `telnet` and `curl` to check that communication is working.
:::
## Install a reverse proxy
### Apache
:::info
You follow one of these guides to configure Apache with a Let's Encrypt certificate.
- [How To Secure Apache with Let's Encrypt on Ubuntu 20.04](https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-20-04)
:::
:construction:
### Nginx
:::info
You follow one of these guides to configure Nginx with a Let's Encrypt certificate.
- [How To Secure Nginx with Let's Encrypt on Ubuntu 20.04](https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-20-04)
:::
Once you installed nginx and retrieved the required certificates, you can configure the reverse proxy to work with LibreTime.
Paste the following configuration in `/etc/nginx/sites-available/libretime.conf` and be sure to replace:
- `radio.example.com` with your own station url,
- `libretime:8080` with the location of your LibreTime web server;
```nginx
server {
listen 80;
server_name radio.example.com;
location / {
rewrite ^ https://$server_name$request_uri? permanent;
}
}
server {
listen 443 ssl;
server_name radio.example.com;
ssl_certificate /etc/letsencrypt/live/radio.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/radio.example.com/privkey.pem;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_pass http://libretime:8080/;
}
}
```
Enable the nginx configuration and restart nginx using the commands below:
```bash
ln -s /etc/nginx/sites-available/libretime.conf /etc/nginx/sites-enabled/
sudo systemctl restart nginx
```
## Icecast
:::warning
If you attempt to listen an insecure Icecast stream on a secure website, a
[mixed content error](https://support.mozilla.org/en-US/kb/mixed-content-blocking-firefox)
will be raised by your browser and should prevent your player from listening to the stream.
You follow one of these guides to configure a secure Icecast server with a Let's Encrypt certificate.
- [Icecast HTTPS/SSL with Lets Encrypt](https://mediarealm.com.au/articles/icecast-https-ssl-setup-lets-encrypt/)
:::

View File

@ -11,24 +11,44 @@ You should always have proper backups and a rollback scenario in place before up
:::
## Stop the services
Run the following commands to stop the services:
```bash
sudo systemctl stop libretime.target
# Or
sudo systemctl stop libretime-analyzer.service
sudo systemctl stop libretime-api.service
sudo systemctl stop libretime-celery.service
sudo systemctl stop libretime-liquidsoap.service
sudo systemctl stop libretime-playout.service
```
## 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.
## Install the new version
Follow [the install guide](./install.md#download) to download and install the new version, and re-run the `./install` script with the same arguments you used during the initial install.
## Apply upgrade instructions
Be sure to carefully read **all** the [releases notes](../../releases/README.md), from your current version to the targeted version, to apply upgrade or breaking changes instructions to your installation.
:::caution
You might need to run steps before and after the install procedure. Be sure to follow these steps thoroughly.
:::
## Install the new version
Follow [the install guide](./install.md#download) to download and install the new version, and re-run the `./install` script with the same arguments you used during the initial install.
## Apply migrations
Run the following command to apply the database migrations:
```bash
libretime-api migrate
sudo -u libretime libretime-api migrate
```
## Restart the services
@ -36,14 +56,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 +64,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|nginx|php.*-fpm'
```
Verify for any error in the logs after the install process:

View File

@ -1,10 +1,8 @@
---
title: Icecast configuration
title: Stream configuration
sidebar_position: 30
---
## Background
LibreTime supports direct connection to two popular streaming media servers, the open source Icecast (https://www.icecast.org/) and the proprietary SHOUTcast (https://www.shoutcast.com). Apart from the software license, the main difference between these two servers is that Icecast supports simultaneous MP3, AAC, Ogg Vorbis or Ogg Opus streaming from LibreTime, whereas SHOUTcast only supports MP3 and AAC streams. The royalty-free Ogg Vorbis format has the advantage of better sound quality than MP3 at lower bitrates, which has a direct impact on the amount of bandwidth that your station will require to serve the same number of listeners. Ogg Opus also benefits from good sound quality at low bitrates, with the added advantage of lower latency than other streaming formats. Opus is now an [IETF standard](https://datatracker.ietf.org/doc/html/rfc6716) and requires Icecast 2.4 or later to be installed on the streaming server.
Ogg Vorbis playback is supported in most modern web browsers (see [this MDN article](https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Audio_codecs#opus) for more information) and desktop players like [VLC](https://www.videolan.org/vlc/).
@ -19,7 +17,9 @@ Setting a higher bitrate for your output stream will only benefit your listeners
:::
## UTF-8 metadata in Icecast MP3 streams
## Icecast
### UTF-8 metadata in Icecast MP3 streams
When sending metadata about your stream to an Icecast server in non-Latin alphabets, you may find that Icecast does not display the characters correctly for an MP3 stream, even though they're displayed correctly for an Ogg Vorbis stream. In the following screenshot, Russian characters are being displayed incorrectly in the _Current Song_ field for the MP3 stream:
@ -36,7 +36,7 @@ The solution is to specify that the metadata for the MP3 mount point you are usi
After saving the `/etc/icecast2/icecast.xml` file, restart the Icecast server with `sudo systemctl restart icecast2`.
## Icecast handover configuration
### Icecast handover configuration
In a typical radio station configuration, the live output from the broadcast studio and the scheduled output from LibreTime are mixed together before being sent further along the broadcast chain, to a transmitter or streaming media server on the Internet. (This may not be the case if your LibreTime server is remote from the studio, and you are using the **Show Source Mount Point** or **Master Source Mount Point** to mix live and scheduled content. See the _Stream Settings_ chapter for details).
@ -46,17 +46,17 @@ The Icecast server has a _fallback-mount_ feature which can be used to move clie
To enable fallback mounts, edit the main Icecast configuration file (`/etc/icecast2/icecast.xml`) to define the mount points you will use, and the relationship between them.
The example mount section provided in the `icecast.xml` file is commented out by default. Before or after the commented section, add three mount point definitions. The default mount point used by LibreTime is `/airtime_128` which is shown in the `/etc/airtime/liquidsoap.cfg` file. You must also define a mount point for the live source (ex. `/live.ogg`) and a mount point for the public to connect to (ex. `/stream.ogg`).
The example mount section provided in the `icecast.xml` file is commented out by default. Before or after the commented section, add three mount point definitions. The default mount point used by LibreTime is `/main` which is shown in the `/etc/libretime/liquidsoap.cfg` file. You must also define a mount point for the live source (ex. `/live.ogg`) and a mount point for the public to connect to (ex. `/stream.ogg`).
```xml title="/etc/icecast2/icecast.xml"
<mount>
<mount-name>/airtime_128</mount-name>
<mount-name>/main</mount-name>
<hidden>0</hidden>
</mount>
<mount>
<mount-name>/live.ogg</mount-name>
<fallback-mount>/airtime_128</fallback-mount>
<fallback-mount>/main</fallback-mount>
<fallback-override>1</fallback-override>
<hidden>0</hidden>
</mount>
@ -69,13 +69,13 @@ The example mount section provided in the `icecast.xml` file is commented out by
</mount>
```
These mount point definitions mean that a client connecting to a URL such as *http://icecast.example.com:8000/stream.ogg* will first fall back to the `/live.ogg` mount point if it is available. If not, the client will fall back in turn to the `/airtime_128` mount point for LibreTime playout.
These mount point definitions mean that a client connecting to a URL such as *http://icecast.example.com:8000/stream.ogg* will first fall back to the `/live.ogg` mount point if it is available. If not, the client will fall back in turn to the `/main` mount point for LibreTime playout.
Setting the value of _fallback-override_ to 1 (enabled) means that when the `/live.ogg` mount point becomes available again, the client will be re-connected to it. If you wish to hide the `/airtime_128` and `/live.ogg` mount points from the public Icecast web interface, set the value of _hidden_ in each of these definitions to 1.
Setting the value of _fallback-override_ to 1 (enabled) means that when the `/live.ogg` mount point becomes available again, the client will be re-connected to it. If you wish to hide the `/main` and `/live.ogg` mount points from the public Icecast web interface, set the value of _hidden_ in each of these definitions to 1.
## Source configuration
### Source configuration
Connect the other source to the Icecast server with the same parameters defined in the `/etc/airtime/liquidsoap.cfg` file, except for the mount point. This should one of the mount points you have defined in the `/etc/icecast2/icecast.xml` file, such as `/live.ogg` in the example above.
Connect the other source to the Icecast server with the same parameters defined in the `/etc/libretime/liquidsoap.cfg` file, except for the mount point. This should one of the mount points you have defined in the `/etc/icecast2/icecast.xml` file, such as `/live.ogg` in the example above.
:::tip Streaming with Mixxx
@ -85,7 +85,7 @@ To configure Mixxx for streaming to Icecast, click _Options_, _Preferences_, the
By default, Icecast streams are buffered to guard against network problems, which causes latency for remote listeners. When monitoring the stream from a remote location, you may have to begin the live stream a few seconds before the previous stream ends to enable a smooth transition.
## Promoting your station
### Promoting your station
:::note

View File

@ -0,0 +1,61 @@
---
title: Troubleshooting
sidebar_position: 90
---
This guide walk you though the steps required to troubleshoot LibreTime.
## Services status
When facing a problem with LibreTime the first reflex is to verify whether the services are running.
In the web interface, go to **Settings** > **Status** to see the state of the services.
![](./troubleshooting-status-page.png)
Or directly from a terminal:
```bash
sudo systemctl --all --plain | egrep 'libretime|nginx|php.*-fpm'
```
If a service isn't running, you should search for details using the tool running those services.
On a common setup, you should use the systemd service status:
```bash
sudo systemctl status libretime-celery
```
:::note
Be sure to replace the service name with the problematic one.
:::
## Logs
The next place to search for details on potential errors are the log files.
The `/var/log/syslog` file contains most of the system logs combined. This log file may contain information that the application logger wasn't able to log, such as early startup errors. You can follow the logs using:
```bash
sudo tail -n 100 -f "/var/log/syslog"
# Filter the logs
sudo tail -n 100 -f "/var/log/syslog" | egrep 'libretime|nginx|php.*-fpm'
```
On a common setup, to access LibreTime specific logs you should search for the following files:
- The `/var/log/libretime/analyzer.log` file contains logs from the analyzer,
- The `/var/log/libretime/api.log` file contains logs from the api,
- The `/var/log/libretime/legacy.log` file contains logs from the legacy app,
- The `/var/log/libretime/liquidsoap.log` file contains logs from liquidsoap,
- The `/var/log/libretime/playout.log` file contains logs from playout.
For some LibreTime services, you can set a higher log level using the `LIBRETIME_LOG_LEVEL` environment variable, or by running the service by hand and using a command line flag:
```bash
sudo -u libretime libretime-analyzer --config /etc/libretime/config.yml --log-level debug
```
The `/var/log/nginx/libretime.error.log` file contains logs from the web server.

View File

@ -0,0 +1,123 @@
---
title: Uninstall
sidebar_position: 91
---
This guide provide some guidance to uninstall LibreTime from your system.
We recommend using **disposable devices** for your installations, so you can delete your old system and install on a fresh one easily without worrying about old files.
If you do not have a way use disposable devices, below are commands that should help you remove most of the LibreTime files from your system.
:::warning
Use these commands at your **own risk**, we cannot guarantee that these commands are always up to date!
:::
Remove configuration directories:
```bash
sudo rm -Rf /etc/airtime
sudo rm -Rf /etc/libretime
```
Remove logs directories:
```bash
sudo rm -Rf /var/log/airtime
sudo rm -Rf /var/log/libretime
```
Remove runtime directories:
```bash
sudo rm -Rf /var/lib/airtime
sudo rm -Rf /var/lib/libretime
```
Remove shared directories:
```bash
sudo rm -Rf /usr/share/airtime
sudo rm -Rf /usr/share/libretime
```
Remove systemd services files:
```bash
sudo rm -f /{etc,usr/lib}/systemd/system/airtime*
sudo rm -f /{etc,usr/lib}/systemd/system/libretime*
```
Remove nginx configuration files:
```bash
sudo rm -f /etc/nginx/sites-{available,enabled}/airtime*
sudo rm -f /etc/nginx/sites-{available,enabled}/libretime*
```
Remove php-fpm configuration files:
```bash
sudo rm -f /etc/php/*/fpm/pool.d/airtime*
sudo rm -f /etc/php/*/fpm/pool.d/libretime*
```
Remove logrotate configuration files:
```bash
sudo rm -f /etc/logrotate.d/airtime*
sudo rm -f /etc/logrotate.d/libretime*
```
Remove python packages:
```bash
sudo pip3 uninstall \
libretime-analyzer \
libretime-api \
libretime-api-client \
libretime-playout \
libretime-shared \
libretime-celery
# Check if we forgot old python packages.
# Remove packages that show up with this commands.
sudo pip3 freeze | grep libretime
sudo pip3 freeze | grep airtime
```
Delete the postgresql database and user:
```bash
sudo -u postgres dropdb airtime
sudo -u postgres dropdb libretime
sudo -u postgres dropuser airtime
sudo -u postgres dropuser libretime
```
Delete the rabbitmq vhost and user:
```bash
sudo rabbitmqctl delete_vhost airtime
sudo rabbitmqctl delete_vhost libretime
sudo rabbitmqctl delete_user airtime
sudo rabbitmqctl delete_user libretime
```
Delete the file storage (you probably don't want that):
```bash
sudo rm -Rf /srv/airtime
sudo rm -Rf /srv/libretime
```
Search for remaining files:
```bash
sudo find / -name "libretime*"
sudo find / -name "airtime*"
```

View File

@ -10,4 +10,5 @@ Welcome to the **LibreTime developer manual**, you should find guides to integra
## Improve and contribute to LibreTime
- :construction: Work in progress
- Learn about the [architecture of LibreTime](./design/architecture.md)
- Learn about the [database migrations](./design/database-migrations.md)

View File

@ -0,0 +1,108 @@
---
title: Architecture
---
This document explains the design details and goals for the architecture of LibreTime. It describes the result of a [discussion that happened on Github](https://github.com/libretime/libretime/issues/1610).
## Previous architecture
The previous architecture of LibreTime (based on AirTime) was missing a proper separation of concerns. It was build around a legacy MVC app written in PHP, and services in Python to accomplish specific tasks.
## New architecture
Below is the new architecture goal of LibreTime, with a proper separation of concerns.
```mermaid
flowchart TD
users([Users])
public([Public])
subgraph create_schedule[Create the schedule]
webapp[Web app]
subgraph core[Backend]
message_api[Message API]
api[Web API]
worker[Worker]
end
end
subgraph play_schedule[Play the schedule]
playout[Playout]
liquidsoap[[Liquidsoap]]
icecast[[Icecast]]
hls[[HLS]]
end
message_queue[[Message Queue]]
database[[Database]]
storage[[Storage]]
users --> |Edit| webapp
webapp --> api
api --> database
api --> storage
api --> message_queue
message_queue <--> worker
worker --> database
worker --> storage
message_queue <--> message_api
message_api --> database
message_queue <--> playout
playout <-. via message queue .-> message_api
playout --> |e.g. download file| api
playout <--> liquidsoap
liquidsoap --> icecast
liquidsoap --> hls
public --> webapp
public --> |Listen| icecast
public --> |Listen| hls
```
The LibreTime architecture is split into 2 main monolithic blocks `Create the schedule` and `Play the schedule`. Both blocks must be able to scale horizontally.
:::note
A microservice architecture was rejected as it will not fix or improve any aspect of LibreTime.
:::
:::warning
This document tries to focus on creating and playing a schedule, it does not consider features such as monitoring, logging or archiving.
:::
### Create the schedule
This block contains the following components:
- a web API,
- a worker to run background tasks,
- a message API to communicate with the `Play the schedule` block, and other services,
- a web app to interface with the users.
The web API, the worker and the message API rely on the [Django framework](https://www.djangoproject.com/) to handle database, message queue and storage access.
### Play the schedule
Since the `Play the schedule` has its own requirements in terms of logic and uptime, it is handled separately from the `Create the schedule` block. This block needs to be able to be duplicated in a high availability context.
This block contains the following components:
- a Playout app that communicates with the `Play the schedule` block to gather the schedule,
- a Liquisoap app that plays and mixes the scheduled items, and dispatch them to the delivery services,
- an Icecast server that delivers a legacy audio stream to the public,
- a HLS stream that delivers a modern audio stream to the public.
### One setup per radio station
LibreTime is not meant to be used in a multi-tenant architecture, and an entire LibreTime installation should be dedicated to a single radio station. Previous SAAS or multi-tenant features from Airtime should be deprecated or removed.
### Separation of concerns
The `Create the schedule` block must only prepare a schedule, and the `Play the schedule` must only play that schedule. A strong separation of concerns is required between the 2 blocks to allow the `Play the schedule` block to meet its uptime requirements while not depending on the `Create the schedule` in case of a failure. Development will be simplified if both blocks share a single and properly defined protocol.

View File

@ -0,0 +1,51 @@
# Database schema creation and migrations
The method to maintain the database schema, is to write both a migration file for already installed databases and to update a `schema.sql` file for fresh databases. On fresh installation, the database is filled with the `schema.sql` and `data.sql` files and LibreTime won't run any sql migration on top of it. Previously, when LibreTime was upgraded, the missing migrations were run using a custom php based migration tool, those migrations are now handled by Django. The missing migrations are tracked using both a `schema_version` field in the `cc_pref` table and a Django migration id.
:::note
Since LibreTime forked, the `schema_version` in the `schema.sql` was locked on `3.0.0-alpha` and all the migrations were run during the first user connection. This has been fixed during the move to the Django based migrations.
:::
Django does not maintain a `schema.sql` file, it applies every migrations until it reaches the targeted schema represented by the code. The legacy `schema_version` has to be tracked until we remove the Propel schema generation and let Django handle all the schema migrations. Until then Propel generate the schema and Django handle migrations from already installed databases.
:::info
The first Django migration is the initial schema creation using the `schema.sql` and `data.sql` files.
:::
```mermaid
stateDiagram-v2
state is_django_migration_applied <<choice>>
[*] --> is_django_migration_applied: Is the django migration ID in the DB ?
is_django_migration_applied --> [*]: Yes, ignoring...
state "Apply django migration" as apply_django_migration
is_django_migration_applied --> apply_django_migration: No
state apply_django_migration {
state is_legacy_migration <<choice>>
[*] --> is_legacy_migration: Is it a legacy migration ?
state "Run django migration" as run_django_migration
state "Apply changes" as run_django_migration
state "Save migration ID in DB" as run_django_migration
is_legacy_migration --> run_django_migration: No
run_legacy_migration --> run_django_migration
run_django_migration --> [*]
state is_legacy_migration_applied <<choice>>
is_legacy_migration_applied --> [*]: Yes, ignoring...
state "Run legacy migration" as run_legacy_migration
state "Apply changes" as run_legacy_migration
state "Bump legacy schema version" as run_legacy_migration
is_legacy_migration_applied --> run_legacy_migration: No
is_legacy_migration --> is_legacy_migration_applied: Yes, is the DB schema version >= legacy migration schema version ?
}
apply_django_migration --> [*]
```

View File

@ -8,7 +8,7 @@ We're in the process of rewriting LibreTime's API. This page contains the instru
:::
The LibreTime API enables many types of information about the broadcast schedule and configuration to be retrieved from the LibreTime server. Other than the live-info and week-info data fetched by website widgets (see the chapter _Exporting the schedule_), all API requests must be authenticated using the secret API key stored in the file `/etc/airtime/api_client.cfg` on the LibreTime server. This key is autogenerated during LibreTime installation and should be unique for each server.
The LibreTime API enables many types of information about the broadcast schedule and configuration to be retrieved from the LibreTime server. Other than the live-info and week-info data fetched by website widgets (see the chapter _Exporting the schedule_), all API requests must be authenticated using the secret API key stored in the file `/etc/libretime/api_client.cfg` on the LibreTime server. This key is autogenerated during LibreTime installation and should be unique for each server.
If you intend to use the LibreTime API across a public network, for security reasons it is highly recommended that all API requests are sent over encrypted https: and that the web server is configured to accept requests to the api/ directory from specific host names or IP addresses only.
@ -36,7 +36,7 @@ For example, using the action _get-stream-setting_ returns the following output
{"keyname":"s1_port","value":"8000","type":"integer"},
{"keyname":"s1_mount","value":"airtime_128","type":"string"},
{"keyname":"s1_mount","value":"main","type":"string"},
{"keyname":"s1_url","value":"http:\/\/airtime.sourcefabric.org","type":"string"},

View File

@ -121,7 +121,7 @@ Reportedly this might wake the :cat2: (![happy-cuteness-overload-small](https://
### Liquidsoap >= 1.3.0 Support
Libretime currently only supports liquidsoap `< 1.3.0` out of the box. If you install a current version of liquidsoap [using OPAM](https://www.liquidsoap.info/) or through the [Rabe Liquidsoap Distribution for CentOS (RaBe LSD)](https://build.opensuse.org/project/show/home:radiorabe:liquidsoap) you will most likely have liquidsoap `1.3.1` installed.
LibreTime currently only supports liquidsoap `< 1.3.0` out of the box. If you install a current version of liquidsoap [using OPAM](https://www.liquidsoap.info/) or through the [Rabe Liquidsoap Distribution for CentOS (RaBe LSD)](https://build.opensuse.org/project/show/home:radiorabe:liquidsoap) you will most likely have liquidsoap `1.3.1` installed.
You can check your liquidsoap version by running `liquidsoap --version`.

View File

@ -149,7 +149,7 @@ Reportedly this might wake the :cat2: (![happy-cuteness-overload-small](https://
### Liquidsoap >= 1.3.0 Support
Libretime currently only supports liquidsoap `< 1.3.0` out of the box. If you install a current version of liquidsoap [using OPAM](https://www.liquidsoap.info/) or through the [Rabe Liquidsoap Distribution for CentOS (RaBe LSD)](https://build.opensuse.org/project/show/home:radiorabe:liquidsoap) you will most likely have liquidsoap `1.3.1` installed.
LibreTime currently only supports liquidsoap `< 1.3.0` out of the box. If you install a current version of liquidsoap [using OPAM](https://www.liquidsoap.info/) or through the [Rabe Liquidsoap Distribution for CentOS (RaBe LSD)](https://build.opensuse.org/project/show/home:radiorabe:liquidsoap) you will most likely have liquidsoap `1.3.1` installed.
You can check your liquidsoap version by running `liquidsoap --version`.

View File

@ -111,7 +111,7 @@ Reportedly this might have [side effects](https://github.com/libretime/libretime
### Liquidsoap Support
Libretime currently only supports liquidsoap `< 1.3.0` out of the box. If you install a current version of liquidsoap [using OPAM](https://www.liquidsoap.info/) or through the [Rabe Liquidsoap Distribution for CentOS (RaBe LSD)](https://build.opensuse.org/project/show/home:radiorabe:liquidsoap) you will most likely have liquidsoap `1.3.2` or `1.3.3` installed.
LibreTime currently only supports liquidsoap `< 1.3.0` out of the box. If you install a current version of liquidsoap [using OPAM](https://www.liquidsoap.info/) or through the [Rabe Liquidsoap Distribution for CentOS (RaBe LSD)](https://build.opensuse.org/project/show/home:radiorabe:liquidsoap) you will most likely have liquidsoap `1.3.2` or `1.3.3` installed.
#352 reports that liquidsoap `< 1.3.0` can exhibit issues on some Debian based installs. One fix for the issue is to install liquidsoap `1.3.0` and to use the following patching steps. Kyle from silan fame is taking the needed steps to get liquidsoap maintained again in Debian so we expect the situation to improve over time.

View File

@ -133,7 +133,7 @@ Reportedly this might have [side effects](https://github.com/libretime/libretime
### Liquidsoap Support
Libretime currently only supports liquidsoap `< 1.3.0` out of the box. If you install a current version of liquidsoap [using OPAM](https://www.liquidsoap.info/) or through the [Rabe Liquidsoap Distribution for CentOS (RaBe LSD)](https://build.opensuse.org/project/show/home:radiorabe:liquidsoap) you will most likely have liquidsoap `1.3.2` or `1.3.3` installed.
LibreTime currently only supports liquidsoap `< 1.3.0` out of the box. If you install a current version of liquidsoap [using OPAM](https://www.liquidsoap.info/) or through the [Rabe Liquidsoap Distribution for CentOS (RaBe LSD)](https://build.opensuse.org/project/show/home:radiorabe:liquidsoap) you will most likely have liquidsoap `1.3.2` or `1.3.3` installed.
#352 reports that liquidsoap `< 1.3.0` can exhibit issues on some Debian based installs. One fix for the issue is to install liquidsoap `1.3.0` and to use the following patching steps. Kyle from silan fame is taking the needed steps to get liquidsoap maintained again in Debian so we expect the situation to improve over time.

View File

@ -72,7 +72,7 @@ tldr: **[Silan Installation](https://github.com/libretime/libretime/wiki/Silan-I
### Liquidsoap Support
Libretime currently only supports liquidsoap `< 1.3.0` out of the box. If you install a current version of liquidsoap [using OPAM](https://www.liquidsoap.info/) or through the [Rabe Liquidsoap Distribution for CentOS (RaBe LSD)](https://build.opensuse.org/project/show/home:radiorabe:liquidsoap) you will most likely have liquidsoap `1.3.2` or `1.3.3` installed.
LibreTime currently only supports liquidsoap `< 1.3.0` out of the box. If you install a current version of liquidsoap [using OPAM](https://www.liquidsoap.info/) or through the [Rabe Liquidsoap Distribution for CentOS (RaBe LSD)](https://build.opensuse.org/project/show/home:radiorabe:liquidsoap) you will most likely have liquidsoap `1.3.2` or `1.3.3` installed.
#352 reports that liquidsoap `< 1.3.0` can exhibit issues on some Debian based installs. One fix for the issue is to install liquidsoap `1.3.0` and to use the following patching steps. Kyle from silan fame is taking the needed steps to get liquidsoap maintained again in Debian so we expect the situation to improve over time.

View File

@ -98,7 +98,7 @@ tldr: **[Silan Installation](https://github.com/libretime/libretime/wiki/Silan-I
### Liquidsoap Support
Libretime currently only supports liquidsoap `< 1.3.0` out of the box. If you install a current version of liquidsoap [using OPAM](https://www.liquidsoap.info/) or through the [Rabe Liquidsoap Distribution for CentOS (RaBe LSD)](https://build.opensuse.org/project/show/home:radiorabe:liquidsoap) you will most likely have liquidsoap `1.3.2` or `1.3.3` installed.
LibreTime currently only supports liquidsoap `< 1.3.0` out of the box. If you install a current version of liquidsoap [using OPAM](https://www.liquidsoap.info/) or through the [Rabe Liquidsoap Distribution for CentOS (RaBe LSD)](https://build.opensuse.org/project/show/home:radiorabe:liquidsoap) you will most likely have liquidsoap `1.3.2` or `1.3.3` installed.
#352 reports that liquidsoap `< 1.3.0` can exhibit issues on Debian Stretch installs. One fix for the issue is to install liquidsoap `1.3.0` and to use the following patching steps.

View File

@ -70,7 +70,7 @@ tldr: **[Silan Installation](https://github.com/libretime/libretime/wiki/Silan-I
### Liquidsoap Support
Libretime currently only supports liquidsoap `< 1.3.0` out of the box. If you install a current version of liquidsoap [using OPAM](https://www.liquidsoap.info/) or through the [Rabe Liquidsoap Distribution for CentOS (RaBe LSD)](https://build.opensuse.org/project/show/home:radiorabe:liquidsoap) you will most likely have liquidsoap `1.3.2` or `1.3.3` installed.
LibreTime currently only supports liquidsoap `< 1.3.0` out of the box. If you install a current version of liquidsoap [using OPAM](https://www.liquidsoap.info/) or through the [Rabe Liquidsoap Distribution for CentOS (RaBe LSD)](https://build.opensuse.org/project/show/home:radiorabe:liquidsoap) you will most likely have liquidsoap `1.3.2` or `1.3.3` installed.
#352 reports that liquidsoap `< 1.3.0` can exhibit issues on Debian Stretch installs. One fix for the issue is to install liquidsoap `1.3.0` and to use the following patching steps.

View File

@ -0,0 +1,280 @@
---
title: LibreTime 3.0.0 alpha 13
---
import ReleaseHead from './\_release-head.md';
<ReleaseHead date='TODO' version='3.0.0-alpha.13'/>
## :sparkling_heart: Contributors
The LibreTime project wants to thank the following contributors for authoring PRs to this release:
- @jooola
- @paddatrapper
- rinka
- Maxime Leroy
- Mykola
## :rocket: Features
- remove unused python3-venv package ([#1728](https://github.com/libretime/libretime/issues/1728))
- **api:** split api into multiple apps ([#1626](https://github.com/libretime/libretime/issues/1626))
- improve apache configuration ([#1784](https://github.com/libretime/libretime/issues/1784))
- **api:** replace uwsgi with gunicorn ([#1785](https://github.com/libretime/libretime/issues/1785))
- replace exploded base\_\* with public_url
- **shared:** compress logs with gz ([#1827](https://github.com/libretime/libretime/issues/1827))
- **shared:** remove unused abstract app ([#1828](https://github.com/libretime/libretime/issues/1828))
- replace click envar with auto_envvar_prefix ([#1829](https://github.com/libretime/libretime/issues/1829))
- **shared:** allow to disable log rotate/retention
- **legacy:** change logrotate config deploy path
- rotate logs using libretime user
- **legacy:** improve rabbitmq check ([#1839](https://github.com/libretime/libretime/issues/1839))
- **worker:** don't run with a dedicated user
- **playout:** remove unused liquidsoap_prepare_terminate.py ([#1854](https://github.com/libretime/libretime/issues/1854))
- **legacy:** check services using systemctl ([#1856](https://github.com/libretime/libretime/issues/1856))
- change config file format to yaml
- change config filename to config.yml
- change config dir path to /etc/libretime
- **installer:** rewrite install script
- replace php migration with django migration
- drop cc_locale table
- **api:** create set_icecast_passwords command
- **installer:** post install setup instructions
- add systemd libretime.target
- move allowed cors url to configuration file
- remove php web installer
- move storage path setting to configuration file
- **installer:** rename shared files path to /usr/share/libretime
- **shared:** add config trailing slash sanitizer ([#1870](https://github.com/libretime/libretime/issues/1870))
- rename default stream mount point to main
- **api:** rename user model fields ([#1902](https://github.com/libretime/libretime/issues/1902))
- remove unused cc_sess table ([#1907](https://github.com/libretime/libretime/issues/1907))
- remove unused cc_perms table ([#1909](https://github.com/libretime/libretime/issues/1909))
- **api:** rename podcasts models fields ([#1910](https://github.com/libretime/libretime/issues/1910))
- **analyzer:** move compute_md5 to shared library
- **api:** create bulk_import command
- **legacy:** compute md5 during early upload
- **api:** rename track type to library
- **legacy:** add Ukrainian language
- **legacy:** don't guess cors url from server
- **installer:** load .env file to persistent install config
- use dedicated 'libretime' user
- replace apache2 with nginx + php-fpm
- **api:** listen on unix socket with gunicorn
- **api:** use uvicorn as asgi server with gunicorn
- set default locale to en_US
- remove unused cc_country table
## :bug: Bug fixes
- add gettext for legacy locale generation ([#1720](https://github.com/libretime/libretime/issues/1720))
- **installer:** install software-properties-common when required
- **installer:** always install fresh packages
- **api:** prevent timing attacke on api key ([#1771](https://github.com/libretime/libretime/issues/1771))
- **legacy:** load vendors during config init
- **legacy:** bypass config validation during django migration
- **legacy:** the ini config parser requires a .conf ext
- **playout:** disable playout-notify log rotation
- don't set log folder permissions recursively
- **shared:** allow list settings ([#1837](https://github.com/libretime/libretime/issues/1837))
- **legacy:** station url always has a trailing slash ([#1838](https://github.com/libretime/libretime/issues/1838))
- **legacy:** check if libretime-api is running ([#1841](https://github.com/libretime/libretime/issues/1841))
- don't add track types only on migration
- correct cc_file.artwork column size
- **legacy:** remove not null constraint when using default
- **api:** missing build-essential to build psycopg2
- drop unused sequences
- **api:** allow updating default_icecast_password ([#1872](https://github.com/libretime/libretime/issues/1872))
- **deps:** update dependency [@cmfcmf](https://github.com/cmfcmf)/docusaurus-search-local to ^0.11.0 ([#1873](https://github.com/libretime/libretime/issues/1873))
- **legacy:** remove file directory metadata ([#1887](https://github.com/libretime/libretime/issues/1887))
- **api:** update model fields in set_icecast_passwords ([#1903](https://github.com/libretime/libretime/issues/1903))
- **api:** cascade when dropping table ([#1908](https://github.com/libretime/libretime/issues/1908))
- **legacy:** station-metadata api endpoint
- **legacy:** don't log 'could not obtain lock' exception ([#1943](https://github.com/libretime/libretime/issues/1943))
- **legacy:** check empty before iteration on files
- use constrained foreign key for files track_type
- **deps:** update dependency mermaid to v9.1.2 [security] ([#1948](https://github.com/libretime/libretime/issues/1948))
- **installer:** update version file unless tarball ([#1950](https://github.com/libretime/libretime/issues/1950))
- prevent data loose on track_types_id migration ([#1949](https://github.com/libretime/libretime/issues/1949))
- use track_type_id in smartblock criteria
- **legacy:** no invalid track type in smartblock criteria
## :fire: Deprecation and removal
### Allowed CORS origins configuration location
The allowed CORS origins configuration moved from the database to the configuration file. The field in the general preference form is deprecated and will be removed in the next release. Be sure to move your allowed CORS origins configuration to the [configuration file](../admin-manual/setup/configuration.md).
## :arrow_up: Before upgrading
:::caution
Please run this **before the upgrade procedure**!
:::
### Repair broken track types
The database files track type field was previously not constrained and this might have lead to files referencing a now renamed or missing track type. To preserve as much data as possible during the database migration process, you need to check whether some files have broken or missing track type references and fix them accordingly. To list broken track type references, you can run the following command:
```bash
sudo -u www-data libretime-api dbshell --command="
SELECT f.id, f.track_type, f.track_title, f.artist_name, f.filepath
FROM cc_files f
WHERE NOT EXISTS (
SELECT FROM cc_track_types tt
WHERE tt.code = f.track_type
)
AND f.track_type IS NOT NULL
AND f.track_type <> '';"
```
If the above command outputs the following, no file needs fixing.
```
id | track_type | track_title | artist_name | filepath
----+------------+-------------+-------------+----------
(0 rows)
```
In addition, the database smart block criteria value was previously referencing track types using codes, and should now reference track types using ids. You need to check whether some smart block have broken track type references and fix them accordingly. To list broken track type references, you can run the following command:
```bash
sudo -u www-data libretime-api dbshell --command="
SELECT b.name, c.criteria, c.modifier, c.value
FROM cc_blockcriteria c, cc_block b
WHERE c.block_id = b.id
AND NOT EXISTS (
SELECT FROM cc_track_types tt
WHERE tt.code = c.value
)
AND criteria = 'track_type';"
```
If the above command outputs the following, no smart block needs fixing.
```
name | criteria | modifier | value
------+----------+----------+-------
(0 rows)
```
### New configuration file
The configuration file name changed from `airtime.conf` to `config.yml`. Please rename your configuration file using the following command:
```bash
sudo mv /etc/airtime/airtime.conf /etc/airtime/config.yml
```
The configuration directory changed from `/etc/airtime` to `/etc/libretime`. Please rename your configuration directory using the following command:
```bash
sudo mv /etc/airtime /etc/libretime
```
The configuration file format changed to `yml` and the configuration schema changed. Please rewrite your [configuration file](../admin-manual/setup/configuration.md) using the [yaml format](https://yaml.org/). An example configuration file `installer/config.yml` is present in the sources.
The `general` section has been changed:
- the `general.protocol`, `general.base_url`, `general.base_port`, `general.base_dir` and `general.force_ssl` entries were replaced with a single `general.public_url` entry, be sure to use a valid url with the new configuration entry.
A new `storage` section has been added:
- the `storage.path` entry was added to move the storage configuration from the database to the configuration file, be sure to edit your configuration with the path to your storage. The default storage path value is `/srv/libretime`.
### Nginx, Apache and PHP
The `apache2` web server has been replaced with `nginx` and `php-fpm`, be sure to uninstall `apache2` and clean related configuration files:
```bash
sudo rm -f /etc/apache2/sites-*/{airtime,libretime}*
sudo rm -f /etc/php/*/apache2/conf.d/{airtime,libretime}*
sudo apt purge 'apache2' 'libapache2-mod-php*'
sudo find /var/lib/php/sessions -name 'sess_*' -delete
```
### Shared files path
The shared files path changed from `/usr/share/airtime` to `/usr/share/libretime`. The directory must be renamed:
```bash
sudo mv /usr/share/airtime /usr/share/libretime
```
### Systemd services path
The systemd services path changed from `/etc/systemd/system/libretime*` to `/usr/lib/systemd/system/libretime*`. The services must be moved:
```bash
sudo mv /etc/systemd/system/libretime* /usr/lib/systemd/system/
sudo systemctl daemon-reload
```
### Replaced uWSGI with Gunicorn
[uWSGI](https://uwsgi-docs.readthedocs.io) was replaced by [Gunicorn](https://gunicorn.org/), the packages and configuration file should be removed from the system:
```bash
# Remove the configuration file
sudo rm -f /etc/{airtime,libretime}/libretime-api.ini
# Remove the packages
sudo apt purge \
uwsgi \
uwsgi-plugin-python3
```
### Logrotate config filepath
The legacy logrotate config filepath was changed from `/etc/logrotate.d/airtime-php` to `/etc/logrotate.d/libretime-legacy`. The old configuration file must be removed:
```bash
# Remove the configuration file
sudo rm -f /etc/logrotate.d/airtime-php
```
### Worker user
The worker service no longer uses a dedicated `celery` user to run. The old `celery` user can be removed from the system:
```bash
# Remove the celery user
sudo deluser celery
```
## :arrow_up: Upgrading
### New installer
:::warning
Please be careful when running this new installer, it might not be bug free.
:::
The [bash installer](../admin-manual/setup/install.md#run-the-installer) has been rewritten, the flags and options changed, please run `./install --help` to get more details.
### LibreTime user
The LibreTime services now run using a dedicated `libretime` user instead of the default `www-data` user. Be sure to change the ownership of the LibreTime files:
```bash
# Configuration directory
sudo chown -R libretime:libretime /etc/libretime
# Logs directory
sudo chown -R libretime:libretime /var/log/libretime
# Runtime directory
sudo chown -R libretime:libretime /var/lib/libretime
# Storage directory
sudo chown -R libretime:libretime /srv/libretime
```
## :warning: Known issues
The following issues may need a workaround for the time being. Please search the [issues](https://github.com/libretime/libretime/issues) before reporting problems not listed below.
## :memo: Colophon

View File

@ -26,9 +26,14 @@ configured in the LibreTime **Streams** page, on LibreTime's **System** menu.
## B.U.T.T. (Broadcast Using This Tool)
<html>
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/4GLsU9hPTtM" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</html>
<iframe
width="560"
height="315"
src="https://www.youtube-nocookie.com/embed/4GLsU9hPTtM"
frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
></iframe>
### Setup

View File

@ -311,7 +311,7 @@ sudo nano /etc/cron.d/libretime-schedule
containing the line:
```
* * * * * www-data /usr/local/bin/libretime-schedule.sh
* * * * * libretime /usr/local/bin/libretime-schedule.sh
```
The schedule server will now be serving the same show information as the LibreTime server, with a cache lifetime of one minute. You can adjust the cache lifetime by altering the frequency of the cron job that polls the LibreTime server.

View File

@ -14,9 +14,14 @@ Podcast feeds coming from Anchor.fm have been known to have a similar issue.
The podcast interfaces provides you with the ability to generate [Smartblocks](./playlists.md) that can be used in conjunction with autoloading playlists to schedule the newest episode of a podcast without human intervention.
<html>
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/g-4UcD8qvR8" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</html>
<iframe
width="560"
height="315"
src="https://www.youtube-nocookie.com/embed/g-4UcD8qvR8"
frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
></iframe>
### Podcasts dashboard

View File

@ -25,7 +25,7 @@ LibreTime expects file tag metadata to be stored in the international _UTF-8_ ch
The program **mid3iconv** (part of the **python-mutagen** package in Debian and Ubuntu) can be used to batch convert the metadata character set of files on the command line. You can install **python-mutagen** with the `sudo apt-get install python-mutagen`.
<span id="Convert_MP3_Tags_using_mid3iconv" class="mw-headline"> For example, to preview the conversion of tags from Windows-1251 </span><span id="Convert_MP3_Tags_using_mid3iconv" class="mw-headline">(CP1251)</span><span id="Convert_MP3_Tags_using_mid3iconv" class="mw-headline"> character set to UTF-8 for a whole archive of MP3 files, you could use the command: </span>
For example, to preview the conversion of tags from Windows-1251 (CP1251) character set to UTF-8 for a whole archive of MP3 files, you could use the command:
```bash
find . -name "*.mp3" -print0 | xargs -0 mid3iconv -e CP1251 -d -p

Some files were not shown because too many files have changed in this diff Show More