diff --git a/airtime_mvc/application/configs/constants.php b/airtime_mvc/application/configs/constants.php index f3ae0c97d..edfe88db9 100644 --- a/airtime_mvc/application/configs/constants.php +++ b/airtime_mvc/application/configs/constants.php @@ -1,31 +1,30 @@ 'default', 'controller' => 'preference', 'action' => 'stream-setting' - ) + ), + array( + 'label' => _('Status'), + 'module' => 'default', + 'controller' => 'systemstatus', + 'action' => 'index', + 'resource' => 'systemstatus' + ), ) ); $pages[] = array( @@ -190,7 +197,7 @@ $pages[] = array( ), array( 'label' => _('What\'s New?'), - 'uri' => UI_REVAMP_YOUTUBE_URL, + 'uri' => LIBRETIME_WHATS_NEW_URL, 'target' => "_blank" ) ) diff --git a/airtime_mvc/application/controllers/SystemstatusController.php b/airtime_mvc/application/controllers/SystemstatusController.php new file mode 100644 index 000000000..b219c630b --- /dev/null +++ b/airtime_mvc/application/controllers/SystemstatusController.php @@ -0,0 +1,22 @@ +view->headScript()->appendFile($baseUrl.'js/airtime/status/status.js?'.$config['airtime_version'],'text/javascript'); + $this->version = $config['airtime_version']; + } + + public function indexAction() + { + Zend_Layout::getMvcInstance()->assign('parent_page', 'Settings'); + + $partitions = Application_Model_Systemstatus::GetDiskInfo(); + $this->view->status = new StdClass; + $this->view->status->partitions = $partitions; + $this->view->version = $this->version; + } +} diff --git a/airtime_mvc/application/models/Auth.php b/airtime_mvc/application/models/Auth.php index 01e73bf4e..c05421925 100644 --- a/airtime_mvc/application/models/Auth.php +++ b/airtime_mvc/application/models/Auth.php @@ -32,7 +32,7 @@ class Application_Model_Auth $message = sprintf(_("Hi %s, \n\nPlease click this link to reset your password: "), $user->getDbLogin()); $message .= "{$e_link_protocol}://{$e_link_base}:{$e_link_port}{$e_link_path}"; - $message .= sprintf(_pro("\n\nIf you have any problems, please contact our support team: %s"), SUPPORT_EMAIL_ADDRESS); + $message .= sprintf(_pro("\n\nIf you have any problems, please contact our support team: %s"), SUPPORT_ADDRESS); $message .= sprintf(_pro("\n\nThank you,\nThe %s Team"), SAAS_PRODUCT_BRANDING_NAME); $str = sprintf(_('%s Password Reset'), SAAS_PRODUCT_BRANDING_NAME); diff --git a/airtime_mvc/application/models/Cache.php b/airtime_mvc/application/models/Cache.php deleted file mode 100644 index dbbcb9d58..000000000 --- a/airtime_mvc/application/models/Cache.php +++ /dev/null @@ -1,45 +0,0 @@ -getMessage()); exit; } - - $cache->store($key, $value, $isUserValue, $userId); } /** @@ -143,8 +140,6 @@ class Application_Model_Preference */ private static function getValue($key, $isUserValue = false, $forceDefault = false) { - $cache = new Cache(); - try { $userId = null; @@ -156,10 +151,6 @@ class Application_Model_Preference } } - // If the value is already cached, return it - $res = $cache->fetch($key, $isUserValue, $userId); - if ($res !== false) return $res; - //Check if key already exists $sql = "SELECT COUNT(*) FROM cc_pref" ." WHERE keystr = :key"; @@ -198,7 +189,6 @@ class Application_Model_Preference $res = ($result !== false) ? $result : ""; } - $cache->store($key, $res, $isUserValue, $userId); return $res; } catch (Exception $e) { diff --git a/airtime_mvc/application/models/Systemstatus.php b/airtime_mvc/application/models/Systemstatus.php index b97ea491e..dcb5c1dac 100644 --- a/airtime_mvc/application/models/Systemstatus.php +++ b/airtime_mvc/application/models/Systemstatus.php @@ -214,27 +214,20 @@ class Application_Model_Systemstatus public static function GetDiskInfo() { $partitions = array(); - - //connect to DB and find how much total space user has allocated. - $totalSpace = Application_Model_Preference::GetDiskQuota(); - - $usedSpace = Application_Model_Preference::getDiskUsage(); - if (empty($usedSpace)) { - $usedSpace = 0; + /* First lets get all the watched directories. Then we can group them + * into the same partitions by comparing the partition sizes. */ + $musicDirs = Application_Model_MusicDir::getWatchedDirs(); + $musicDirs[] = Application_Model_MusicDir::getStorDir(); + foreach ($musicDirs as $md) { + $totalSpace = disk_total_space($md->getDirectory()); + if (!isset($partitions[$totalSpace])) { + $partitions[$totalSpace] = new StdClass; + $partitions[$totalSpace]->totalSpace = $totalSpace; + $partitions[$totalSpace]->totalFreeSpace = disk_free_space($md->getDirectory()); + $partitions[$totalSpace]->usedSpace = $totalSpace - $partitions[$totalSpace]->totalFreeSpace; + } + $partitions[$totalSpace]->dirs[] = $md->getDirectory(); } - /* $path = $_SERVER['AIRTIME_BASE']."etc/airtime/num_bytes.ini"; - $arr = parse_ini_file($path); - - $usedSpace = 0; - if ($arr !== false) { - $usedSpace = $arr['num_bytes']; - } */ - - $partitions[$totalSpace] = new stdClass(); - $partitions[$totalSpace]->totalSpace = $totalSpace; - $partitions[$totalSpace]->totalFreeSpace = $totalSpace - $usedSpace; - //Logging::info($partitions[$totalSpace]->totalFreeSpace); - return array_values($partitions); } diff --git a/airtime_mvc/application/upgrade/Upgrades.php b/airtime_mvc/application/upgrade/Upgrades.php index d1ac02ce5..5213ec602 100644 --- a/airtime_mvc/application/upgrade/Upgrades.php +++ b/airtime_mvc/application/upgrade/Upgrades.php @@ -187,18 +187,15 @@ abstract class AirtimeUpgrader * allowing child classes to overwrite _runUpgrade to reduce duplication */ public function upgrade() { - Cache::clear(); assert($this->checkIfUpgradeSupported()); try { // $this->toggleMaintenanceScreen(true); - Cache::clear(); $this->_getDbValues(); $this->_runUpgrade(); Application_Model_Preference::SetSchemaVersion($this->getNewVersion()); - Cache::clear(); // $this->toggleMaintenanceScreen(false); } catch(Exception $e) { @@ -215,7 +212,6 @@ abstract class AirtimeUpgrader * allowing child classes to overwrite _runDowngrade to reduce duplication */ public function downgrade() { - Cache::clear(); try { $this->_getDbValues(); @@ -232,7 +228,6 @@ abstract class AirtimeUpgrader // Set the schema version to the highest supported version so we don't skip versions when downgrading Application_Model_Preference::SetSchemaVersion($highestSupportedVersion); - Cache::clear(); } catch(Exception $e) { return false; } diff --git a/airtime_mvc/application/views/scripts/systemstatus/index.phtml b/airtime_mvc/application/views/scripts/systemstatus/index.phtml index 76321d8f2..9fa27d378 100644 --- a/airtime_mvc/application/views/scripts/systemstatus/index.phtml +++ b/airtime_mvc/application/views/scripts/systemstatus/index.phtml @@ -3,7 +3,6 @@ status->partitions[0]; - $used = $disk->totalSpace-$disk->totalFreeSpace; - $total = $disk->totalSpace; ?> - + + + + @@ -37,13 +32,6 @@ - - - - */?> - - - - -
version; ?>
Postgres @@ -54,7 +42,7 @@ " + ?>"> Try running sudo apt-get install php5-pgsql - Database configuration for Airtime + Database configuration for LibreTime " + ?>"> 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 - /etc/airtime.conf are correct and the Airtime database was installed correctly. + /etc/airtime.conf are correct and the LibreTime database was installed correctly. @@ -85,12 +73,12 @@ RabbitMQ - RabbitMQ configuration for Airtime + RabbitMQ configuration for LibreTime " + ?>"> Make sure RabbitMQ is installed correctly, and that your settings in /etc/airtime/airtime.conf are correct. Try using sudo rabbitmqctl list_users and sudo rabbitmqctl list_vhosts to see if the airtime user (or your custom RabbitMQ user) exists, then checking that @@ -103,19 +91,19 @@
- Media Monitor + Media Analzyer - Airtime media-monitor service + LibreTime media analyzer service + " - Check that the airtime-media-monitor service is installed correctly in /etc/init, + ?>"> + Check that the airtime_analyzer service is installed correctly in /etc/init, and ensure that it's running with -
initctl list | grep airtime-media-monitor
- If not, try
sudo service airtime-media-monitor start +
initctl list | grep airtime_analyzer
+ If not, try
sudo service airtime_analyzer start @@ -126,12 +114,12 @@ Pypo
- Airtime playout service + LibreTime playout service " + ?>"> Check that the airtime-playout service is installed correctly in /etc/init, and ensure that it's running with
initctl list | grep airtime-playout
@@ -146,12 +134,12 @@ Liquidsoap
- Airtime liquidsoap service + LibreTime liquidsoap service + " + ?>"> Check that the airtime-liquidsoap service is installed correctly in /etc/init, and ensure that it's running with
initctl list | grep airtime-liquidsoap
@@ -162,26 +150,7 @@
-
    -
-
- - -
-
;"> -
-
-
-
diff --git a/airtime_mvc/build/rabbitmq-analyzer.ini b/airtime_mvc/build/rabbitmq-analyzer.ini new file mode 100644 index 000000000..7f053ef97 --- /dev/null +++ b/airtime_mvc/build/rabbitmq-analyzer.ini @@ -0,0 +1,7 @@ +[rabbitmq] +host = 127.0.0.1 +port = 5672 +user = airtime +password = airtime +vhost = /airtime + diff --git a/airtime_mvc/public/airtime_logo.png b/airtime_mvc/public/airtime_logo.png index a635547b4..39071ab50 100644 Binary files a/airtime_mvc/public/airtime_logo.png and b/airtime_mvc/public/airtime_logo.png differ diff --git a/airtime_mvc/public/css/embed-player-images/airtime_logo.png b/airtime_mvc/public/css/embed-player-images/airtime_logo.png index db8e5fb81..cad74a6e8 100644 Binary files a/airtime_mvc/public/css/embed-player-images/airtime_logo.png and b/airtime_mvc/public/css/embed-player-images/airtime_logo.png differ diff --git a/airtime_mvc/public/css/images/airtime_logo.png b/airtime_mvc/public/css/images/airtime_logo.png index ed4e59d26..b56188b0e 100644 Binary files a/airtime_mvc/public/css/images/airtime_logo.png and b/airtime_mvc/public/css/images/airtime_logo.png differ diff --git a/airtime_mvc/public/css/images/airtime_logo_big.png b/airtime_mvc/public/css/images/airtime_logo_big.png index 6515696c5..8c75de660 100644 Binary files a/airtime_mvc/public/css/images/airtime_logo_big.png and b/airtime_mvc/public/css/images/airtime_logo_big.png differ diff --git a/airtime_mvc/public/css/images/airtime_logo_jp.png b/airtime_mvc/public/css/images/airtime_logo_jp.png index 0bc1ff866..359bf33c9 100644 Binary files a/airtime_mvc/public/css/images/airtime_logo_jp.png and b/airtime_mvc/public/css/images/airtime_logo_jp.png differ diff --git a/airtime_mvc/public/css/images/airtime_logo_med.png b/airtime_mvc/public/css/images/airtime_logo_med.png index a635547b4..39071ab50 100644 Binary files a/airtime_mvc/public/css/images/airtime_logo_med.png and b/airtime_mvc/public/css/images/airtime_logo_med.png differ diff --git a/airtime_mvc/public/css/images/airtime_logo_med2.png b/airtime_mvc/public/css/images/airtime_logo_med2.png index 1b9cb6c88..6327ed364 100644 Binary files a/airtime_mvc/public/css/images/airtime_logo_med2.png and b/airtime_mvc/public/css/images/airtime_logo_med2.png differ diff --git a/airtime_mvc/public/css/images/big_gray_logo.png b/airtime_mvc/public/css/images/big_gray_logo.png index 45982bd1a..06064a242 100644 Binary files a/airtime_mvc/public/css/images/big_gray_logo.png and b/airtime_mvc/public/css/images/big_gray_logo.png differ diff --git a/airtime_mvc/public/favicon.ico b/airtime_mvc/public/favicon.ico index d1b2a8735..55c7e3c1c 100644 Binary files a/airtime_mvc/public/favicon.ico and b/airtime_mvc/public/favicon.ico differ diff --git a/airtime_mvc/public/images/airtime_logo.png b/airtime_mvc/public/images/airtime_logo.png index a635547b4..39071ab50 100644 Binary files a/airtime_mvc/public/images/airtime_logo.png and b/airtime_mvc/public/images/airtime_logo.png differ diff --git a/build.sh b/build.sh index 5c785c1dc..225828d87 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,27 @@ #!/bin/bash -e composer install -git rev-parse HEAD > VERSION +git_build="" +if [ -d .git ]; then + echo " * Building from Git" + git_build="y" +fi + +if [ "${git_build}" = "y" ]; then + git_version=`git tag --points-at HEAD` + echo " * Version from tag: ${git_version}" + if [ "${git_version}" = "" ]; then + git_version=`git rev-parse --short HEAD` + echo " * Overriding empty version with sha1 commit-ish: ${git_version}" + fi + echo ${git_version} > VERSION +else + # if no file was in tarball we create one letting the user know + # travis should release tarballs with a pre-written VERSION file + # at some stage + if [ ! -f VERSION ]; then + folder_name=$(basename `pwd`) + echo "tarball install from folder ${folder_name}" > VERSION + fi +fi diff --git a/docs/manual/status/index.md b/docs/manual/status/index.md index 77e3a3e98..baaa0ed3c 100644 --- a/docs/manual/status/index.md +++ b/docs/manual/status/index.md @@ -1,7 +1,7 @@ -On the **System** menu, the **Status** page provides an overview of the health and resource usage of the various services that make up an Airtime system. If all is well, you will only see green check mark icons in the **Status** column. This page also shows how much **Disk Space** you have used on the disk partition containing the main Import folder, as well as any disks or partitions with watched folders. +On the **Settings** menu, the **Status** page provides an overview of the health and resource usage of the various services that make up a LibreTime system. If all is well, you will only see green check mark icons in the **Status** column. This page also shows how much **Disk Space** you have used on the disk partition containing the main Import folder, as well as any disks or partitions with watched folders. ![](static/Screenshot521-System_status_240.png) -If any of the check mark icons in the **Status** column have changed to a red warning sign, contact your system administrator for assistance. (The chapter *Troubleshooting* contains some tips). Airtime will do its best to restart any failing services, but sometimes manual intervention may be required; for example, in the case of hardware failure. +If any of the check mark icons in the **Status** column have changed to a red warning sign, contact your system administrator for assistance. (The chapter [Troubleshooting](../troubleshooting/index.md) contains some tips). LibreTime will do its best to restart any failing services, but sometimes manual intervention may be required; for example, in the case of hardware failure. -If you have run out of storage space, an Airtime user with *admin* privileges could log in and delete media files that are no longer required from the **Library**. Alternatively, you could move some files to a watched folder on another disk, or ask your system administrator to install additional storage capacity. +If you have run out of storage space, a LibreTime user with *admin* privileges could log in and delete media files that are no longer required from the **Library**. Alternatively, you could move some files to a watched folder on another disk, or ask your system administrator to install additional storage capacity. diff --git a/docs/manual/status/static/Screenshot521-System_status_240.png b/docs/manual/status/static/Screenshot521-System_status_240.png index 3ae852f2e..bebbaf802 100644 Binary files a/docs/manual/status/static/Screenshot521-System_status_240.png and b/docs/manual/status/static/Screenshot521-System_status_240.png differ