diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dc1697..97bd054 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,6 @@ The following is a history of the changes made to this project. ## v2.5.0 -* Twitter and email flight notifications ready for testing. * Can now specify the unit of measurement for dump1090-mutability during setup. * Users can now specify the repository branch they wish to use in the file install.sh. * Possible fix for blog post containing characters not UTF-8 compatible. *(lite)* @@ -21,6 +20,9 @@ The following is a history of the changes made to this project. * The path to the SQLite database is no longer hard coded in the portal PHP files. * Pagination links now show first and last page links properly. * When no patch is applied N\A is given for the patch version on the system page. +* Yes set to default when asked whether to bind dump1090-mutability to all IP addresses. +* Fixed issue with install script causing PiAware to not upgrade. +* Fixed collectd graph generation script so it works with newer versions of rrdtool. ## v2.4.0 *(September 27th, 2016)* diff --git a/bash/decoders/dump1090-mutability.sh b/bash/decoders/dump1090-mutability.sh index 942c1c2..bc196f6 100755 --- a/bash/decoders/dump1090-mutability.sh +++ b/bash/decoders/dump1090-mutability.sh @@ -185,7 +185,7 @@ fi exit 0 # Ask if dump1090-mutability should bind on all IP addresses. -if (whiptail --backtitle "$ADSB_PROJECTTITLE" --title "Bind Dump1090-mutability To All IP Addresses" --defaultno --yesno "By default dump1090-mutability is bound only to the local loopback IP address(s) for security reasons. However some people wish to make dump1090-mutability's data accessable externally by other devices. To allow this dump1090-mutability can be configured to listen on all IP addresses bound to this device. It is recommended that unless you plan to access this device from an external source that dump1090-mutability remain bound only to the local loopback IP address(s).\n\nWould you like dump1090-mutability to listen on all IP addesses?" 15 78) then +if (whiptail --backtitle "$ADSB_PROJECTTITLE" --title "Bind Dump1090-mutability To All IP Addresses" --yesno "By default dump1090-mutability is bound only to the local loopback IP address(s) for security reasons. However some people wish to make dump1090-mutability's data accessable externally by other devices. To allow this dump1090-mutability can be configured to listen on all IP addresses bound to this device. It is recommended that unless you plan to access this device from an external source that dump1090-mutability remain bound only to the local loopback IP address(s).\n\nWould you like dump1090-mutability to listen on all IP addesses?" 15 78) then echo -e "\e[94m Binding dump1090-mutability to all available IP addresses...\e[97m" CommentConfig "NET_BIND_ADDRESS" "/etc/default/dump1090-mutability" else diff --git a/bash/portal/install.sh b/bash/portal/install.sh index 7048ea6..533767c 100755 --- a/bash/portal/install.sh +++ b/bash/portal/install.sh @@ -520,16 +520,6 @@ if [ $? -ne 0 ]; then exit 1 fi -# Execute the notifications setup script. -chmod +x $BASHDIRECTORY/portal/notifications.sh -$BASHDIRECTORY/portal/notifications.sh -if [ $? -ne 0 ]; then - echo "" - echo -e "\e[91m THE SCRIPT NOTIFICATIONS.SH ENCOUNTERED AND ERROR" - echo "" - exit 1 -fi - ## SETUP ADVANCED PORTAL FEATURES if [ $ADVANCED = TRUE ]; then diff --git a/bash/portal/notifications.sh b/bash/portal/notifications.sh deleted file mode 100755 index 3d8d762..0000000 --- a/bash/portal/notifications.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/bash - -##################################################################################### -# ADS-B RECEIVER # -##################################################################################### -# # -# This script is not meant to be executed directly. # -# Instead execute install.sh to begin the installation process. # -# # -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -# # -# Copyright (c) 2015-2016 Joseph A. Prochazka # -# # -# Permission is hereby granted, free of charge, to any person obtaining a copy # -# of this software and associated documentation files (the "Software"), to deal # -# in the Software without restriction, including without limitation the rights # -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # -# copies of the Software, and to permit persons to whom the Software is # -# furnished to do so, subject to the following conditions: # -# # -# The above copyright notice and this permission notice shall be included in all # -# copies or substantial portions of the Software. # -# # -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # -# SOFTWARE. # -# # -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # - -## VARIABLES - -PROJECTROOTDIRECTORY="$PWD" -BASHDIRECTORY="$PROJECTROOTDIRECTORY/bash" -BUILDDIRECTORY="$PROJECTROOTDIRECTORY/build" -PORTALBUILDDIRECTORY="$BUILDDIRECTORY/portal" -PORTALPYTHONDIRECTORY="$PORTALBUILDDIRECTORY/python" -PYTHONPATH=`which python` - -## INCLUDE EXTERNAL SCRIPTS - -source $BASHDIRECTORY/functions.sh - -## CHECK FOR PREREQUISITE PACKAGES - -echo -e "\e[95m Installing packages needed to build and fulfill dependencies...\e[97m" -echo "" -CheckPackage python-pip - -echo -e "\e[94m Using pip to install python-twitter...\e[97m" -echo "" -sudo pip install python-twitter - -## SETUP FLIGHT NOTIFICATIONS - -echo "" -echo -e "\e[95m Setting up flight notifications...\e[97m" -echo "" - -# Create and set permissions on the flight logging and maintenance maintenance scripts. -echo -e "\e[94m Creating the flight logging maintenance script...\e[97m" -tee $PORTALPYTHONDIRECTORY/notifications-maint.sh > /dev/null <0)) && sudo sed -i "${LINENUMBER[$((${#LINENUMBER[@]}-1))]}i $PORTALPYTHONDIRECTORY/notifications-maint.sh &\n" /etc/rc.local -fi - -# Kill any previously running maintenance scripts. -echo -e "\e[94m Checking for any running notifications-maint.sh processes...\e[97m" -PIDS=`ps -efww | grep -w "notifications-maint.sh" | awk -vpid=$$ '$2 != pid { print $2 }'` -if [ ! -z "$PIDS" ]; then - echo -e "\e[94m Killing any running notifications-maint.sh processes...\e[97m" - sudo kill $PIDS - sudo kill -9 $PIDS -fi - -# Start maintenance. -echo -e "\e[94m Executing the notifications maintenance script...\e[97m" -nohup $PORTALPYTHONDIRECTORY/notifications-maint.sh > /dev/null 2>&1 & - -exit 0 diff --git a/build/portal/html/admin/index.php b/build/portal/html/admin/index.php index ae3110f..d3e496e 100644 --- a/build/portal/html/admin/index.php +++ b/build/portal/html/admin/index.php @@ -54,21 +54,18 @@ if ($settings::db_driver == "xml") { // XML - $notifications = simplexml_load_file($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."data".DIRECTORY_SEPARATOR."notifications.xml"); + $notifications = simplexml_load_file($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."data".DIRECTORY_SEPARATOR."flightNotifications.xml"); unset($notifications->flight); foreach ($notificationArray as $notification) { - $flight = $notifications->addChild('flight', ''); - $flight->addChild('name', $notification); - $flight->addChild('lastMessageCount', -1); + $newNotification = $notifications->addChild('flight', $notification); $dom = dom_import_simplexml($notifications)->ownerDocument; - $dom->preserveWhiteSpace = FALSE; $dom->formatOutput = TRUE; - file_put_contents($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."data".DIRECTORY_SEPARATOR."notifications.xml", $dom->saveXML()); + file_put_contents($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."data".DIRECTORY_SEPARATOR."flightNotifications.xml", $dom->saveXML()); } } else { // PDO $dbh = $common->pdoOpen(); - $sql = "SELECT * FROM ".$settings::db_prefix."notifications"; + $sql = "SELECT * FROM ".$settings::db_prefix."flightNotifications"; $sth = $dbh->prepare($sql); $sth->execute(); $savedFlights = $sth->fetchAll(); @@ -78,7 +75,7 @@ // Remove flight if not in list. if (!in_array($flight, $notificationArray)) { $dbh = $common->pdoOpen(); - $sql = "DELETE FROM ".$settings::db_prefix."notifications WHERE flight = :flight"; + $sql = "DELETE FROM ".$settings::db_prefix."flightNotifications WHERE flight = :flight"; $sth = $dbh->prepare($sql); $sth->bindParam(':flight', $flight['flight'], PDO::PARAM_STR, 10); $sth->execute(); @@ -90,10 +87,9 @@ // Add flight if not saved already. if (!in_array($flight, $savedFlights)) { $dbh = $common->pdoOpen(); - $sql = "INSERT INTO ".$settings::db_prefix."notifications (flight, lastMessageCount) VALUES (:flight, :lastMessageCount)"; + $sql = "INSERT INTO ".$settings::db_prefix."flightNotifications (flight) VALUES (:flight)"; $sth = $dbh->prepare($sql); $sth->bindParam(':flight', $flight, PDO::PARAM_STR, 10); - $sth->bindParam(':lastMessageCount', $a = 0, PDO::PARAM_INT); $sth->execute(); $sth = NULL; $dbh = NULL; @@ -154,14 +150,6 @@ if (isset($_POST['enableWebNotifications']) && $_POST['enableWebNotifications'] == "TRUE") $enableWebNotifications = TRUE; - $enableEmailNotifications = FALSE; - if (isset($_POST['enableEmailNotifications']) && $_POST['enableEmailNotifications'] == "TRUE") - $enableEmailNotifications = TRUE; - - $enableTwitterNotifications = FALSE; - if (isset($_POST['enableTwitterNotifications']) && $_POST['enableTwitterNotifications'] == "TRUE") - $enableTwitterNotifications = TRUE; - // Update settings using those supplied by the form. $common->updateSetting("siteName", $_POST['siteName']); $common->updateSetting("template", $_POST['template']); @@ -189,14 +177,6 @@ $common->updateSetting("networkInterface", $_POST['networkInterface']); $common->updateSetting("timeZone", $_POST['timeZone']); $common->updateSetting("enableWebNotifications", $enableWebNotifications); - $common->updateSetting("enableEmailNotifications", $enableEmailNotifications); - $common->updateSetting("enableTwitterNotifications", $enableTwitterNotifications); - $common->updateSetting("emailNotificationAddresses", $_POST['emailNotificationAddresses']); - $common->updateSetting("twitterUserName", $_POST['twitterUserName']); - $common->updateSetting("twitterConsumerKey", $_POST['twitterConsumerKey']); - $common->updateSetting("twitterConsumerSecret", $_POST['twitterConsumerSecret']); - $common->updateSetting("twitterAccessToken", $_POST['twitterAccessToken']); - $common->updateSetting("twitterAccessTokenSecret", $_POST['twitterAccessTokenSecret']); $common->updateSetting("googleMapsApiKey", $_POST['googleMapsApiKey']); // Purge older flight positions. @@ -237,14 +217,6 @@ } } $enableWebNotifications = $common->getSetting("enableWebNotifications"); - $enableEmailNotifications = $common->getSetting("enableEmailNotifications"); - $enableTwitterNotifications = $common->getSetting("enableTwitterNotifications"); - $emailNotificationAddresses = $common->getSetting("emailNotificationAddresses"); - $twitterUserName = $common->getSetting("twitterUserName"); - $twitterConsumerKey = $common->getSetting("twitterConsumerKey"); - $twitterConsumerSecret = $common->getSetting("twitterConsumerSecret "); - $twitterAccessToken = $common->getSetting("twitterAccessToken"); - $twitterAccessTokenSecret = $common->getSetting("twitterAccessTokenSecret"); // Get general settings from settings.xml. $siteName = $common->getSetting("siteName"); @@ -305,7 +277,7 @@ //////////////// // BEGIN HTML - require_once('includes/header.inc.php'); + require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."includes".DIRECTORY_SEPARATOR."includes/header.inc.php"); // Display the updated message if settings were updated. if ($updated) { @@ -430,79 +402,10 @@ > Enable web based flight notifications. -
- -
-
- - -
-
- -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -