Fixes to admin addition.

pull/67/head
Joe Prochazka 2016-01-24 00:09:19 -05:00
rodzic 1990201696
commit 5c753695b0
5 zmienionych plików z 110 dodań i 114 usunięć

Wyświetl plik

@ -33,10 +33,6 @@
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`
## MODIFY THE DUMP1090-MUTABILITY INIT SCRIPT TO MEASURE AND RETAIN NOISE DATA
echo -e "\033[33m"
@ -191,16 +187,6 @@ echo -e "\033[33mReloading collectd so the new configuration is used..."
echo -e "\033[37m"
sudo /etc/init.d/collectd force-reload
## PLACE HTML FILES IN LIGHTTPD'S WWW ROOT
echo -e "\033[33m"
echo "Placing performance graph HTML file in Lighttpd's www root directory..."
echo -e "\033[37m"
if [ ! -d "${DOCUMENTROOT}/graphs" ]; then
sudo mkdir ${DOCUMENTROOT}/graphs
fi
sudo cp -r $BUILDDIR/portal/graphs/html/* ${DOCUMENTROOT}/graphs/
## EDIT CRONTAB
echo -e "\033[33mAdding jobs to crontab..."
@ -209,7 +195,7 @@ if [ -f /etc/cron.d/adsb-feeder-performance-graphs ]; then
sudo rm -f /etc/cron.d/adsb-feeder-performance-graphs
fi
echo -e "\033[37m"
chmod 755 $BUILDDIR/portal/graphs/make-collectd-graphs.sh
chmod +x $BUILDDIR/portal/graphs/make-collectd-graphs.sh
sudo tee -a /etc/cron.d/adsb-feeder-performance-graphs > /dev/null <<EOF
# Updates the portal's performance graphs.
#
@ -224,8 +210,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
*/5 * * * * root bash ${BUILDDIR}/portal/graphs/make-collectd-graphs.sh 1h >/dev/null
*/10 * * * * root bash ${BUILDDIR}/portal/graphs/make-collectd-graphs.sh 6h >/dev/null
2,12,22,32,42,52 * * * * root bash ${BUILDDIR}/portal/graphs/make-collectd-graphs.sh 24h 180 >/dev/null
4,24,44 * * * * root bash ${BUILDDIR}/portal/graphs/make-collectd-graphs.sh 7d 1200 >/dev/null
6 * * * * root bash ${BUILDDIR}/portal/graphs/make-collectd-graphs.sh 30d 5400 >/dev/null
8 */12 * * * root bash ${BUILDDIR}/portal/graphs/make-collectd-graphs.sh 365d 86400 >/dev/null
2,12,22,32,42,52 * * * * root bash ${BUILDDIR}/portal/graphs/make-collectd-graphs.sh 24h >/dev/null
4,24,44 * * * * root bash ${BUILDDIR}/portal/graphs/make-collectd-graphs.sh 7d >/dev/null
6 * * * * root bash ${BUILDDIR}/portal/graphs/make-collectd-graphs.sh 30d >/dev/null
8 */12 * * * root bash ${BUILDDIR}/portal/graphs/make-collectd-graphs.sh 365d >/dev/null
EOF

Wyświetl plik

@ -71,12 +71,6 @@ CheckPackage php5-cgi
## SETUP THE PORTAL WEBSITE
echo -e "\033[33m"
echo "Setting up performance graphs..."
echo -e "\033[37m"
chmod +x $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
echo -e "\033[33m"
echo -e "Inserting the Planefinder ADS-B Client links...\033[37m"
@ -91,6 +85,16 @@ 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 "Setting permissions on graphs folder...\033[37m"
chmod +w ${DOCUMENTROOT}/graphs/
echo -e "\033[33m"
echo "Setting up performance graphs..."
echo -e "\033[37m"
chmod +x $BASHDIR/portal/graphs.sh
$BASHDIR/portal/graphs.sh
## CHECK IF DUMP978 HAS BEEN BUILT
if [ -f $BUILDDIR/dump978/dump978 ] && [ -f $BUILDDIR/dump978/uat2text ] && [ -f $BUILDDIR/dump978/uat2esnt ] && [ -f $BUILDDIR/dump978/uat2json ]; then
@ -156,21 +160,25 @@ 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
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 "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
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
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/" {
\$HTTP["remoteip"] !~ "127.0.0.1" {
\$HTTP["url"] =~ "^/data/" {
url.access-deny = ( "" )
}
}
EOF
echo -e "\033[33m"
echo -e "Enabling Lighttpd portal configuration...\033[37m"
sudo ln -s /etc/lighttpd/conf-available/89-adsb-portal.conf /etc/lighttpd/conf-enabled/89-adsb-portal.conf
echo -e "\033[33m"
echo -e "Enabling the Lighttpd fastcgi-php module...\033[37m"
sudo lighty-enable-mod fastcgi-php
@ -178,9 +186,11 @@ sudo lighty-enable-mod fastcgi-php
echo -e "\033[33m"
if pgrep "lighttpd" > /dev/null; then
echo "Reloading Lighttpd..."
echo -e "\033[37m"
sudo /etc/init.d/lighttpd force-reload
else
echo "Starting Lighttpd..."
echo -e "\033[37m"
sudo /etc/init.d/lighttpd start
fi

Wyświetl plik

@ -166,27 +166,27 @@
<div class="panel-body">
<div class="checkbox">
<label>
<input type="checkbox" name="enableInfo" value="TRUE"<?php ($enableInfo == TRUE ? print ' checked' : ''); ?>> Enable system information link.
<input type="checkbox" name="enableInfo" value="TRUE"<?php ($enableInfo == 1 ? print ' checked' : ''); ?>> Enable system information link.
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="enableGraphs" value="TRUE"<?php ($enableGraphs == TRUE ? print ' checked' : ''); ?>> Enable performance graphs link.
<input type="checkbox" name="enableGraphs" value="TRUE"<?php ($enableGraphs == 1 ? print ' checked' : ''); ?>> Enable performance graphs link.
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="enableDump1090" value="TRUE"<?php ($enableDump1090 == TRUE ? print ' checked' : ''); ?>> Enable live dump1090 map link.
<input type="checkbox" name="enableDump1090" value="TRUE"<?php ($enableDump1090 == 1 ? print ' checked' : ''); ?>> Enable live dump1090 map link.
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="enableDump978" value="TRUE"<?php ($enableDump978 == TRUE ? print ' checked' : ''); ?>> Enable live dump978 map link.
<input type="checkbox" name="enableDump978" value="TRUE"<?php ($enableDump978 == 1 ? print ' checked' : ''); ?>> Enable live dump978 map link.
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="enablePfclient" value="TRUE"<?php ($enablePfclient == TRUE ? print ' checked' : ''); ?>> Enable Planfinder ADS-B Client link.
<input type="checkbox" name="enablePfclient" value="TRUE"<?php ($enablePfclient == 1 ? print ' checked' : ''); ?>> Enable Planfinder ADS-B Client link.
</label>
</div>
</div>

Wyświetl plik

@ -3,6 +3,6 @@
<administrator>
<login>admin</login>
<password>$2y$10$uDSOA6NhbgmtMAiNp.QAROD/PG6RUQE/m0xp6fRgo5/TBkMWxReBq</password>
<firstLogin>FALSE</firstLogin>>
<firstLogin>FALSE</firstLogin>
</administrator>
</administrators>

Wyświetl plik

@ -48,11 +48,11 @@
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<?php ($enableInfo ? print '<li id="system-link"><a href="/system.php">System Information</a></li>' : ''); ?>
<?php ($enableGraphs ? print '<li id="graphs-link"><a href="/graphs.php">Performance Graphs</a></li>' : ''); ?>
<?php ($enableDump1090 ? print '<li id="dump1090-link"><a href="/dump1090.php">Live Dump1090 Map</a></li>' : ''); ?>
<?php ($enableDump978 ? print '<li id="dump978-link"><a href="/dump978.php">Live Dump978 Map</a></li>' : ''); ?>
<?php ($enablePfclient ? print '<!-- Plane Finder ADS-B Client Link Placeholder -->' : ''); ?>
<?php ($enableInfo == 1 ? print '<li id="system-link"><a href="/system.php">System Information</a></li>' : ''); ?>
<?php ($enableGraphs == 1 ? print '<li id="graphs-link"><a href="/graphs.php">Performance Graphs</a></li>' : ''); ?>
<?php ($enableDump1090 == 1 ? print '<li id="dump1090-link"><a href="/dump1090.php">Live Dump1090 Map</a></li>' : ''); ?>
<?php ($enableDump978 == 1 ? print '<li id="dump978-link"><a href="/dump978.php">Live Dump978 Map</a></li>' : ''); ?>
<?php ($enablePfclient == 1 ? print '<!-- Plane Finder ADS-B Client Link Placeholder -->' : ''); ?>
</ul>
</div>
</div>