feat(installer): rewrite install script
- remove unused root packages.ini - write config to yaml file - allow to set public_url during install - force icecast start right after package install - move config file in place at the end of installation BREAKING CHANGE: The bash installer has been rewritten, the flags and options changed, please run `./install --help` to get more details.
This commit is contained in:
parent
aed6d2f294
commit
ee98387264
|
@ -72,16 +72,15 @@ Vagrant.configure('2') do |config|
|
|||
path: 'installer/vagrant/%s' % prepare_script
|
||||
|
||||
$script = <<-SCRIPT
|
||||
set -e
|
||||
cd /vagrant
|
||||
./install \
|
||||
--force \
|
||||
|
||||
bash install \
|
||||
--listen-port 8080 \
|
||||
--allow-restart \
|
||||
--in-place \
|
||||
--verbose \
|
||||
--postgres \
|
||||
--apache \
|
||||
--icecast \
|
||||
--web-port=8080 \
|
||||
#{install_args}
|
||||
http://192.168.10.100:8080
|
||||
|
||||
SCRIPT
|
||||
|
||||
config.vm.provision 'install', type: 'shell', inline: $script
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
Description=LibreTime Media Analyzer Service
|
||||
|
||||
[Service]
|
||||
Environment=LIBRETIME_LOG_FILEPATH=/var/log/libretime/analyzer.log
|
||||
Environment=LIBRETIME_CONFIG_FILEPATH=/etc/libretime/config.yml
|
||||
WorkingDirectory=/var/lib/libretime/analyzer
|
||||
Environment=LIBRETIME_LOG_FILEPATH=@@LOG_DIR@@/analyzer.log
|
||||
Environment=LIBRETIME_CONFIG_FILEPATH=@@CONFIG_FILEPATH@@
|
||||
WorkingDirectory=@@WORKING_DIR@@/analyzer
|
||||
|
||||
ExecStart=/usr/local/bin/libretime-analyzer
|
||||
User=libretime-analyzer
|
||||
|
|
|
@ -6,8 +6,8 @@ Type=notify
|
|||
KillMode=mixed
|
||||
PrivateTmp=true
|
||||
|
||||
Environment=LIBRETIME_LOG_FILEPATH=/var/log/libretime/api.log
|
||||
Environment=LIBRETIME_CONFIG_FILEPATH=/etc/libretime/config.yml
|
||||
Environment=LIBRETIME_LOG_FILEPATH=@@LOG_DIR@@/api.log
|
||||
Environment=LIBRETIME_CONFIG_FILEPATH=@@CONFIG_FILEPATH@@
|
||||
|
||||
ExecStart=/usr/bin/gunicorn \
|
||||
--workers 4 \
|
||||
|
|
|
@ -38,7 +38,7 @@ The configuration directory changed from `/etc/airtime` to `/etc/libretime`. Ple
|
|||
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/).
|
||||
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.
|
||||
|
||||
### Apache and PHP configuration files
|
||||
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
# See https://libretime.org/docs/admin-manual/setup/configuration/
|
||||
|
||||
general:
|
||||
# The public url, this field is REQUIRED
|
||||
public_url:
|
||||
# The internal API authentication key, this field is REQUIRED
|
||||
api_key:
|
||||
|
||||
# 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
|
||||
|
||||
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: libretime
|
||||
|
||||
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: libretime
|
||||
|
||||
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 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 256
|
||||
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
|
|
@ -1,92 +0,0 @@
|
|||
# See https://libretime.org/docs/setup/configuration
|
||||
#
|
||||
# ----------------------------------------------------------------------
|
||||
# G E N E R A L S E T T I N G S
|
||||
# ----------------------------------------------------------------------
|
||||
[general]
|
||||
# The public url, this field is REQUIRED
|
||||
public_url =
|
||||
# The internal API authentication key, this field is REQUIRED
|
||||
api_key =
|
||||
|
||||
# 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
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# D A T A B A S E
|
||||
# ----------------------------------------------------------------------
|
||||
[database]
|
||||
# The hostname of the PostgreSQL server, default is localhost
|
||||
host = localhost
|
||||
# The port of the PostgreSQL server, default is 5432
|
||||
port = 5432
|
||||
# The name of the PostgreSQL database, default is libretime
|
||||
name = airtime
|
||||
# The username of the PostgreSQL user, default is libretime
|
||||
user = airtime
|
||||
# The password of the PostgreSQL user, default is libretime
|
||||
password = airtime
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# RABBITMQ
|
||||
# ----------------------------------------------------------------------
|
||||
[rabbitmq]
|
||||
# The 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 = /airtime
|
||||
# The username of the RabbitMQ user, default is libretime
|
||||
user = airtime
|
||||
# The password of the RabbitMQ user, default is libretime
|
||||
password = airtime
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# PLAYOUT
|
||||
# ----------------------------------------------------------------------
|
||||
[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 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 256
|
||||
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
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# L D A P
|
||||
# ----------------------------------------------------------------------
|
||||
[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'
|
|
@ -1,5 +1,5 @@
|
|||
/var/log/libretime/legacy.log {
|
||||
su www-data www-data
|
||||
@@LOG_DIR@@/legacy.log {
|
||||
su @@USER@@ @@USER@@
|
||||
compress
|
||||
rotate 10
|
||||
size 1000k
|
||||
|
|
15
packages.ini
15
packages.ini
|
@ -1,15 +0,0 @@
|
|||
# This file contains a list of package dependencies.
|
||||
[common]
|
||||
icecast2 = buster, bullseye, bionic, focal
|
||||
postgresql = buster, bullseye, bionic, focal
|
||||
postgresql-client = buster, bullseye, bionic, focal
|
||||
rabbitmq-server = buster, bullseye, bionic, focal
|
||||
|
||||
curl = buster, bullseye, bionic, focal
|
||||
|
||||
[composer]
|
||||
unzip = buster, bullseye, bionic, focal
|
||||
|
||||
[installer]
|
||||
lsb-release = buster, bullseye, bionic, focal
|
||||
xmlstarlet = buster, bullseye, bionic, focal
|
|
@ -1,5 +1,5 @@
|
|||
/var/log/libretime/liquidsoap.log {
|
||||
su www-data www-data
|
||||
@@LOG_DIR@@/liquidsoap.log {
|
||||
su @@USER@@ @@USER@@
|
||||
compress
|
||||
rotate 10
|
||||
size 1000k
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
[Unit]
|
||||
Description=Libretime Liquidsoap Service
|
||||
Description=LibreTime Liquidsoap Service
|
||||
|
||||
[Service]
|
||||
Environment=LIBRETIME_LOG_FILEPATH=/var/log/libretime/liquidsoap.log
|
||||
Environment=LIBRETIME_CONFIG_FILEPATH=/etc/libretime/config.yml
|
||||
WorkingDirectory=/var/lib/libretime/playout
|
||||
Environment=LIBRETIME_LOG_FILEPATH=@@LOG_DIR@@/liquidsoap.log
|
||||
Environment=LIBRETIME_CONFIG_FILEPATH=@@CONFIG_FILEPATH@@
|
||||
WorkingDirectory=@@WORKING_DIR@@/playout
|
||||
|
||||
ExecStart=/usr/local/bin/libretime-liquidsoap
|
||||
User=libretime-playout
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
[Unit]
|
||||
Description=Libretime Playout Service
|
||||
After=network-online.target
|
||||
Description=LibreTime Playout Service
|
||||
|
||||
[Service]
|
||||
Environment=LIBRETIME_LOG_FILEPATH=/var/log/libretime/playout.log
|
||||
Environment=LIBRETIME_CONFIG_FILEPATH=/etc/libretime/config.yml
|
||||
WorkingDirectory=/var/lib/libretime/playout
|
||||
Environment=LIBRETIME_LOG_FILEPATH=@@LOG_DIR@@/playout.log
|
||||
Environment=LIBRETIME_CONFIG_FILEPATH=@@CONFIG_FILEPATH@@
|
||||
WorkingDirectory=@@WORKING_DIR@@/playout
|
||||
|
||||
ExecStart=/usr/local/bin/libretime-playout
|
||||
User=libretime-pypo
|
||||
Group=libretime-pypo
|
||||
User=libretime-playout
|
||||
Group=libretime-playout
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
Description=LibreTime Worker Service
|
||||
|
||||
[Service]
|
||||
Environment=LIBRETIME_LOG_FILEPATH=/var/log/libretime/worker.log
|
||||
Environment=LIBRETIME_CONFIG_FILEPATH=/etc/libretime/config.yml
|
||||
WorkingDirectory=/var/lib/libretime/worker
|
||||
Environment=LIBRETIME_LOG_FILEPATH=@@LOG_DIR@@/worker.log
|
||||
Environment=LIBRETIME_CONFIG_FILEPATH=@@CONFIG_FILEPATH@@
|
||||
WorkingDirectory=@@WORKING_DIR@@/worker
|
||||
|
||||
ExecStart=/usr/bin/sh -c 'celery worker \
|
||||
--app=libretime_worker.tasks:worker \
|
||||
|
|
Loading…
Reference in New Issue