feat: change config filename to config.yml
BREAKING: The configuration file name changed from `airtime.conf` to `config.yml`. Please rename your configuration file accordingly.
This commit is contained in:
parent
e4439390fe
commit
604ff20239
|
@ -3,7 +3,7 @@ Description=LibreTime Media Analyzer Service
|
|||
|
||||
[Service]
|
||||
Environment=LIBRETIME_LOG_FILEPATH=/var/log/libretime/analyzer.log
|
||||
Environment=LIBRETIME_CONFIG_FILEPATH=/etc/airtime/airtime.conf
|
||||
Environment=LIBRETIME_CONFIG_FILEPATH=/etc/airtime/config.yml
|
||||
WorkingDirectory=/var/lib/libretime/analyzer
|
||||
|
||||
ExecStart=/usr/local/bin/libretime-analyzer
|
||||
|
|
|
@ -19,7 +19,7 @@ post_file() {
|
|||
file_path="${stripped_file_path}"
|
||||
# filename="${file_path##*/}"
|
||||
|
||||
airtime_conf_path=/etc/airtime/airtime.conf
|
||||
airtime_conf_path=/etc/airtime/config.yml
|
||||
|
||||
#instance_path will look like 1/1384, for example
|
||||
http_path=$(grep base_url ${airtime_conf_path} | awk '{print $3;}')
|
||||
|
|
|
@ -125,7 +125,7 @@ class AirtimeApiClient:
|
|||
UPLOAD_RETRIES = 3
|
||||
UPLOAD_WAIT = 60
|
||||
|
||||
def __init__(self, logger=None, config_path="/etc/airtime/airtime.conf"):
|
||||
def __init__(self, logger=None, config_path="/etc/airtime/config.yml"):
|
||||
self.logger = logger or logging
|
||||
|
||||
config = Config(filepath=config_path)
|
||||
|
|
|
@ -37,7 +37,7 @@ api_endpoints["file_download_url"] = "files/{id}/download/"
|
|||
class AirtimeApiClient:
|
||||
API_BASE = "/api/v2"
|
||||
|
||||
def __init__(self, logger=None, config_path="/etc/airtime/airtime.conf"):
|
||||
def __init__(self, logger=None, config_path="/etc/airtime/config.yml"):
|
||||
self.logger = logger or logging
|
||||
|
||||
config = Config(filepath=config_path)
|
||||
|
|
|
@ -7,7 +7,7 @@ from libretime_api_client.version2 import AirtimeApiClient
|
|||
|
||||
@pytest.fixture()
|
||||
def config_filepath(tmp_path: Path):
|
||||
filepath = tmp_path / "airtime.conf"
|
||||
filepath = tmp_path / "config.yml"
|
||||
filepath.write_text(
|
||||
"""
|
||||
general:
|
||||
|
|
|
@ -7,7 +7,7 @@ KillMode=mixed
|
|||
PrivateTmp=true
|
||||
|
||||
Environment=LIBRETIME_LOG_FILEPATH=/var/log/libretime/api.log
|
||||
Environment=LIBRETIME_CONFIG_FILEPATH=/etc/airtime/airtime.conf
|
||||
Environment=LIBRETIME_CONFIG_FILEPATH=/etc/airtime/config.yml
|
||||
|
||||
ExecStart=/usr/bin/gunicorn \
|
||||
--workers 4 \
|
||||
|
|
|
@ -7,7 +7,7 @@ import sys
|
|||
def main():
|
||||
"""Run administrative tasks."""
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "libretime_api.settings.prod")
|
||||
os.environ.setdefault("LIBRETIME_CONFIG_FILEPATH", "/etc/airtime/airtime.conf")
|
||||
os.environ.setdefault("LIBRETIME_CONFIG_FILEPATH", "/etc/airtime/config.yml")
|
||||
try:
|
||||
from django.core.management import execute_from_command_line
|
||||
except ImportError as exc:
|
||||
|
|
|
@ -58,7 +58,7 @@ 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/airtime/config.yml`. The default file has the following values you need to change.
|
||||
|
||||
```yml
|
||||
#
|
||||
|
@ -99,7 +99,7 @@ ldap:
|
|||
|
||||
### 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`:
|
||||
|
||||
```yml
|
||||
general:
|
||||
|
|
|
@ -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/airtime/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/airtime/config.yml` file with the new password.
|
||||
|
|
|
@ -3,7 +3,7 @@ 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.
|
||||
To configure LibreTime, you need to edit the `/etc/airtime/config.yml` file. This page describe the available options to configure your installation.
|
||||
|
||||
## General
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ On a common setup, to access LibreTime specific logs you should search for the f
|
|||
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
|
||||
sudo -u www-data libretime-analyzer --config /etc/airtime/config.yml --log-level debug
|
||||
```
|
||||
|
||||
The `/var/log/apache2/libretime.error.log` file contains logs from the web server.
|
||||
|
|
|
@ -26,6 +26,12 @@ 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 file format changed to `yml`. Please rewrite your [configuration file](../admin-manual/setup/configuration.md) using the [yaml format](https://yaml.org/).
|
||||
|
||||
### Apache and PHP configuration files
|
||||
|
|
|
@ -13,7 +13,7 @@ resources.modules[] = ""
|
|||
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
|
||||
resources.modules[] = ""
|
||||
resources.view[] =
|
||||
; These are no longer needed. They are specified in /etc/airtime/airtime.conf:
|
||||
; These are no longer needed. They are specified in /etc/airtime/config.yml:
|
||||
;resources.db.adapter = "Pdo_Pgsql"
|
||||
;resources.db.params.charset = "utf8"
|
||||
;resources.db.params.host = "localhost"
|
||||
|
|
|
@ -22,7 +22,7 @@ define('LIBRETIME_LOG_FILEPATH', getenv('LIBRETIME_LOG_FILEPATH') ?: LIBRETIME_L
|
|||
|
||||
define('LIBRETIME_CONFIG_DIR', getenv('LIBRETIME_CONFIG_DIR') ?: '/etc/airtime');
|
||||
define('LIBRETIME_CONF_DIR', LIBRETIME_CONFIG_DIR); // Deprecated
|
||||
define('LIBRETIME_CONFIG_FILEPATH', getenv('LIBRETIME_CONFIG_FILEPATH') ?: LIBRETIME_CONFIG_DIR . '/airtime.conf');
|
||||
define('LIBRETIME_CONFIG_FILEPATH', getenv('LIBRETIME_CONFIG_FILEPATH') ?: LIBRETIME_CONFIG_DIR . '/config.yml');
|
||||
|
||||
// Installer
|
||||
define('INSTALLER_CONFIG_FILEPATH', LIBRETIME_CONFIG_DIR . '/airtime.temp.conf');
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
?>">
|
||||
Make sure you aren't missing any of the Postgres dependencies in the table above.
|
||||
If your dependencies check out, make sure your database configuration settings in
|
||||
<code>/etc/airtime.conf</code> are correct and the LibreTime database was installed correctly.
|
||||
<code>/etc/airtime/config.yml</code> are correct and the LibreTime database was installed correctly.
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
@ -81,7 +81,7 @@
|
|||
<?php
|
||||
} else {
|
||||
?>">
|
||||
Make sure RabbitMQ is installed correctly, and that your settings in /etc/airtime/airtime.conf
|
||||
Make sure RabbitMQ is installed correctly, and that your settings in /etc/airtime/config.yml
|
||||
are correct. Try using <code>sudo rabbitmqctl list_users</code> and <code>sudo rabbitmqctl list_vhosts</code>
|
||||
to see if the airtime user (or your custom RabbitMQ user) exists, then checking that
|
||||
<code>sudo rabbitmqctl list_exchanges</code> contains entries for airtime-analyzer, airtime-pypo,
|
||||
|
|
|
@ -55,8 +55,8 @@ class MediaSetup extends Setup
|
|||
|
||||
/*
|
||||
* If we're upgrading from an old Airtime instance (pre-2.5.2) we rename their old
|
||||
* airtime.conf to airtime.conf.tmp during the setup process. Now that we're done,
|
||||
* we can rename it to airtime.conf.bak to avoid confusion.
|
||||
* config.yml to config.yml.tmp during the setup process. Now that we're done,
|
||||
* we can rename it to config.yml.bak to avoid confusion.
|
||||
*/
|
||||
$fileName = LIBRETIME_CONFIG_FILEPATH;
|
||||
$tmpFile = $fileName . '.tmp';
|
||||
|
@ -65,7 +65,7 @@ class MediaSetup extends Setup
|
|||
rename($tmpFile, $bakFile);
|
||||
}
|
||||
} else {
|
||||
self::$message = "Failed to move airtime.conf; /etc/airtime doesn't exist!";
|
||||
self::$message = "Failed to move config.yml; /etc/airtime doesn't exist!";
|
||||
self::$errors[] = 'ERR';
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ class MediaSetup extends Setup
|
|||
}
|
||||
|
||||
/**
|
||||
* Moves /tmp/airtime.temp.conf to /etc/airtime.conf and then removes it to complete setup.
|
||||
* Moves /tmp/airtime.temp.conf to /etc/airtime/config.yml and then removes it to complete setup.
|
||||
*
|
||||
* @return bool false if either of the copy or removal operations fail
|
||||
*/
|
||||
|
|
|
@ -10,10 +10,10 @@
|
|||
*/
|
||||
class RabbitMQSetup extends Setup
|
||||
{
|
||||
// airtime.conf section header
|
||||
// config.yml section header
|
||||
protected static $_section = '[rabbitmq]';
|
||||
|
||||
// Array of key->value pairs for airtime.conf
|
||||
// Array of key->value pairs for config.yml
|
||||
protected static $_properties;
|
||||
|
||||
// Constant form field names for passing errors back to the front-end
|
||||
|
|
|
@ -14,7 +14,7 @@ abstract class Setup
|
|||
protected static $_section;
|
||||
|
||||
/**
|
||||
* Array of key->value pairs for airtime.conf.
|
||||
* Array of key->value pairs for config.yml.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
|
@ -51,7 +51,7 @@ abstract class Setup
|
|||
}
|
||||
|
||||
if (substr(trim($line), 0, 1) == '#') {
|
||||
/* Workaround to strip comments from airtime.conf.
|
||||
/* Workaround to strip comments from config.yml.
|
||||
* We need to do this because python's ConfigObj and PHP
|
||||
* have different (and equally strict) rules about comment
|
||||
* characters in configuration files.
|
||||
|
@ -123,8 +123,8 @@ require_once 'general-setup.php';
|
|||
|
||||
require_once 'media-setup.php';
|
||||
|
||||
// If airtime.conf exists, we shouldn't be here
|
||||
if (!file_exists('/etc/airtime/airtime.conf')) {
|
||||
// If config.yml exists, we shouldn't be here
|
||||
if (!file_exists('/etc/airtime/config.yml')) {
|
||||
if (isset($_GET['obj']) && $objType = $_GET['obj']) {
|
||||
$obj = new $objType($_POST);
|
||||
if ($obj instanceof Setup) {
|
||||
|
|
|
@ -48,8 +48,8 @@ class AirtimeInstall
|
|||
} catch (PropelException $e) {
|
||||
return null;
|
||||
}
|
||||
if (file_exists('/etc/airtime/airtime.conf')) {
|
||||
$values = parse_ini_file('/etc/airtime/airtime.conf', true);
|
||||
if (file_exists('/etc/airtime/config.yml')) {
|
||||
$values = parse_ini_file('/etc/airtime/config.yml', true);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ Description=Libretime Liquidsoap Service
|
|||
|
||||
[Service]
|
||||
Environment=LIBRETIME_LOG_FILEPATH=/var/log/libretime/liquidsoap.log
|
||||
Environment=LIBRETIME_CONFIG_FILEPATH=/etc/airtime/airtime.conf
|
||||
Environment=LIBRETIME_CONFIG_FILEPATH=/etc/airtime/config.yml
|
||||
WorkingDirectory=/var/lib/libretime/playout
|
||||
|
||||
ExecStart=/usr/local/bin/libretime-liquidsoap
|
||||
|
|
|
@ -4,7 +4,7 @@ After=network-online.target
|
|||
|
||||
[Service]
|
||||
Environment=LIBRETIME_LOG_FILEPATH=/var/log/libretime/playout.log
|
||||
Environment=LIBRETIME_CONFIG_FILEPATH=/etc/airtime/airtime.conf
|
||||
Environment=LIBRETIME_CONFIG_FILEPATH=/etc/airtime/config.yml
|
||||
WorkingDirectory=/var/lib/libretime/playout
|
||||
|
||||
ExecStart=/usr/local/bin/libretime-playout
|
||||
|
|
|
@ -15,7 +15,7 @@ Each instance of airtime-celery has its own worker, and multiple instances can b
|
|||
To debug, you can run celery directly from the command line:
|
||||
|
||||
```sh
|
||||
RMQ_CONFIG_FILE=${LIBRETIME_CONF_DIR}/airtime.conf celery -A libretime_worker.tasks worker --loglevel=info
|
||||
RMQ_CONFIG_FILE=${LIBRETIME_CONF_DIR}/config.yml celery -A libretime_worker.tasks worker --loglevel=info
|
||||
```
|
||||
|
||||
This worker can be run alongside the service without issue.
|
||||
|
@ -46,6 +46,6 @@ If you run into issues getting Celery to accept tasks from Airtime:
|
|||
|
||||
1. Make sure Celery is running ($ sudo service airtime-celery status).
|
||||
2. Check the log file (/var/log/airtime/airtime-celery[-DEV_ENV].log) to make sure Celery started correctly.
|
||||
3. Check your $LIBRETIME_CONF_DIR/airtime.conf rabbitmq settings. Make sure the settings here align with $LIBRETIME_CONF_DIR/$ENVIRONMENT/rabbitmq.ini.
|
||||
3. Check your $LIBRETIME_CONF_DIR/config.yml rabbitmq settings. Make sure the settings here align with $LIBRETIME_CONF_DIR/$ENVIRONMENT/rabbitmq.ini.
|
||||
4. Check RabbitMQ to make sure the celeryresults and task queues were created in the correct vhost.
|
||||
5. Make sure the RabbitMQ user (the default is airtime) has permissions on all vhosts being used.
|
||||
|
|
|
@ -3,7 +3,7 @@ Description=LibreTime Worker Service
|
|||
|
||||
[Service]
|
||||
Environment=LIBRETIME_LOG_FILEPATH=/var/log/libretime/worker.log
|
||||
Environment=LIBRETIME_CONFIG_FILEPATH=/etc/airtime/airtime.conf
|
||||
Environment=LIBRETIME_CONFIG_FILEPATH=/etc/airtime/config.yml
|
||||
WorkingDirectory=/var/lib/libretime/worker
|
||||
|
||||
ExecStart=/usr/bin/sh -c 'celery worker \
|
||||
|
|
Loading…
Reference in New Issue