From d2ffb6d91d860e21cb1c5fe4a00f3dbdcd0d0006 Mon Sep 17 00:00:00 2001 From: Lucas Bickel Date: Mon, 13 Mar 2017 14:10:03 +0100 Subject: [PATCH 1/3] Add missing packages --- installer/vagrant/centos.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/installer/vagrant/centos.sh b/installer/vagrant/centos.sh index 199456273..3b8700f57 100644 --- a/installer/vagrant/centos.sh +++ b/installer/vagrant/centos.sh @@ -84,6 +84,7 @@ yum install -y \ php-bcmath \ php-mbstring \ httpd \ + fdk-aac \ liquidsoap \ silan \ icecast \ @@ -94,6 +95,7 @@ yum install -y \ # for pip ssl install yum install -y \ + gcc \ python-devel \ python-lxml \ openssl-devel From 9a6d5b01753821222345484e2220156eb40c50e9 Mon Sep 17 00:00:00 2001 From: Lucas Bickel Date: Mon, 13 Mar 2017 14:10:29 +0100 Subject: [PATCH 2/3] Restore SELinux tags after install --- Vagrantfile | 2 +- install | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 08ece0a1c..ba74a5e3c 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -46,7 +46,7 @@ Vagrant.configure("2") do |config| end config.vm.define "centos" do |os| os.vm.box = 'centos/7' - provision_libretime(os, "centos.sh", installer_args + "--ignore-dependencies --distribution=centos --web-user=apache") + provision_libretime(os, "centos.sh", installer_args + "--ignore-dependencies --distribution=centos --web-user=apache --selinux") end def provision_libretime(config, prepare_script, installer_args) diff --git a/install b/install index ed68ab322..c46589e51 100755 --- a/install +++ b/install @@ -49,7 +49,10 @@ showhelp () { -a, --apache Install apache and deploy a basic configuration for Airtime -i, --icecast - Install Icecast 2 and deploy a basic configuration for Airtime" + Install Icecast 2 and deploy a basic configuration for Airtime + --selinux + Run restorecon on directories and files that need tagging to + allow the WEB_USER access." exit 0 } @@ -67,6 +70,7 @@ postgres="f" apache="f" icecast="f" ignore_dependencies="f" +selinux="f" # Interactive _i=1 # Verbose @@ -223,6 +227,9 @@ while :; do --web-port=?*) web_port=${1#*=} ;; + --selinux) + selinux="t" + ;; --) shift break @@ -747,6 +754,18 @@ if [ "$ignore_dependencies" = "f" ]; then fi fi +# If the user requested it we run restorecon on files that need +# tagging for selinux. +if [ "$selinux" = "t" ]; then + loud "\n-----------------------------------------------------" + loud " * Restoring SELinux Tags * " + loud "-----------------------------------------------------" + + verbose "\n * Running restorecon..." + loudCmd "restorecon -Rv /etc/airtime /srv/airtime > /dev/null 2>&1" + verbose "...Done" +fi + verbose "\n * Reloading apache..." if [ "$dist" != "centos" ]; then loudCmd "service ${apache_bin} reload 2>/dev/null" From 99a0ce37cc2286e43d53f7e8cf4292d9f3e79943 Mon Sep 17 00:00:00 2001 From: Lucas Bickel Date: Mon, 13 Mar 2017 14:30:51 +0100 Subject: [PATCH 3/3] Fix fix_cue_in to work with liquidsoap 1.2 The previous syntax only worked with 1.1, this one should work on both. --- python_apps/pypo/liquidsoap/ls_script.liq | 34 +++++++++++++---------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/python_apps/pypo/liquidsoap/ls_script.liq b/python_apps/pypo/liquidsoap/ls_script.liq index 7db04d417..43f58ff7e 100644 --- a/python_apps/pypo/liquidsoap/ls_script.liq +++ b/python_apps/pypo/liquidsoap/ls_script.liq @@ -45,26 +45,30 @@ def check_version(~version=liquidsoap.version, major, minor) = list.nth(v,0) > major or list.nth(v,0) == major and list.nth(v,1) >= minor end +# cue cut fix for liquidsoap <1.2.2 +# +# This was most likely broken on 1.1.1 (debian) as well. +# +# adapted from https://github.com/savonet/liquidsoap/issues/390#issuecomment-277562081 +# +def fix_cue_in(~cue_in_metadata='liq_cue_in', m) = + # 0.04 might need to be adjusted according to your frame size + if float_of_string(m[cue_in_metadata]) < 0.04 then + [(cue_in_metadata, "0")] + else + [] + end +end + def create_source() l = request.equeue(id="s#{!source_id}", length=0.5) l = audio_to_stereo(id="queue_src", l) - # cue cut fix for liquidsoap <1.2.2 - # - # This was most likely broken on 1.1.1 (debian) as well. - # - # adapted from https://github.com/savonet/liquidsoap/issues/390#issuecomment-277562081 - # - if not check_version(1, 3) then - l = map_metadata(fun (~cue_in_metadata='liq_cue_in', m) -> - # 0.04 might need to be adjusted according to your frame size - if float_of_string(m[cue_in_metadata]) < 0.04 then - [(cue_in_metadata, "0")] - else - [] - end - end) + l = if not check_version(1, 3) then + map_metadata(fix_cue_in, l) + else + l end l = cue_cut(l) l = amplify(1., override="replay_gain", l)