Skip to content

Commit

Permalink
Merge pull request #270 from jprochazka/2.5.0
Browse files Browse the repository at this point in the history
2.5.0
  • Loading branch information
jprochazka authored Dec 6, 2016
2 parents b4f1ed3 + 2e7a575 commit 84bd030
Show file tree
Hide file tree
Showing 68 changed files with 2,518 additions and 470 deletions.
27 changes: 25 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,30 @@

The following is a history of the changes made to this project.

## v2.4.0
## v2.5.0

* 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)*
* Added script to automate the portal backup process.
* Added ability to specify the latitude and longitude of the receiver for dump978.
* Administrators can now specify custom links to be displayed within the portal.
* The loading speed for the flights page has been dramatically reduced. *(advanced)*
* When upgrading dump1090 the user is once again asked for the LAT and LON settings.
* Portal related python scripts are now located in the folder named python.
* A Google Maps API key can now be specified for use with portal maps.
* When setting up dump1090-mutability the user is asked for a Bing Maps API key.
* When setting up dump1090-mutability the user is asked for a Mapzen API key.
* Portal upgrade scripts have been split into multiple files.
* 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.
* The navigation bar for the default portal template has been modified to fit better.

## v2.4.0 *(September 27th, 2016)*

* Users can now choose to install dump1090-fa instead of dump1090-mutability.
* Scripts are now updated from the master branch each time install.sh is ran.
Expand All @@ -11,7 +34,7 @@ The following is a history of the changes made to this project.
* 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
## v2.3.0 *(September 15th, 2016)*

* Massive clean up and in some cases an overhaul of the installation bash scripts.
* Updated the dump978 map by modifying newer dump1090-mutability map.
Expand Down
14 changes: 14 additions & 0 deletions bash/decoders/dump1090-fa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,20 @@ fi

## DUMP1090-FA POST INSTALLATION CONFIGURATION

# Ask for a Bing Maps API key.
BINGMAPSKEY=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --title "Bing Maps API Key" --nocancel --inputbox "\nProvide a Bing Maps API key here to enable the Bing imagery layer.\nYou can obtain a free key at https://www.bingmapsportal.com/\n\nProviding a Bing Maps API key is not required to continue." 11 78 `GetConfig "BingMapsAPIKey" "/usr/share/dump1090-mutability/html/config.js"` 3>&1 1>&2 2>&3)
if [[ ! -z $BINGMAPSKEY ]]; then
echo -e "\e[94m Setting the Bing Maps API Key to $BINGMAPSKEY...\e[97m"
ChangeConfig "BingMapsAPIKey" "$BINGMAPSKEY" "/usr/share/dump1090-fa/html/config.js"
fi

# Ask for a Mapzen API key.
MAPZENKEY=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --title "Mapzen API Key" --nocancel --inputbox "\nProvide a Mapzen API key here to enable the Mapzen vector tile layer within the dump1090-mutability map. You can obtain a free key at https://mapzen.com/developers/\n\nProviding a Mapzen API key is not required to continue." 13 78 `GetConfig "MapzenAPIKey" "/usr/share/dump1090-mutability/html/config.js"` 3>&1 1>&2 2>&3)
if [[ ! -z $MAPZENKEY ]]; then
echo -e "\e[94m Setting the Mapzen API Key to $MAPZENKEY...\e[97m"
ChangeConfig "MapzenAPIKey" "$MAPZENKEY" "/usr/share/dump1090-fa/html/config.js"
fi

# Download Heywhatsthat.com maximum range rings.
if [ ! -f /usr/share/dump1090-fa/html/upintheair.json ] && (whiptail --backtitle "$ADSB_PROJECTTITLE" --title "Heywhaststhat.com Maimum Range Rings" --yesno "Maximum range rings can be added to dump1090-fa usings data obtained from Heywhatsthat.com. In order to add these rings to your dump1090-fa map you will first need to visit http://www.heywhatsthat.com and generate a new panarama centered on the location of your receiver. Once your panarama has been generated a link to the panarama will be displayed in the up left hand portion of the page. You will need the view id which is the series of letters and/or numbers after \"?view=\" in this URL.\n\nWould you like to add heywatsthat.com maximum range rings to your map?" 16 78); then
HEYWHATSTHATID_TITLE="Heywhatsthat.com Panarama ID"
Expand Down
61 changes: 43 additions & 18 deletions bash/decoders/dump1090-mutability.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ else
echo -e "\e[94m Cloning the dump1090-mutability git repository locally...\e[97m"
echo ""
git clone https://github.com/mutability/dump1090.git
echo ""
fi

## BUILD AND INSTALL THE DUMP1090-MUTABILITY PACKAGE
Expand Down Expand Up @@ -148,26 +147,42 @@ fi
echo ""
echo -e "\e[95m Begining post installation configuration...\e[97m"
echo ""
if [[ `GetConfig "LAT" "/etc/default/dump1090-mutability"` == "" ]] || [[ `GetConfig "LON" "/etc/default/dump1090-mutability"` == "" ]]; then
whiptail --backtitle "$ADSB_PROJECTTITLE" --title "Receiver Latitude and Longitude" --msgbox "Your receivers latitude and longitude are required for certain features to function properly. You will now be asked to supply the latitude and longitude for your receiver. If you do not have this information you get it by using the web based \"Geocode by Address\" utility hosted on another of my websites.\n\n https://www.swiftbyte.com/toolbox/geocode" 13 78
RECEIVERLATITUDE_TITLE="Receiver Latitude"
while [[ -z $RECEIVERLATITUDE ]]; do
RECEIVERLATITUDE=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --title "$RECEIVERLATITUDE_TITLE" --nocancel --inputbox "\nEnter your receiver's latitude.\n(Example: XX.XXXXXXX)" 9 78 3>&1 1>&2 2>&3)
RECEIVERLATITUDE_TITLE="Receiver Latitude (REQUIRED)"
done
RECEIVERLONGITUDE_TITLE="Receiver Longitude"
while [[ -z $RECEIVERLONGITUDE ]]; do
RECEIVERLONGITUDE=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --title "$RECEIVERLONGITUDE_TITLE" --nocancel --inputbox "\nEnter your receeiver's longitude.\n(Example: XX.XXXXXXX)" 9 78 3>&1 1>&2 2>&3)
RECEIVERLONGITUDE_TITLE="Receiver Longitude (REQUIRED)"
done
echo -e "\e[94m Setting the receiver's latitude to $RECEIVERLATITUDE...\e[97m"
ChangeConfig "LAT" $RECEIVERLATITUDE "/etc/default/dump1090-mutability"
echo -e "\e[94m Setting the receiver's longitude to $RECEIVERLONGITUDE...\e[97m"
ChangeConfig "LON" $RECEIVERLONGITUDE "/etc/default/dump1090-mutability"
whiptail --backtitle "$ADSB_PROJECTTITLE" --title "Receiver Latitude and Longitude" --msgbox "Your receivers latitude and longitude are required for certain features to function properly. You will now be asked to supply the latitude and longitude for your receiver. If you do not have this information you get it by using the web based \"Geocode by Address\" utility hosted on another of my websites.\n\n https://www.swiftbyte.com/toolbox/geocode" 13 78
RECEIVERLATITUDE_TITLE="Receiver Latitude"
while [[ -z $RECEIVERLATITUDE ]]; do
RECEIVERLATITUDE=`GetConfig "LAT" "/etc/default/dump1090-mutability"`
RECEIVERLATITUDE=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --title "$RECEIVERLATITUDE_TITLE" --nocancel --inputbox "\nEnter your receiver's latitude.\n(Example: XX.XXXXXXX)" 9 78 " $RECEIVERLATITUDE" 3>&1 1>&2 2>&3)
RECEIVERLATITUDE_TITLE="Receiver Latitude (REQUIRED)"
done
RECEIVERLONGITUDE_TITLE="Receiver Longitude"
while [[ -z $RECEIVERLONGITUDE ]]; do
RECEIVERLONGITUDE=`GetConfig "LON" "/etc/default/dump1090-mutability"`
RECEIVERLONGITUDE=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --title "$RECEIVERLONGITUDE_TITLE" --nocancel --inputbox "\nEnter your receeiver's longitude.\n(Example: XX.XXXXXXX)" 9 78 " $RECEIVERLONGITUDE" 3>&1 1>&2 2>&3)
RECEIVERLONGITUDE_TITLE="Receiver Longitude (REQUIRED)"
done

echo -e "\e[94m Setting the receiver's latitude to $RECEIVERLATITUDE...\e[97m"

ChangeConfig "LAT" "$(sed -e 's/[[:space:]]*$//' <<<${RECEIVERLATITUDE})" "/etc/default/dump1090-mutability"
echo -e "\e[94m Setting the receiver's longitude to $RECEIVERLONGITUDE...\e[97m"
ChangeConfig "LON" "$(sed -e 's/[[:space:]]*$//' <<<${RECEIVERLONGITUDE})" "/etc/default/dump1090-mutability"

# Ask for a Bing Maps API key.
BINGMAPSKEY=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --title "Bing Maps API Key" --nocancel --inputbox "\nProvide a Bing Maps API key here to enable the Bing imagery layer.\nYou can obtain a free key at https://www.bingmapsportal.com/\n\nProviding a Bing Maps API key is not required to continue." 12 78 `GetConfig "BingMapsAPIKey" "/usr/share/dump1090-mutability/html/config.js"` 3>&1 1>&2 2>&3)
if [[ ! -z $BINGMAPSKEY ]]; then
echo -e "\e[94m Setting the Bing Maps API Key to $BINGMAPSKEY...\e[97m"
ChangeConfig "BingMapsAPIKey" "$BINGMAPSKEY" "/usr/share/dump1090-mutability/html/config.js"
fi

# Ask for a Mapzen API key.
MAPZENKEY=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --title "Mapzen API Key" --nocancel --inputbox "\nProvide a Mapzen API key here to enable the Mapzen vector tile layer within the dump1090-mutability map. You can obtain a free key at https://mapzen.com/developers/\n\nProviding a Mapzen API key is not required to continue." 13 78 `GetConfig "MapzenAPIKey" "/usr/share/dump1090-mutability/html/config.js"` 3>&1 1>&2 2>&3)
if [[ ! -z $MAPZENKEY ]]; then
echo -e "\e[94m Setting the Mapzen API Key to $MAPZENKEY...\e[97m"
ChangeConfig "MapzenAPIKey" "$MAPZENKEY" "/usr/share/dump1090-mutability/html/config.js"
fi

# 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
Expand All @@ -176,6 +191,16 @@ else
ChangeConfig "NET_BIND_ADDRESS" "127.0.0.1" "/etc/default/dump1090-mutability"
fi

# Ask if measurments should be displayed using imperial or metric.
UNITOFMEASUREMENT=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --title "Unit of Measurement" --nocancel --menu "\nChoose unit of measurement to be used by dump1090-mutbility." 11 78 2 "Imperial" "" "Metric" "" 3>&1 1>&2 2>&3)
if [ $UNITOFMEASUREMENT = "Metric" ]; then
echo -e "\e[94m Setting dump1090-mutability unit of measurement to Metric...\e[97m"
ChangeConfig "Metric" "false" "/usr/share/dump1090-mutability/html/config.js"
else
echo -e "\e[94m Setting dump1090-mutability unit of measurement to Imperial...\e[97m"
ChangeConfig "Metric" "true" "/usr/share/dump1090-mutability/html/config.js"
fi

# Download Heywhatsthat.com maximum range rings.
if [ ! -f /usr/share/dump1090-mutability/html/upintheair.json ] && (whiptail --backtitle "$ADSB_PROJECTTITLE" --title "Heywhaststhat.com Maimum Range Rings" --yesno "Maximum range rings can be added to dump1090-mutability usings data obtained from Heywhatsthat.com. In order to add these rings to your dump1090-mutability map you will first need to visit http://www.heywhatsthat.com and generate a new panarama centered on the location of your receiver. Once your panarama has been generated a link to the panarama will be displayed in the up left hand portion of the page. You will need the view id which is the series of letters and/or numbers after \"?view=\" in this URL.\n\nWould you like to add heywatsthat.com maximum range rings to your map?" 16 78); then
HEYWHATSTHATID_TITLE="Heywhatsthat.com Panarama ID"
Expand Down
31 changes: 27 additions & 4 deletions bash/decoders/dump978.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ if [ $(dpkg-query -W -f='${STATUS}' dump1090-mutability 2>/dev/null | grep -c "o
echo ""
sudo /etc/init.d/dump1090-mutability restart
echo ""

# Get the latitude and longitude set in the dump1090-mutability configuration file to be used later.
echo -e "\e[94m Retrieving the receiver's latitude from /etc/default/dump1090-mutability...\e[97m"
RECEIVERLATITUDE=`GetConfig "LAT" "/etc/default/dump1090-mutability"`
echo -e "\e[94m Retrieving the receiver's longitude from /etc/default/dump1090-mutability...\e[97m"
RECIEVERLONGITUDE=`GetConfig "LON" "/etc/default/dump1090-mutability"`
fi

# If a device has not yet been assigned to dump978 assign the first available.
Expand All @@ -181,10 +187,29 @@ if [ -z $DUMP978DEVICE ]; then
DUMP978DEVICE="0"
fi

# Create the dump978 JSON directory in Lighttpd's document root.
# Declare the LIGHTTPDDOCUMENTROOTDIRECTORY variable.
echo -e "\e[94m Getting the path to Lighttpd's document root...\e[97m"
LIGHTTPDDOCUMENTROOTSETTING=`/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -p | grep server.document-root`
LIGHTTPDDOCUMENTROOTDIRECTORY=`sed 's/.*"\(.*\)"[^"]*$/\1/' <<< $LIGHTTPDDOCUMENTROOTSETTING`
# Set the receivers latitude and longitude.
if [ -z $RECEIVERLATITUDE ] && [ -z $RECEIVERLONGITUDE ]; then
# If dump1090-mutability is not installed ask for the latitude and longitude of this receiver.
RECEIVERLATITUDE=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --title "Receiver Latitude (OPTIONAL)" --nocancel --inputbox "\nEnter your receiver's latitude.\n(Example: XX.XXXXXXX)\n\nLeave blank and select <Ok> to skip." 12 78 3>&1 1>&2 2>&3)
RECEIVERLONGITUDE_TITLE="Receiver Longitude"
while [[ -z $RECEIVERLONGITUDE ]]; do
RECEIVERLONGITUDE=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --title "$RECEIVERLONGITUDE_TITLE" --nocancel --inputbox "\nEnter your receeiver's longitude.\n(Example: XX.XXXXXXX)" 9 78 3>&1 1>&2 2>&3)
RECEIVERLONGITUDE_TITLE="Receiver Longitude (REQUIRED)"
done
fi
if [ ! -z $RECEIVERLATITUDE ] && [ ! -z $RECEIVERLONGITUDE ]; then
echo -e "\e[94m Setting the receiver's latitude to $RECEIVERLATITUDE...\e[97m"
ChangeConfig "SiteLat" "$RECEIVERLATITUDE" "$LIGHTTPDDOCUMENTROOTDIRECTORY/dump978/config.js"
echo -e "\e[94m Setting the receiver's longitude to $RECEIVERLONGITUDE...\e[97m"
ChangeConfig "SiteLon" "$RECEIVERLONGITUDE" "$LIGHTTPDDOCUMENTROOTDIRECTORY/dump978/config.js"
fi
# Create the dump978 JSON directory in Lighttpd's document root.
echo -e "\e[94m Creating the dump978 JSON data directory within Lighttpd's document root...\e[97m"
sudo mkdir -p $LIGHTTPDDOCUMENTROOTDIRECTORY/dump978/data
echo -e "\e[94m Setting permissions for the dump978 JSON data directory within Lighttpd's document root...\e[97m"
Expand Down Expand Up @@ -212,15 +237,13 @@ if ! grep -Fxq "$DUMP978BUILDDIRECTORY/dump978-maint.sh &" /etc/rc.local; then
((LINENUMBER>0)) && sudo sed -i "${LINENUMBER[$((${#LINENUMBER[@]}-1))]}i ${DUMP978BUILDDIRECTORY}/dump978-maint.sh &\n" /etc/rc.local
fi
exit 0
## EXECUTE THE MAINTAINANCE SCRIPT TO START DUMP978
echo ""
echo -e "\e[95m Starting dump978...\e[97m"
echo ""
echo -e "\e[94m Starting dump978 by executing the dump978 maintenance script...\e[97m"
sudo $DUMP978BUILDDIRECTORY/dump978-maint.sh > /dev/null &
sudo nohup $DUMP978BUILDDIRECTORY/dump978-maint.sh > /dev/null 2>&1 &
## DUMP978 SETUP COMPLETE
Expand Down
Loading

0 comments on commit 84bd030

Please sign in to comment.