diff --git a/airtime_mvc/build/airtime.conf.170 b/airtime_mvc/build/airtime.conf.170 new file mode 100644 index 000000000..9135f09e4 --- /dev/null +++ b/airtime_mvc/build/airtime.conf.170 @@ -0,0 +1,22 @@ +[database] +host = localhost +dbname = airtime +dbuser = airtime +dbpass = airtime + +[rabbitmq] +host = 127.0.0.1 +port = 5672 +user = guest +password = guest +vhost = / + +[general] +api_key = AAA +web_server_user = www-data +airtime_dir = x +base_files_dir = x + +[soundcloud] +connection_retries = 3 +time_between_retries = 60 diff --git a/airtime_mvc/build/airtime.conf.180 b/airtime_mvc/build/airtime.conf.180 new file mode 100644 index 000000000..9135f09e4 --- /dev/null +++ b/airtime_mvc/build/airtime.conf.180 @@ -0,0 +1,22 @@ +[database] +host = localhost +dbname = airtime +dbuser = airtime +dbpass = airtime + +[rabbitmq] +host = 127.0.0.1 +port = 5672 +user = guest +password = guest +vhost = / + +[general] +api_key = AAA +web_server_user = www-data +airtime_dir = x +base_files_dir = x + +[soundcloud] +connection_retries = 3 +time_between_retries = 60 diff --git a/airtime_mvc/build/airtime.conf.181 b/airtime_mvc/build/airtime.conf.181 new file mode 100644 index 000000000..9135f09e4 --- /dev/null +++ b/airtime_mvc/build/airtime.conf.181 @@ -0,0 +1,22 @@ +[database] +host = localhost +dbname = airtime +dbuser = airtime +dbpass = airtime + +[rabbitmq] +host = 127.0.0.1 +port = 5672 +user = guest +password = guest +vhost = / + +[general] +api_key = AAA +web_server_user = www-data +airtime_dir = x +base_files_dir = x + +[soundcloud] +connection_retries = 3 +time_between_retries = 60 diff --git a/airtime_mvc/build/airtime.conf.182 b/airtime_mvc/build/airtime.conf.182 new file mode 100644 index 000000000..982d5a762 --- /dev/null +++ b/airtime_mvc/build/airtime.conf.182 @@ -0,0 +1,24 @@ +[database] +host = localhost +dbname = airtime +dbuser = airtime +dbpass = airtime + +[rabbitmq] +host = 127.0.0.1 +port = 5672 +user = guest +password = guest +vhost = / + +[general] +api_key = AAA +web_server_user = www-data +airtime_dir = x +base_files_dir = x +base_url = localhost +base_port = 80 + +[soundcloud] +connection_retries = 3 +time_between_retries = 60 diff --git a/install_minimal/upgrades/airtime-1.7.0/airtime-upgrade.php b/install_minimal/upgrades/airtime-1.7.0/airtime-upgrade.php index be0431db6..89e157c88 100644 --- a/install_minimal/upgrades/airtime-1.7.0/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.7.0/airtime-upgrade.php @@ -9,7 +9,42 @@ require_once(dirname(__FILE__).'/../../include/AirtimeIni.php'); require_once(dirname(__FILE__).'/../../include/AirtimeInstall.php'); -AirtimeIni::CreateIniFiles(); + +/** +* This function creates the /etc/airtime configuration folder +* and copies the default config files to it. +*/ +function CreateIniFiles() +{ + global $AIRTIME_SRC; + global $AIRTIME_PYTHON_APPS; + + if (!file_exists("/etc/airtime/")){ + if (!mkdir("/etc/airtime/", 0755, true)){ + echo "Could not create /etc/airtime/ directory. Exiting."; + exit(1); + } + } + + if (!copy($AIRTIME_SRC."/build/airtime.conf.170", CONF_FILE_AIRTIME)){ + echo "Could not copy airtime.conf to /etc/airtime/. Exiting."; + exit(1); + } + if (!copy($AIRTIME_PYTHON_APPS."/pypo/pypo.cfg", CONF_FILE_PYPO)){ + echo "Could not copy pypo.cfg to /etc/airtime/. Exiting."; + exit(1); + } + if (!copy($AIRTIME_PYTHON_APPS."/show-recorder/recorder.cfg", CONF_FILE_RECORDER)){ + echo "Could not copy recorder.cfg to /etc/airtime/. Exiting."; + exit(1); + } + if (!copy($AIRTIME_PYTHON_APPS."/pypo/liquidsoap_scripts/liquidsoap.cfg", CONF_FILE_LIQUIDSOAP)){ + echo "Could not copy liquidsoap.cfg to /etc/airtime/. Exiting."; + exit(1); + } +} + +CreateIniFiles(); AirtimeIni::UpdateIniFiles(); echo PHP_EOL."*** Updating Database Tables ***".PHP_EOL; diff --git a/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php b/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php index 55ea0272b..b38f0dde6 100644 --- a/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php @@ -53,8 +53,42 @@ foreach ($configFiles as $conf) { } } +/** +* This function creates the /etc/airtime configuration folder +* and copies the default config files to it. +*/ +function CreateIniFiles() +{ + global $AIRTIME_SRC; + global $AIRTIME_PYTHON_APPS; + + if (!file_exists("/etc/airtime/")){ + if (!mkdir("/etc/airtime/", 0755, true)){ + echo "Could not create /etc/airtime/ directory. Exiting."; + exit(1); + } + } + + if (!copy($AIRTIME_SRC."/build/airtime.conf.180", CONF_FILE_AIRTIME)){ + echo "Could not copy airtime.conf to /etc/airtime/. Exiting."; + exit(1); + } + if (!copy($AIRTIME_PYTHON_APPS."/pypo/pypo.cfg", CONF_FILE_PYPO)){ + echo "Could not copy pypo.cfg to /etc/airtime/. Exiting."; + exit(1); + } + if (!copy($AIRTIME_PYTHON_APPS."/show-recorder/recorder.cfg", CONF_FILE_RECORDER)){ + echo "Could not copy recorder.cfg to /etc/airtime/. Exiting."; + exit(1); + } + if (!copy($AIRTIME_PYTHON_APPS."/pypo/liquidsoap_scripts/liquidsoap.cfg", CONF_FILE_LIQUIDSOAP)){ + echo "Could not copy liquidsoap.cfg to /etc/airtime/. Exiting."; + exit(1); + } +} + echo "* Creating INI files".PHP_EOL; -AirtimeIni::CreateIniFiles(); +CreateIniFiles(); AirtimeInstall::InstallPhpCode(); AirtimeInstall::InstallBinaries(); diff --git a/install_minimal/upgrades/airtime-1.8.1/airtime-upgrade.php b/install_minimal/upgrades/airtime-1.8.1/airtime-upgrade.php index cec3769b8..46b8f7ebd 100644 --- a/install_minimal/upgrades/airtime-1.8.1/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.8.1/airtime-upgrade.php @@ -122,7 +122,7 @@ function CreateIniFiles() } } - if (!copy($AIRTIME_SRC."/build/airtime.conf", CONF_FILE_AIRTIME)){ + if (!copy($AIRTIME_SRC."/build/airtime.conf.181", CONF_FILE_AIRTIME)){ echo "Could not copy airtime.conf to /etc/airtime/. Exiting."; exit(1); } diff --git a/install_minimal/upgrades/airtime-1.8.2/airtime-upgrade.php b/install_minimal/upgrades/airtime-1.8.2/airtime-upgrade.php index a5ae869c6..a19aee382 100644 --- a/install_minimal/upgrades/airtime-1.8.2/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.8.2/airtime-upgrade.php @@ -122,7 +122,7 @@ function CreateIniFiles() } } - if (!copy($AIRTIME_SRC."/build/airtime.conf", CONF_FILE_AIRTIME)){ + if (!copy($AIRTIME_SRC."/build/airtime.conf.182", CONF_FILE_AIRTIME)){ echo "Could not copy airtime.conf to /etc/airtime/. Exiting."; exit(1); } diff --git a/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php b/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php index 40c8765a7..308d99812 100644 --- a/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php @@ -539,7 +539,8 @@ class Airtime190Upgrade{ public static function UninstallBinaries() { echo "* Removing Airtime binaries from ".CONF_DIR_BINARIES.PHP_EOL; - exec('rm -rf "'.CONF_DIR_BINARIES.'"'); + $command = "rm -rf $(ls -d /usr/lib/airtime/* | grep -v airtime_virtualenv)"; + exec($command); } diff --git a/utils/airtime-check-system.php b/utils/airtime-check-system.php index fd8879f0c..277d6018f 100644 --- a/utils/airtime-check-system.php +++ b/utils/airtime-check-system.php @@ -259,7 +259,7 @@ class AirtimeCheck { } private static function CheckPythonLibrary($lib, $minVersion){ - $command = "pip freeze | grep $lib"; + $command = "/usr/lib/airtime/airtime_virtualenv/bin/pip freeze | grep $lib"; exec($command, $output, $result); $status = AirtimeCheck::CHECK_FAILED;