kopia lustrzana https://github.com/jprochazka/adsb-receiver
Dump1090-fa portal fixes.
rodzic
a1cf2b3303
commit
90cd9efe4d
|
@ -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,26 +350,51 @@ 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
|
||||
|
||||
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
|
||||
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/" {
|
||||
url.access-deny = ( "" )
|
||||
}
|
||||
}
|
||||
# Set index file names.
|
||||
index-file.names = (
|
||||
"index.php", "index.html", "gmap.html"
|
||||
)
|
||||
EOF
|
||||
|
||||
if ! [ -L /etc/lighttpd/conf-enabled/89-adsb-portal.conf ]; then
|
||||
|
|
|
@ -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);
|
||||
?>
|
||||
|
|
|
@ -395,7 +395,6 @@ EOF;
|
|||
$common->addSetting('emailFrom', 'noreply@adsbreceiver.net');
|
||||
$common->addSetting('emailReplyTo', 'noreply@adsbreceiver.net');
|
||||
$common->addSetting('timeZone', $_POST['timeZone']);
|
||||
$common->addSetting('useDump1090FaMap', FALSE);
|
||||
|
||||
if ($_POST['driver'] == "xml")
|
||||
$common->addSetting('enableFlights', FALSE);
|
||||
|
|
|
@ -212,6 +212,10 @@
|
|||
|
||||
if ($common->getSetting("version") == "2.3.0") {
|
||||
try {
|
||||
|
||||
// Remove the dump1090-fa map selection setting.
|
||||
$common->deleteSetting('useDump1090FaMap');
|
||||
|
||||
$common->updateSetting("version", "2.4.0");
|
||||
$common->updateSetting("patch", "");
|
||||
} catch(Exception $e) {
|
||||
|
|
|
@ -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/}
|
||||
|
|
Ładowanie…
Reference in New Issue