Untested installation modifications.

pull/67/head
Joe Prochazka 2016-01-22 16:07:08 -05:00
rodzic 8845c63032
commit 36072f27ce
4 zmienionych plików z 48 dodań i 163 usunięć

Wyświetl plik

@ -1,45 +0,0 @@
#!/bin/bash
#####################################################################################
# ADS-B FEEDER #
#####################################################################################
# #
# This script is not meant to be executed directly. #
# Instead execute install.sh to begin the installation process. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# Copyright (c) 2015 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. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
BUILDDIR=$PWD
# Assign the Lighthttpd document root directory to a variable.
RAWDOCUMENTROOT=`/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -p | grep server.document-root`
DOCUMENTROOT=`sed 's/.*"\(.*\)"[^"]*$/\1/' <<< $RAWDOCUMENTROOT`
## PLACE HTML FILES IN LIGHTTPD'S WWW ROOT
echo -e "\033[33m"
echo "Placing homepage HTML file in Lighttpd's www root directory..."
echo -e "\033[37m"
sudo cp -r $BUILDDIR/portal/map/html/* ${DOCUMENTROOT}/

Wyświetl plik

@ -33,6 +33,11 @@
BUILDDIR=$PWD BUILDDIR=$PWD
BASHDIR=$BUILDDIR/../bash BASHDIR=$BUILDDIR/../bash
HTMLDIR=$BUILDDIR/portal/html
# Assign the Lighthttpd document root directory to a variable.
RAWDOCUMENTROOT=`/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -p | grep server.document-root`
DOCUMENTROOT=`sed 's/.*"\(.*\)"[^"]*$/\1/' <<< $RAWDOCUMENTROOT`
source ../bash/functions.sh source ../bash/functions.sh
@ -40,9 +45,9 @@ clear
echo -e "\033[31m" echo -e "\033[31m"
echo "-------------------------------------------" echo "-------------------------------------------"
echo " Now ready to install dump1090-portal." echo " Now ready to install ADS-B Portal."
echo "-------------------------------------------" echo "-------------------------------------------"
echo -e "\033[33mThe goal of the dump1090-portal portal project is to create a very" echo -e "\033[33mThe goal of the ADS-B Portal project is to create a very"
echo "light weight easy to manage web interface for dump-1090 installations" echo "light weight easy to manage web interface for dump-1090 installations"
echo "This project is at the moment very young with only a few of the planned" echo "This project is at the moment very young with only a few of the planned"
echo "featured currently available at this time." echo "featured currently available at this time."
@ -62,32 +67,57 @@ CheckPackage cron
CheckPackage collectd CheckPackage collectd
CheckPackage rrdtool CheckPackage rrdtool
echo -e "\033[33m" ## SETUP THE PORTAL WEBSITE
echo "Installing homepage..."
echo -e "\033[37m"
chmod +x $BASHDIR/portal/homepage.sh
$BASHDIR/portal/homepage.sh
echo -e "\033[33m" echo -e "\033[33m"
echo "Installing map container..." echo "Setting up performance graphs..."
echo -e "\033[37m"
chmod +x $BASHDIR/portal/map.sh
$BASHDIR/portal/map.sh
echo -e "\033[33m"
echo "Installing performance graphs..."
echo -e "\033[37m" echo -e "\033[37m"
chmod +x $BASHDIR/portal/graphs.sh chmod +x $BASHDIR/portal/graphs.sh
$BASHDIR/portal/graphs.sh $BASHDIR/portal/graphs.sh
if [ $(dpkg-query -W -f='${STATUS}' pfclient 2>/dev/null | grep -c "ok installed") -eq 1 ]; then if [ $(dpkg-query -W -f='${STATUS}' pfclient 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
echo -e "\033[33m" echo -e "\033[33m"
echo "Installing performance graphs..." echo -e "Inserting the Planefinder ADS-B Client links...\033[37m"
echo -e "\033[37m"
chmod +x $BASHDIR/portal/planefinder.sh PLACEHOLDER="<!-- Plane Finder ADS-B Client Link Placeholder -->"
$BASHDIR/portal/planefinder.sh IPADDRESS=`ip addr | grep 'state UP' -A2 | tail -n1 | awk -F'[/ ]+' '{print $3}'`
HTMLLINK="<li id=\"planefinder-link\"><a href=\"http://${IPADDRESS}:30053\">Plane Finder Client</a></li>"
sudo sed -i "s@${PLACEHOLDER}@${HTMLLINK}@g" ${HTMLDIR}/templates/default/master.tpl.php
fi fi
echo -e "\033[33m"
echo -e "Placing portal files in Lighttpd's root directory...\033[37m"
sudo cp -R ${HTMLDIR}/* ${DOCUMENTROOT}
echo -e "\033[33m"
echo -e "Setting permissions on data files...\033[37m"
sudo chmod +w ${DOCUMENTROOT}/data/*.xml
echo -e "\033[33m"
echo -e "Removing conflicting redirect from the Lighttpd dump1090.conf file...\033[37m"
# Remove this line completely.
sudo sed "/$(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 "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
echo -e "\033[33m"
echo -e "Configuring Lighttpd...\033[37m"
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 = ( "" )
}
}
EOF
echo -e "\033[33m"
echo "Restarting Lighttpd..."
echo -e "\033[37m"
sudo /etc/init.d/lighttpd restart
## SETUP COMPLETE
echo -e "\033[33m" echo -e "\033[33m"
echo "Installation and configuration of the performance graphs is now complete." echo "Installation and configuration of the performance graphs is now complete."
echo "Please look over the output generated to be sure no errors were encountered." echo "Please look over the output generated to be sure no errors were encountered."

Wyświetl plik

@ -1,48 +0,0 @@
#!/bin/bash
#####################################################################################
# ADS-B FEEDER #
#####################################################################################
# #
# This script is not meant to be executed directly. #
# Instead execute install.sh to begin the installation process. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# Copyright (c) 2015 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. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
BUILDDIR=$PWD
# Assign the Lighthttpd document root directory to a variable.
RAWDOCUMENTROOT=`/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -p | grep server.document-root`
DOCUMENTROOT=`sed 's/.*"\(.*\)"[^"]*$/\1/' <<< $RAWDOCUMENTROOT`
## PLACE HTML FILES IN LIGHTTPD'S WWW ROOT
echo -e "\033[33m"
echo "Placing map HTML file in Lighttpd's www root directory..."
echo -e "\033[37m"
if [ ! -d "${DOCUMENTROOT}/map" ]; then
sudo mkdir ${DOCUMENTROOT}/map
fi
sudo cp -r $BUILDDIR/portal/map/html/* ${DOCUMENTROOT}/map/

Wyświetl plik

@ -1,52 +0,0 @@
#!/bin/bash
#####################################################################################
# ADS-B FEEDER #
#####################################################################################
# #
# This script is not meant to be executed directly. #
# Instead execute install.sh to begin the installation process. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# Copyright (c) 2015 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. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
BUILDDIR=$PWD
# Assign the Lighthttpd document root directory to a variable.
RAWDOCUMENTROOT=`/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -p | grep server.document-root`
DOCUMENTROOT=`sed 's/.*"\(.*\)"[^"]*$/\1/' <<< $RAWDOCUMENTROOT`
# ADD LOCAL PLANEFINDER INTERFACE LINK
echo -e "\033[33m"
echo "Adding links to the Plane Finder ADS-B Client web interface to the portal pages..."
echo -e "\033[37m"
PLACEHOLDER="<!-- Plane Finder ADS-B Client Link Placeholder -->"
IPADDRESS=`ip addr | grep 'state UP' -A2 | tail -n1 | awk -F'[/ ]+' '{print $3}'`
HTMLLINK="<li id=\"planefinder-link\"><a href=\"http://${IPADDRESS}:30053\">Plane Finder Client</a></li>"
sudo sed -i "s@${PLACEHOLDER}@${HTMLLINK}@g" ${DOCUMENTROOT}/index.html
sudo sed -i "s@${PLACEHOLDER}@${HTMLLINK}@g" ${DOCUMENTROOT}/map/index.html
sudo sed -i "s@${PLACEHOLDER}@${HTMLLINK}@g" ${DOCUMENTROOT}/graphs/index.html