libretime/docs/releases/3.0.0-alpha.13.md

279 lines
12 KiB
Markdown
Raw Permalink Normal View History

2022-07-15 12:24:53 +02:00
---
title: LibreTime 3.0.0 alpha 13
---
import ReleaseHead from './\_release-head.md';
2022-07-15 14:03:36 +02:00
<ReleaseHead date='2022-07-15' version='3.0.0-alpha.13'/>
2022-07-15 12:24:53 +02:00
## :sparkling_heart: Contributors
The LibreTime project wants to thank the following contributors for authoring PRs to this release:
- @jooola
- @paddatrapper
- rinka
- Maxime Leroy
- Mykola
<!-- vale off -->
2022-07-15 12:24:53 +02:00
## :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
<!-- vale on -->
2022-07-15 12:24:53 +02:00
## :fire: Deprecation and removal
### Allowed CORS origins configuration location
2023-04-21 11:46:30 +02:00
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/configuration.md).
2022-07-15 12:24:53 +02:00
## :arrow_up: Before upgrading
:::caution
Please run this **before the upgrade procedure**.
2022-07-15 12:24:53 +02:00
:::
### 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
```
2023-04-21 11:46:30 +02:00
The configuration file format changed to `yml` and the configuration schema changed. Please rewrite your [configuration file](../admin-manual/configuration.md) using the [yaml format](https://yaml.org/). An example configuration file `installer/config.yml` is present in the sources.
2022-07-15 12:24:53 +02:00
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.
:::
2023-04-21 11:50:37 +02:00
The [bash installer](../admin-manual/install/README.md#run-the-installer) has been rewritten, the flags and options changed, please run `./install --help` to get more details.
2022-07-15 12:24:53 +02:00
### 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
```