From c563aaf608dfd12fcd37e21c8b51ae674d38f39c Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Tue, 12 Mar 2013 17:00:52 -0400 Subject: [PATCH 1/7] CC-5023: Miss base_dir in GetServerType() will cause Web Server Type is "A" -fixed --- utils/airtime-check-system.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/airtime-check-system.php b/utils/airtime-check-system.php index 86f13b5b7..c823c7748 100644 --- a/utils/airtime-check-system.php +++ b/utils/airtime-check-system.php @@ -101,8 +101,11 @@ class AirtimeCheck { if (!isset($headerInfo['Server'][0])) return self::UNKNOWN; - else + else if (is_array($headerInfo['Server'])) { return $headerInfo['Server'][0]; + } else { + return $headerInfo['Server']; + } } public static function GetStatus($p_baseUrl, $p_basePort, $p_baseDir, $p_apiKey){ From 5bc49341a11851956744910cecd44b5e1da9870b Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Tue, 12 Mar 2013 17:01:31 -0400 Subject: [PATCH 2/7] CC-5023: Miss base_dir in GetServerType() will cause Web Server Type is "A" -fixed --- utils/airtime-check-system.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/airtime-check-system.php b/utils/airtime-check-system.php index c823c7748..1ce017c35 100644 --- a/utils/airtime-check-system.php +++ b/utils/airtime-check-system.php @@ -99,9 +99,9 @@ class AirtimeCheck { { $headerInfo = get_headers("http://$p_baseUrl:$p_basePort",1); - if (!isset($headerInfo['Server'][0])) + if (!isset($headerInfo['Server'][0])) { return self::UNKNOWN; - else if (is_array($headerInfo['Server'])) { + } else if (is_array($headerInfo['Server'])) { return $headerInfo['Server'][0]; } else { return $headerInfo['Server']; From 65b4d4ee57f42b264e6ead44dd029d80a248b32a Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Tue, 19 Mar 2013 12:57:09 -0400 Subject: [PATCH 3/7] 2.3.1 release prep --- CREDITS | 2 +- changelog | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CREDITS b/CREDITS index 644b4ab59..a9053b04c 100644 --- a/CREDITS +++ b/CREDITS @@ -2,7 +2,7 @@ CREDITS ======= -Version 2.3.0 +Version 2.3.0/2.3.1 ------------- Martin Konecny (martin.konecny@sourcefabric.org) Role: Developer Team Lead diff --git a/changelog b/changelog index aff42ec52..eb92ef188 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,16 @@ +2.3.1 - March 19th, 2013 + * Bug fixes + * Security fixes with running unescaped shell commands + * Fix backend services not coming back online if RabbitMQ crashed and + then restarted + * Fix uninstall not properly cleaning system + * Improved Services watchdog (test whether Services are running and + responding, not just running) + * Much faster library import (Silan analyzer runs in background) + * Fixed zombie process sometimes being created + * Other + * Upgrade to Mutagen (tag reader) 1.21 + 2.3.0 - Jan 21st, 2013 * New features * Localization (Chinese, Czech, English, French, German, Italian, Korean, From abb2d9d93f2ec6eb188ce29e05307e5b659de494 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Tue, 19 Mar 2013 17:40:42 +0000 Subject: [PATCH 4/7] Don't run the airtime-install script if Apache has not been configured [#CC-5020] --- debian/changelog | 11 ++++- debian/postinst | 117 ++++++++++++++++++++++++++--------------------- 2 files changed, 75 insertions(+), 53 deletions(-) diff --git a/debian/changelog b/debian/changelog index 137c4a1b0..3f9fcb53b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,15 @@ +airtime (2.3.0-2) unstable; urgency=low + + * Don't run the airtime-install script if the user has chosen not to + set up Apache + + -- Daniel James Tue, 19 Mar 2013 16:39:23 +0000 + airtime (2.3.0-1) unstable; urgency=low - * Nightly development snapshot of Airtime 2.3.x + * Upstream 2.3.0 release - -- Daniel James Tue, 22 Jan 2013 11:44:57 +0000 + -- Daniel James Tue, 12 Feb 2013 11:44:57 +0000 airtime (2.2.1-1) unstable; urgency=low diff --git a/debian/postinst b/debian/postinst index e6d5169f1..d3c7ca5c9 100755 --- a/debian/postinst +++ b/debian/postinst @@ -1,10 +1,14 @@ #!/bin/bash #postinst script for airtime -set -x +set -e . /usr/share/debconf/confmodule +if [ "$DPKG_DEBUG" = "developer" ]; then + set -x +fi + wwwdir="/usr/share/airtime" tmpdir="/var/lib/airtime/tmp" configdir="/etc/airtime" @@ -20,39 +24,30 @@ case "$1" in webserver="apache2" php="php5" - # clean up previous configurations - if [ -L /etc/$webserver/conf.d/airtime.conf ]; then - rm -f /etc/$webserver/conf.d/airtime.conf - fi - - if [ -f /etc/$webserver/sites-available/airtime-vhost ]; then - a2dissite airtime-vhost - fi - # this file in 1.8.2 is a directory path in 1.9.3 if [ -f /var/www/airtime/utils/airtime-import ]; then rm -f /var/www/airtime/utils/airtime-import fi - # APACHE config - echo "Setting up apache2..." - - # create the document root if it doesn't exist - if [ ! -d $wwwdir/public/ ]; then - install -d -m755 $wwwdir/public/ - fi - - # set up the virtual host + # do we set up a virtual host? db_get airtime/apache-setup - if [ "$RET" == "system-wide (all vhosts)" ]; then - if [ ! -d /etc/$webserver/conf.d/ ]; then - install -d -m755 /etc/$webserver/conf.d/ - fi - if [ ! -e /etc/$webserver/conf.d/airtime.conf ]; then - ln -s ${includefile} /etc/$webserver/conf.d/airtime.conf + APACHESETUP=$RET + if [ "${APACHESETUP}" == "no thanks" ]; then + echo "Not setting up ${webserver} and ${php}..." + + elif [ "${APACHESETUP}" == "dedicated v-host" ]; then + echo "Setting up ${webserver}..." + + # create the document root if it doesn't exist + if [ ! -d $wwwdir/public/ ]; then + install -d -m755 $wwwdir/public/ + fi + + # temporarily disable an existing virtual host + if [ -f /etc/$webserver/sites-available/airtime-vhost ]; then + a2dissite airtime-vhost fi - elif [ "$RET" == "dedicated v-host" ]; then db_get airtime/apache-servername SN=$RET db_get airtime/apache-serveradmin @@ -69,30 +64,49 @@ case "$1" in if [ $RETVAL -eq 0 ]; then a2ensite airtime-vhost fi - fi - # enable the rewrite module - command -v a2enmod > /dev/null - RETVAL=$? - if [ $RETVAL -eq 0 ]; then - a2enmod rewrite - fi + # insert a specific hostname, if provided, into API configuration + if [ "${SN}" != "localhost" ]; then - # remove the default site, if requested to - db_get airtime/apache-deldefault - if [ "$RET" == "remove default" ]; then - if [ -f /etc/apache2/sites-available/default ]; then - a2dissite default + # new installs + if [ -f /var/lib/airtime/tmp/airtime_mvc/build/airtime.conf -a -f /var/lib/airtime/tmp/python_apps/api_clients/api_client.cfg ]; then + sed -i "s/base_url = localhost/base_url = ${SN}/" /var/lib/airtime/tmp/airtime_mvc/build/airtime.conf + sed -i "s/host = 'localhost'/host = '${SN}'/" /var/lib/airtime/tmp/python_apps/api_clients/api_client.cfg + fi + + # upgrades + if [ -f /etc/airtime/airtime.conf -a -f /etc/airtime/api_client.cfg ]; then + sed -i "s/base_url = localhost/base_url = ${SN}/" /etc/airtime/airtime.conf + sed -i "s/host = 'localhost'/host = '${SN}'/" /etc/airtime/api_client.cfg + fi fi - fi - # PHP config - echo "Configuring php5..." - if [ ! -d /etc/$php/conf.d/ ]; then - install -d -m755 /etc/$php/conf.d/ - fi - if [ ! -e /etc/$php/conf.d/airtime.ini ]; then - ln -s ${phpinifile} /etc/$php/conf.d/airtime.ini + # enable the rewrite module + command -v a2enmod > /dev/null + RETVAL=$? + if [ $RETVAL -eq 0 ]; then + a2enmod rewrite + fi + + # remove the default site, if requested to + db_get airtime/apache-deldefault + if [ "$RET" == "remove default" ]; then + if [ -f /etc/apache2/sites-available/default ]; then + a2dissite default + fi + fi + + # PHP config + echo "Configuring php5..." + if [ ! -d /etc/$php/conf.d/ ]; then + install -d -m755 /etc/$php/conf.d/ + fi + if [ ! -e /etc/$php/conf.d/airtime.ini ]; then + ln -s ${phpinifile} /etc/$php/conf.d/airtime.ini + fi + + # restart apache + invoke-rc.d apache2 restart fi # XXX ICECAST XXX @@ -186,9 +200,6 @@ case "$1" in echo "The rabbitmq-server package does not appear to be installed on this server." fi - # restart apache - invoke-rc.d apache2 restart - # fix the Liquidsoap symlink if it doesn't point to standard location if [ -h /usr/bin/airtime-liquidsoap ]; then SYMLINK_TARGET=`readlink /usr/bin/airtime-liquidsoap` @@ -214,8 +225,12 @@ case "$1" in echo "Reconfiguration complete." else - if [ -n "$OLDVERSION" ] && [[ "${OLDVERSION:0:3}" < "1.9" ]]; then - echo "Upgrades from Airtime versions before 1.9.0 are not supported. Please back up your files and perform a clean install." + if [ -n "$OLDVERSION" ] && [[ "${OLDVERSION:0:3}" < "2.1" ]]; then + echo "Upgrades from Airtime versions before 2.1.0 are not supported. Please back up your files and perform a clean install." + + elif [ "${APACHESETUP}" == "no thanks" ]; then + echo "Please run the ${tmpdir}/install_minimal/airtime-install script after you have set up the web server." + else mkdir -p /var/log/airtime From 708d36ba9ca7961c8def03cf8d2ff16cfff025ad Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Tue, 19 Mar 2013 15:22:27 -0400 Subject: [PATCH 5/7] syntax error --- python_apps/pypo/pypofetch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_apps/pypo/pypofetch.py b/python_apps/pypo/pypofetch.py index f10c8c958..535d0fa99 100644 --- a/python_apps/pypo/pypofetch.py +++ b/python_apps/pypo/pypofetch.py @@ -534,7 +534,7 @@ class PypoFetch(Thread): #check if this file is opened (sometimes Liquidsoap is still #playing the file due to our knowledge of the track length #being incorrect!) - if not self.is_file_opened(): + if not self.is_file_opened(path): os.remove(path) except Exception, e: self.logger.error(e) From 19753429dc06c3bf1f3a1906affdf25675060f44 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 22 Mar 2013 14:04:50 -0400 Subject: [PATCH 6/7] add wait timer before liquidsoap is shutdown --- python_apps/pypo/airtime-liquidsoap-init-d | 1 + 1 file changed, 1 insertion(+) diff --git a/python_apps/pypo/airtime-liquidsoap-init-d b/python_apps/pypo/airtime-liquidsoap-init-d index 21323e850..d0e9751d7 100755 --- a/python_apps/pypo/airtime-liquidsoap-init-d +++ b/python_apps/pypo/airtime-liquidsoap-init-d @@ -28,6 +28,7 @@ stop () { # Send TERM after 5 seconds, wait at most 30 seconds. start-stop-daemon --stop --oknodo --retry=TERM/10/KILL/5 --quiet --pidfile $PIDFILE rm -f $PIDFILE + sleep 4 } start_no_monit() { From fc6742869f3e25b221f485a417d09f0c3e448255 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 22 Mar 2013 14:23:42 -0400 Subject: [PATCH 7/7] better frozen liquidsoap handling --- python_apps/pypo/airtime-liquidsoap-init-d | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python_apps/pypo/airtime-liquidsoap-init-d b/python_apps/pypo/airtime-liquidsoap-init-d index d0e9751d7..9826423ef 100755 --- a/python_apps/pypo/airtime-liquidsoap-init-d +++ b/python_apps/pypo/airtime-liquidsoap-init-d @@ -24,11 +24,12 @@ start () { stop () { monit unmonitor airtime-liquidsoap >/dev/null 2>&1 #send term signal after 10 seconds - timeout 10 /usr/lib/airtime/airtime_virtualenv/bin/python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_prepare_terminate.py + timeout -k 5 10 /usr/lib/airtime/airtime_virtualenv/bin/python \ + /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_prepare_terminate.py # Send TERM after 5 seconds, wait at most 30 seconds. start-stop-daemon --stop --oknodo --retry=TERM/10/KILL/5 --quiet --pidfile $PIDFILE rm -f $PIDFILE - sleep 4 + sleep 3 } start_no_monit() {