kopia lustrzana https://github.com/jprochazka/adsb-receiver
Resolved merge conflicts.
commit
792aa6d9fb
|
@ -8,6 +8,8 @@ The following is a history of the changes made to this project.
|
|||
* Scripts are now updated from the master branch each time install.sh is ran.
|
||||
* The file install.sh now executes ~/bash/main.sh after updates are applied.
|
||||
* Changed dump1090-mutability build directory to ~/build/dump1090-mutability.
|
||||
* Removed dump1090-fa map option from portal due to the fact it is no longer needed.
|
||||
* Flights.py has been temporariliy switched back to reading aircraft.json over HTTP.
|
||||
|
||||
## v2.3.0
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@ if (whiptail --backtitle "$ADSB_PROJECTTITLE" --title "ADS-B Receiver Project Im
|
|||
echo -e "\e[92m Downloading and installing the latest updates for your operating system..."
|
||||
echo -e "\e[93m----------------------------------------------------------------------------------------------------\e[97m"
|
||||
echo ""
|
||||
sudo apt-get update
|
||||
sudo apt-get -y dist-upgrade
|
||||
echo ""
|
||||
echo -e "\e[93m----------------------------------------------------------------------------------------------------"
|
||||
|
|
|
@ -45,6 +45,9 @@ BUILDDIRECTORY="$PROJECTROOTDIRECTORY/build"
|
|||
source $BASHDIRECTORY/variables.sh
|
||||
source $BASHDIRECTORY/functions.sh
|
||||
|
||||
## Set the project title variable.
|
||||
export ADSB_PROJECTTITLE="The ADS-B Receiver Project v$PROJECTVERSION Installer"
|
||||
|
||||
###############
|
||||
## FUNCTIONS
|
||||
|
||||
|
|
|
@ -45,14 +45,16 @@ echo ""
|
|||
|
||||
## MODIFY THE DUMP1090-MUTABILITY INIT SCRIPT TO MEASURE AND RETAIN NOISE DATA
|
||||
|
||||
echo -e "\e[94m Modifying the dump1090-mutability init script to add noise measurements...\e[97m"
|
||||
sudo sed -i 's/ARGS=""/ARGS="--measure-noise "/g' /etc/init.d/dump1090-mutability
|
||||
echo -e "\e[94m Reloading the systemd manager configuration...\e[97m"
|
||||
sudo systemctl daemon-reload
|
||||
echo -e "\e[94m Reloading dump1090-mutability...\e[97m"
|
||||
echo ""
|
||||
sudo /etc/init.d/dump1090-mutability force-reload
|
||||
echo ""
|
||||
if [ $(dpkg-query -W -f='${STATUS}' dump1090-mutability 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
|
||||
echo -e "\e[94m Modifying the dump1090-mutability init script to add noise measurements...\e[97m"
|
||||
sudo sed -i 's/ARGS=""/ARGS="--measure-noise "/g' /etc/init.d/dump1090-mutability
|
||||
echo -e "\e[94m Reloading the systemd manager configuration...\e[97m"
|
||||
sudo systemctl daemon-reload
|
||||
echo -e "\e[94m Reloading dump1090-mutability...\e[97m"
|
||||
echo ""
|
||||
sudo /etc/init.d/dump1090-mutability force-reload
|
||||
echo ""
|
||||
fi
|
||||
|
||||
## BACKUP AND REPLACE COLLECTD.CONF
|
||||
|
||||
|
|
|
@ -350,20 +350,45 @@ echo -e "\e[94m Checking if dump978 was set up...\e[97m"
|
|||
if ! grep -q "$BUILDDIRECTORY/dump978/dump978-maint.sh &" /etc/rc.local; then
|
||||
# Check if a heywhatsthat.com range file exists in the dump1090 HTML folder.
|
||||
echo -e "\e[94m Checking for the file upintheair.json in the dump1090 HTML folder...\e[97m"
|
||||
if [ -f /usr/share/dump1090-mutability/html/upintheair.json ]; then
|
||||
if [ -f /usr/share/dump1090-mutability/html/upintheair.json ] || [ -f /usr/share/dump1090-fa/html/upintheair.json ]; then
|
||||
echo -e "\e[94m Copying the file upintheair.json from the dump1090 HTML folder to the dump978 HTML folder...\e[97m"
|
||||
sudo cp /usr/share/dump1090-mutability/html/upintheair.json $LIGHTTPDDOCUMENTROOT/dump978/
|
||||
if [ $(dpkg-query -W -f='${STATUS}' dump1090-mutability 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
|
||||
sudo cp /usr/share/dump1090-mutability/html/upintheair.json $LIGHTTPDDOCUMENTROOT/dump978/
|
||||
fi
|
||||
if [ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
|
||||
sudo cp /usr/share/dump1090-fa/html/upintheair.json $LIGHTTPDDOCUMENTROOT/dump978/
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo -e "\e[94m Removing conflicting redirects from the Lighttpd dump1090.conf file...\e[97m"
|
||||
# Remove this line completely.
|
||||
sudo sed -i "/$(echo ' "^/dump1090$" => "/dump1090/gmap.html"' | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/&/\\\&/g')/d" /etc/lighttpd/conf-available/89-dump1090.conf
|
||||
# Remove the trailing coma from this line.
|
||||
sudo sed -i "s/$(echo '"^/dump1090/$" => "/dump1090/gmap.html",' | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/&/\\\&/g')/$(echo '"^/dump1090/$" => "/dump1090/gmap.html"' | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/&/\\\&/g')/g" /etc/lighttpd/conf-available/89-dump1090.conf
|
||||
if [ $(dpkg-query -W -f='${STATUS}' dump1090-mutability 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
|
||||
echo -e "\e[94m Removing conflicting redirects from the Lighttpd dump1090.conf file...\e[97m"
|
||||
# Remove this line completely.
|
||||
sudo sed -i "/$(echo ' "^/dump1090$" => "/dump1090/gmap.html"' | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/&/\\\&/g')/d" /etc/lighttpd/conf-available/89-dump1090.conf
|
||||
# Remove the trailing coma from this line.
|
||||
sudo sed -i "s/$(echo '"^/dump1090/$" => "/dump1090/gmap.html",' | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/&/\\\&/g')/$(echo '"^/dump1090/$" => "/dump1090/gmap.html"' | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/&/\\\&/g')/g" /etc/lighttpd/conf-available/89-dump1090.conf
|
||||
fi
|
||||
|
||||
# Add to the Lighttpd configuration.
|
||||
echo -e "\e[94m Adding the Lighttpd portal configuration file...\e[97m"
|
||||
sudo tee /etc/lighttpd/conf-available/89-adsb-portal.conf > /dev/null <<EOF
|
||||
if [ -f /etc/lighttpd/conf-available/89-adsb-portal.conf ]; then
|
||||
sudo rm -f /etc/lighttpd/conf-available/89-adsb-portal.conf
|
||||
fi
|
||||
sudo touch /etc/lighttpd/conf-available/89-adsb-portal.conf
|
||||
if [ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
|
||||
sudo tee -a /etc/lighttpd/conf-available/89-adsb-portal.conf > /dev/null <<EOF
|
||||
# Add dump1090 as an alias to the dump1090-fa HTML folder.
|
||||
alias.url += (
|
||||
"/dump1090/data/" => "/run/dump1090-fa/",
|
||||
"/dump1090/" => "/usr/share/dump1090-fa/html/"
|
||||
)
|
||||
# Redirect the slash-less dump1090 URL
|
||||
url.redirect += (
|
||||
"^/dump1090$" => "/dump1090/"
|
||||
)
|
||||
EOF
|
||||
fi
|
||||
sudo tee -a /etc/lighttpd/conf-available/89-adsb-portal.conf > /dev/null <<EOF
|
||||
# Block all access to the data directory accept for local requests.
|
||||
\$HTTP["remoteip"] !~ "127.0.0.1" {
|
||||
\$HTTP["url"] =~ "^/data/" {
|
||||
|
|
|
@ -132,11 +132,11 @@ case $DUMP1090OPTION in
|
|||
echo ""
|
||||
mkdir -p $BUILDDIRECTORY/dump1090-fa
|
||||
cd $BUILDDIRECTORY/dump1090-fa
|
||||
git clone https://github.com/mutability/dump1090.git
|
||||
cd $BUILDDIRECTORY/dump1090-mutability/dump1090
|
||||
git clone https://github.com/flightaware/dump1090.git
|
||||
cd $BUILDDIRECTORY/dump1090-fa/dump1090
|
||||
dpkg-buildpackage -b
|
||||
cd $BUILDDIRECTORY/dump1090-mutability
|
||||
sudo dpkg -i dump1090-mutability_1.15~dev_*.deb
|
||||
cd $BUILDDIRECTORY/dump1090-fa
|
||||
sudo dpkg -i dump1090-fa_*.deb
|
||||
|
||||
# PiAware
|
||||
cd $BUILDDIRECTORY
|
||||
|
@ -145,7 +145,7 @@ case $DUMP1090OPTION in
|
|||
./sensible-build.sh jessie
|
||||
cd $BUILDDIRECTORY/piaware_builder/package-jessie
|
||||
dpkg-buildpackage -b
|
||||
sudo dpkg -i $PIAWAREBUILDDIRECTORY/piaware_*.deb
|
||||
sudo dpkg -i $BUILDDIRECTORY/piaware_builder/piaware_*.deb
|
||||
;;
|
||||
*)
|
||||
# Nothing selected.
|
||||
|
|
|
@ -146,10 +146,6 @@
|
|||
if (isset($_POST['enableAdsbExchangeLink']) && $_POST['enableAdsbExchangeLink'] == "TRUE")
|
||||
$enableAdsbExchangeLink = TRUE;
|
||||
|
||||
$useDump1090FaMap = FALSE;
|
||||
if (isset($_POST['useDump1090FaMap']) && $_POST['useDump1090FaMap'] == "TRUE")
|
||||
$useDump1090FaMap = TRUE;
|
||||
|
||||
$enableWebNotifications = FALSE;
|
||||
if (isset($_POST['enableWebNotifications']) && $_POST['enableWebNotifications'] == "TRUE")
|
||||
$enableWebNotifications = TRUE;
|
||||
|
@ -187,7 +183,6 @@
|
|||
$common->updateSetting("measurementBandwidth", $_POST['measurementBandwidth']);
|
||||
$common->updateSetting("networkInterface", $_POST['networkInterface']);
|
||||
$common->updateSetting("timeZone", $_POST['timeZone']);
|
||||
$common->updateSetting("useDump1090FaMap", $useDump1090FaMap);
|
||||
$common->updateSetting("enableWebNotifications", $enableWebNotifications);
|
||||
$common->updateSetting("enableEmailNotifications", $enableEmailNotifications);
|
||||
$common->updateSetting("enableTwitterNotifications", $enableTwitterNotifications);
|
||||
|
@ -259,7 +254,6 @@
|
|||
$enableDump1090 = $common->getSetting("enableDump1090");
|
||||
$enableDump978 = $common->getSetting("enableDump978");
|
||||
$enablePfclient = $common->getSetting("enablePfclient");
|
||||
$useDump1090FaMap = $common->getSetting("useDump1090FaMap");
|
||||
|
||||
// Get aggregate site settings from settings.xml.
|
||||
$enableFlightAwareLink = $common->getSetting("enableFlightAwareLink");
|
||||
|
@ -481,16 +475,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Dump1090 Map Settings</div>
|
||||
<div class="panel-body">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="useDump1090FaMap" value="TRUE"<?php ($useDump1090FaMap == 1 ? print ' checked' : ''); ?>> Use dump1090-fa map instead of the dump1090-mutability map. <em>(dump1090-fa must be installed in order for the map to display)</em>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Aggregate Site Settings</div>
|
||||
<div class="panel-body">
|
||||
|
|
|
@ -43,12 +43,5 @@
|
|||
// The title of this page.
|
||||
$pageData['title'] = "Live Dump1090 Map";
|
||||
|
||||
// Decide which dump1090 map to display.
|
||||
if ($common->getSetting('useDump1090FaMap') == 1) {
|
||||
$pageData['dump1090Map'] = "/dump1090-fa/";
|
||||
} else {
|
||||
$pageData['dump1090Map'] = "/dump1090/gmap.html";
|
||||
}
|
||||
|
||||
$template->display($pageData);
|
||||
?>
|
||||
|
|
|
@ -399,7 +399,6 @@ EOF;
|
|||
$common->addSetting('emailFrom', 'noreply@adsbreceiver.net');
|
||||
$common->addSetting('emailReplyTo', 'noreply@adsbreceiver.net');
|
||||
$common->addSetting('timeZone', $_POST['timeZone']);
|
||||
$common->addSetting('useDump1090FaMap', FALSE);
|
||||
$common->addSetting('enableWebNotifications', FALSE);
|
||||
$common->addSetting('enableEmailNotifications', FALSE);
|
||||
$common->addSetting('enableTwitterNotifications', FALSE);
|
||||
|
|
|
@ -103,8 +103,7 @@
|
|||
$success = $results['success'];
|
||||
$message = $results['message'];
|
||||
$version = "2.4.0"
|
||||
}
|
||||
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."admin".DIRECTORY_SEPARATOR."includes".DIRECTORY_SEPARATOR."header.inc.php");
|
||||
|
||||
// Display the instalation wizard.
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
{/area}
|
||||
{area:contents}
|
||||
<div id="iframe-wrapper">
|
||||
<iframe id="map" src="{page:dump1090Map}"></iframe>
|
||||
<iframe id="map" src="/dump1090/"></iframe>
|
||||
</div>
|
||||
{/area}
|
||||
{area:scripts/}
|
||||
|
|
|
@ -39,7 +39,7 @@ import datetime
|
|||
import json
|
||||
import time
|
||||
import os
|
||||
#import urllib2
|
||||
import urllib2
|
||||
|
||||
def log(string):
|
||||
#print(string) # uncomment to enable debug logging
|
||||
|
@ -187,11 +187,14 @@ if __name__ == "__main__":
|
|||
# Main run loop
|
||||
while True:
|
||||
# Read dump1090-mutability's aircraft.json.
|
||||
with open('/run/dump1090-mutability/aircraft.json') as data_file:
|
||||
data = json.load(data_file)
|
||||
# For testing using a remote JSON feed.
|
||||
#response = urllib2.urlopen('http://192.168.254.2/dump1090/data/aircraft.json')
|
||||
#data = json.load(response)
|
||||
#with open('/run/dump1090-mutability/aircraft.json') as data_file:
|
||||
# data = json.load(data_file)
|
||||
|
||||
# Switch from physical file location to using urllib2 after the addition of the dump1090-fa option.
|
||||
# dump1090-fa and dump1090-mutability store aircraft.json in difrent locations.
|
||||
# However Lighttpd is set up to serve this file using the same URL no matter which version is installed.
|
||||
response = urllib2.urlopen('http://192.168.254.2/dump1090/data/aircraft.json')
|
||||
data = json.load(response)
|
||||
|
||||
processor.processAircraftList(data["aircraft"])
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue