diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ef4d4e..37ae3c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,20 @@ The following is a history of the changes made to this project. -## v2.8.0 *(June 24th, 2024)* +## v2.8.1 *(in development)* :hatched_chick: ### Installers +* Plane Finder Feeder now installs properly on aarch64 operating systems. + +### Portal + +* Fix problem where multiple instances of flights.py and maintenance.py were being launched. +* Addressed portal map centering settings not being added to the database on fresh installs. +* An issue was addressed allowing existing receivers to upgrade to phoenix properly. + +## v2.8.0 *(June 24th, 2024)* :hatching_chick: + * The dump1090-fa and piaware_builder install process has been updated to support the latest versions. * The dump978 script has been rewritten in order to use FlightAwares version of dump978. * The Beast Splitter script has been updated to work with the current version of Beast Splitter. @@ -22,9 +32,6 @@ The following is a history of the changes made to this project. * Removed the option to install AboveTustin. * Removed the option to install ADSBHub support due to the fact it was incomplete. * Removed incomplete RTL-SDR OGN setup scripting. - -### Portal - * The portal install scripts have been updated to work on current operation systems. * All portal related Python scripts have been updated to work with Python 3. * TinyMCE has been replace by CKeditor in the portal. diff --git a/CREDITS.md b/CREDITS.md index 727fc20..a9b9dce 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -7,26 +7,34 @@ directly. Their time and effort is greatly appreciated by myself as well as many **Direct Contributors** -* @adamkaplan -* @atbPy -* @charlie-foxtrot -* @dschaper -* @g0wfv +* @mgunther68 * @jdwall * @leearmstrong -* @mgunther68 -* @Romeo-Golf -* @target-drone -* @vitaliy-sk * @wiedehopf +* @vitaliy-sk +* @target-drone +* @dschaper +* @adamkaplan +* @charlie-foxtrot +* @jsloyer +* @kylegordon +* @BudBundi +* @kuchel77 +* @atbPy +* @g0wfv +* @ttsak +* @mkrzysztofowicz +* @espinielli +* @bitpixdigital +* @Romeo-Golf +* @g0wfv I would like to thank the members and contributors to the following forums for all the time and effort they have put in in order to create a useful and informative place to discuss aircraft tracking. -* The ADS-B Receiver Project Forums: https://www.adsbreceiver.net * The FlightAware Forums: http://discussions.flightaware.com * The PlaneFinder Forums: http://forum.planefinder.net -* The ADS-B Exchange Forums: http://www.adsbexchange.com/forums/ +* The ADS-B Exchange Forums: https://adsbx.discourse.group The performance graphs were created thanks in part to the great contributions made by members of both the FlightAware and PlaneFinder communities. Through their examples and help posted to the following @@ -37,15 +45,12 @@ threads myself and a couple contributors were able to add these very informative ## Third Party Software -Thanks to the people over at JetBrains for the complementary licenses for PhpStorm and PyCharms which -is being used to develop the portal portion of this project. https://www.jetbrains.com - -I would also like to thank the developers and contributors to the following projects. Without their +I would like to thank the developers and contributors to the following projects. Without their hard work and dedication this project would not have been possible. * Dump1090 (fa): https://github.com/flightaware/dump1090 * Dump978 (fa): https://github.com/flightaware/dump978 -* FlightAware's PiAware: http://flightaware.com +* FlightAware's PiAware: https://github.com/flightaware/piaware * Plane Finder ADS-B Client: https://planefinder.net * Flightradar24 Client: https://www.flightradar24.com * Dump1090-Tools: https://github.com/mutability/dump1090-tools diff --git a/LICENSE.md b/LICENSE.md index dbaa60b..abf87f9 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015-2017 Joseph A. Prochazka +Copyright (c) 2015-2024 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 diff --git a/bash/feeders/planefinder.sh b/bash/feeders/planefinder.sh index 359cf20..a74f878 100755 --- a/bash/feeders/planefinder.sh +++ b/bash/feeders/planefinder.sh @@ -65,6 +65,15 @@ fi echo -e "\e[95m Installing packages needed to fulfill dependencies for PlaneFinder ADS-B Client...\e[97m" echo -e "" CheckPackage wget + +# Some architectures require additional packages. +case "${CPU_ARCHITECTURE}" in + "aarch64") + echo -e "\e[94m Adding support for the armhf architecture...\e[97m" + sudo dpkg --add-architecture armhf + CheckPackage libc6:armhf + ;; +esac echo "" ### DETERMINE WHICH PACACKAGE TO INSTALL diff --git a/bash/portal/install.sh b/bash/portal/install.sh index db11209..0cf8279 100755 --- a/bash/portal/install.sh +++ b/bash/portal/install.sh @@ -382,20 +382,11 @@ url.redirect += ( "^/dump1090$" => "/dump1090/" ) # Add CORS header -server.modules += ( "mod_setenv" ) \$HTTP["url"] =~ "^/dump1090/data/.*\.json$" { setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" ) } EOF fi -sudo tee -a /etc/lighttpd/conf-available/87-adsb-portal.conf > /dev/null < /dev/null <pdoOpen(); $sql = "DELETE FROM ".$settings::db_prefix."flightNotifications WHERE flight = :flight"; $sth = $dbh->prepare($sql); diff --git a/build/portal/html/classes/template.class.php b/build/portal/html/classes/template.class.php index 29bc1a1..ee22e50 100644 --- a/build/portal/html/classes/template.class.php +++ b/build/portal/html/classes/template.class.php @@ -7,7 +7,7 @@ // // // The MIT License (MIT) // // // - // Copyright (c) 2015-2019 Joseph A. Prochazka // + // Copyright (c) 2015-2024 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 // @@ -37,7 +37,7 @@ // Check if the portal is installed or needs upgraded. - $thisVersion = "2.8.0"; + $thisVersion = "2.8.1"; if (!file_exists($_SERVER['DOCUMENT_ROOT']."/classes/settings.class.php")) { header ("Location: /install/install.php"); diff --git a/build/portal/html/install/index.php b/build/portal/html/install/index.php index 42b2808..44c8054 100644 --- a/build/portal/html/install/index.php +++ b/build/portal/html/install/index.php @@ -7,7 +7,7 @@ // // // The MIT License (MIT) // // // - // Copyright (c) 2015-2019 Joseph A. Prochazka // + // Copyright (c) 2015-2024 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 // @@ -29,7 +29,7 @@ ///////////////////////////////////////////////////////////////////////////////////// // The most current stable release. - $thisVersion = "2.8.0"; + $thisVersion = "2.8.1"; // Begin the upgrade process if this release is newer than what is installed. if (file_exists($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."settings.class.php")) { @@ -398,11 +398,11 @@ EOF; $sth = $dbh->prepare($settingsSql); $sth->execute(); $sth = NULL; - + $sth = $dbh->prepare($aircraftIndexSql); $sth->execute(); $sth = NULL; - + $sth = $dbh->prepare($positionsIndexSql); $sth->execute(); $sth = NULL; @@ -444,6 +444,8 @@ EOF; $common->addSetting('googleMapsApiKey', ''); $common->addSetting("hideNavbarAndFooter", FALSE); $common->addSetting("purgeAircraft", FALSE); + $common->addSetting("advancedMapCenterLatitude", "41.3683798"); + $common->addSetting("advancedMapCenterLongitude", "-82.1076486"); if ($_POST['driver'] == "xml") $common->addSetting('enableFlights', FALSE); diff --git a/build/portal/html/install/upgrade-v2.7.0.php b/build/portal/html/install/upgrade-v2.7.0.php index eec93b5..781a9f6 100644 --- a/build/portal/html/install/upgrade-v2.7.0.php +++ b/build/portal/html/install/upgrade-v2.7.0.php @@ -7,7 +7,7 @@ // // // The MIT License (MIT) // // // - // Copyright (c) 2015-2017 Joseph A. Prochazka // + // Copyright (c) 2015-2024 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 // @@ -48,7 +48,7 @@ $settings = new settings(); try { - // Add portal navigation and footer autohide option. + // Add map centering longitude and latitude. $common->addSetting("advancedMapCenterLatitude", "41.3683798"); $common->addSetting("advancedMapCenterLongitude", "-82.1076486"); diff --git a/build/portal/html/install/upgrade-v2.8.0.php b/build/portal/html/install/upgrade-v2.8.0.php new file mode 100644 index 0000000..2423587 --- /dev/null +++ b/build/portal/html/install/upgrade-v2.8.0.php @@ -0,0 +1,68 @@ +updateSetting("version", "2.8.0"); + $common->updateSetting("patch", ""); + + // The upgrade process completed successfully. + $results['success'] = TRUE; + $results['message'] = "Upgrade to v2.8.0 successful."; + return $results; + + } catch(Exception $e) { + // Something went wrong during this upgrade process. + $results['success'] = FALSE; + $results['message'] = $e->getMessage(); + return $results; + } + } +?> + diff --git a/build/portal/html/install/upgrade-v2.8.1.php b/build/portal/html/install/upgrade-v2.8.1.php new file mode 100644 index 0000000..93c5017 --- /dev/null +++ b/build/portal/html/install/upgrade-v2.8.1.php @@ -0,0 +1,68 @@ +updateSetting("version", "2.8.1"); + $common->updateSetting("patch", ""); + + // The upgrade process completed successfully. + $results['success'] = TRUE; + $results['message'] = "Upgrade to v2.8.1 successful."; + return $results; + + } catch(Exception $e) { + // Something went wrong during this upgrade process. + $results['success'] = FALSE; + $results['message'] = $e->getMessage(); + return $results; + } + } +?> + diff --git a/build/portal/html/install/upgrade.php b/build/portal/html/install/upgrade.php index 66846bb..d43ad52 100644 --- a/build/portal/html/install/upgrade.php +++ b/build/portal/html/install/upgrade.php @@ -33,7 +33,7 @@ $common = new common(); // The most current stable release. - $thisVersion = "2.8.0"; + $thisVersion = "2.8.1"; // Begin the upgrade process if this release is newer than what is installed. if ($common->getSetting("version") == $thisVersion) { @@ -178,7 +178,7 @@ } // UPGRADE TO V2.8.0 - if ($common->getSetting("version") == "2.8.0" && $success) { + if ($common->getSetting("version") == "2.7.2" && $success) { $json = file_get_contents("http://localhost/install/upgrade-v2.8.0.php"); $results = json_decode($json, TRUE); $success = $results['success']; @@ -186,6 +186,15 @@ $version = "2.8.0"; } + // UPGRADE TO V2.8.1 + if ($common->getSetting("version") == "2.8.0" && $success) { + $json = file_get_contents("http://localhost/install/upgrade-v2.8.1.php"); + $results = json_decode($json, TRUE); + $success = $results['success']; + $message = $results['message']; + $version = "2.8.1"; + } + require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."admin".DIRECTORY_SEPARATOR."includes".DIRECTORY_SEPARATOR."header.inc.php"); // Display the instalation wizard. diff --git a/build/portal/python/flights.py b/build/portal/python/flights.py index eb4714b..719efed 100644 --- a/build/portal/python/flights.py +++ b/build/portal/python/flights.py @@ -36,15 +36,29 @@ # 3) Update the last time the flight was seen. import datetime +import fcntl import json -import time import os +import time + from urllib.request import urlopen def log(string): #print(string) # uncomment to enable debug logging return +# Do not allow another instance of the script to run. +lock_file = open('/tmp/flights.py.lock','w') + +try: + fcntl.flock(lock_file, fcntl.LOCK_EX|fcntl.LOCK_NB) +except (IOError, OSError): + log('another instance already running') + quit() + +lock_file.write('%d\n'%os.getpid()) +lock_file.flush() + # Read the configuration file. with open(os.path.dirname(os.path.realpath(__file__)) + '/config.json') as config_file: config = json.load(config_file) @@ -125,7 +139,7 @@ class FlightsProcessor(object): log("\tFound Aircraft ID: " + str(aircraft_id)) # Check that a flight is tied to this track. - if aircraft.has_key('flight'): + if 'flight' in aircraft: self.processFlight(aircraft_id, aircraft) def processFlight(self, aircraft_id, aircraft): @@ -166,7 +180,7 @@ class FlightsProcessor(object): if row == None or row[0] != aircraft["messages"]: # Add this position to the database. - if aircraft.has_key('squawk'): + if 'squawk' in aircraft: params = (flight_id, self.time_now, aircraft["messages"], aircraft["squawk"], aircraft["lat"], aircraft["lon"], aircraft["track"], aircraft["nav_altitude"], aircraft["geom_rate"], aircraft["gs"], aircraft_id,) diff --git a/build/portal/python/maintenance.py b/build/portal/python/maintenance.py index e00a204..599e941 100644 --- a/build/portal/python/maintenance.py +++ b/build/portal/python/maintenance.py @@ -28,11 +28,23 @@ # SOFTWARE. # #================================================================================# +import datetime +import fcntl import json import os -import datetime import time +# Do not allow another instance of the script to run. +lock_file = open('/tmp/flights.py.lock','w') + +try: + fcntl.flock(lock_file, fcntl.LOCK_EX|fcntl.LOCK_NB) +except (IOError, OSError): + quit() + +lock_file.write('%d\n'%os.getpid()) +lock_file.flush() + while True: ## Read the configuration file.