From 05b399482b939cec752227a8fb2ef3bf6ac88389 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 10 Sep 2023 11:09:25 -0700 Subject: [PATCH] v8.22 (#6587) - DietPi-Software | Add ADS-B Feeder: track airplanes using SDRs and feed the data to ADS-B aggregators (based on https://adsb.im) Signed-off-by: Dirk Hohndel Co-authored-by: MichaIng --- .meta/dietpi-survey_report | 1 + CHANGELOG.txt | 3 ++ README.md | 1 + dietpi/dietpi-services | 2 ++ dietpi/dietpi-software | 68 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 75 insertions(+) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index dfa13b52ab..5a06fdf49d 100755 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -689,6 +689,7 @@ shopt -s extglob aSOFTWARE_NAME8_21[i]=${aSOFTWARE_NAME8_20[i]} aSOFTWARE_NAME8_22[i]=${aSOFTWARE_NAME8_21[i]} done + aSOFTWARE_NAME8_22[141]='ADS-B Feeder' # Pre-create software counter array so that we can see also software (available in newest version) with 0 installs for i in "${aSOFTWARE_NAME8_22[@]}" diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c8ac78b1ac..968a2642c5 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,9 @@ v8.22 (2023-09-23) +New software: +- ADS-B Feeder | Track airplanes using SDRs and feed the data to ADS-B aggregators. Many thanks to @dirkhh for maintaining and implementing this software option: https://github.com/MichaIng/DietPi/pull/6587 + Enhancements: - DietPi-Software | Docker: Enabled for Trixie and RISC-V via "docker.io" package from Debian repository. - DietPi-Software | Portainer: Enabled for RISC-V as Docker is now supported on RISC-V as well. diff --git a/README.md b/README.md index a30c71f33d..f14488ca3e 100644 --- a/README.md +++ b/README.md @@ -337,6 +337,7 @@ Links to hardware and software manufacturers, sources and build instructions use - [Restic](https://github.com/restic/restic) - [MediaWiki](https://github.com/wikimedia/mediawiki) - [Homebridge](https://github.com/homebridge/homebridge) +- [ADS-B Feeder](https://github.com/dirkhh/adsb-feeder-image) --- diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index d8e5f558b5..04b8758ae3 100755 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -268,6 +268,8 @@ _EOF_ 'fahclient' 'ipfs' 'yacy' + 'adsb-setup' + 'adsb-docker' ) # Additional services: https://github.com/MichaIng/DietPi/issues/1869#issuecomment-401017251 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 220ee135fd..7cf1edc03e 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1591,6 +1591,13 @@ Available commands: aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/distributed_projects/#yacy' aSOFTWARE_DEPS[$software_id]='196' #------------------ + software_id=141 + aSOFTWARE_NAME[$software_id]='ADS-B Feeder' + aSOFTWARE_DESC[$software_id]='track airplanes using SDRs and feed the data to ADS-B aggregators' + aSOFTWARE_CATX[$software_id]=19 + aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/distributed_projects/#adsb-feeder' + aSOFTWARE_DEPS[$software_id]='17 130 134 162' # Git, Python, Docker & Docker Compose + #------------------ software_id=184 aSOFTWARE_NAME[$software_id]='Tor Relay' aSOFTWARE_DESC[$software_id]='add a node to the Tor network' @@ -11935,6 +11942,56 @@ _EOF_ G_EXEC_OUTPUT=1 G_EXEC docker run -d -p '9002:9000' --name=portainer --restart=always -v '/run/docker.sock:/var/run/docker.sock' -v 'portainer_data:/data' 'portainer/portainer-ce' fi + if To_Install 141 adsb-setup adsb-docker # ADS-B Feeder + then + # clone the adsb-feeder repo into /tmp + G_EXEC_OUTPUT=1 G_EXEC git clone -b dietpi 'https://github.com/dirkhh/adsb-feeder-image.git' /tmp/adsb-feeder + + # remove the service that isn't needed for an app install on DietPi and install the rest + G_EXEC cd /tmp/adsb-feeder/src/modules/adsb-feeder/filesystem/root + G_EXEC rm ./usr/lib/systemd/system/adsb-bootstrap.service + G_EXEC mv ./usr/lib/systemd/system/* /etc/systemd/system/ + + # determine the version + local ADSB_FEEDER_DATE_COMPONENT=$(git log -20 --date='format:%y%m%d' --format='%ad' | uniq -c | mawk '{print $2"."$1;exit}') + local ADSB_FEEDER_TAG_COMPONENT=$(git describe --match 'v[0-9]*' | cut -d- -f1) + local ADSB_FEEDER_VERSION="$ADSB_FEEDER_TAG_COMPONENT(dietpi)-$ADSB_FEEDER_DATE_COMPONENT" + + # create the target directory for the app and populated with the code from the git checkout + [[ -d '/opt/adsb' ]] && G_EXEC rm -R /opt/adsb + G_EXEC mv /tmp/adsb-feeder/src/modules/adsb-feeder/filesystem/root/opt/adsb /opt/ + G_EXEC cd /opt/adsb + + # remove the git clone of the repo we installed from + G_EXEC rm -R /tmp/adsb-feeder + + # create a symlink so the config files reside where they should be in /mnt/dietpi_userdata/adsb-feeder + G_EXEC mkdir -p /mnt/dietpi_userdata/adsb-feeder/config + G_EXEC ln -s /mnt/dietpi_userdata/adsb-feeder/config . + + # set the 'image name' and version that are shown in the footer of the Web UI + G_EXEC eval 'echo '\''ADSB Feeder app running on DietPi'\'' > feeder-image.name' + G_EXEC eval "echo '$ADSB_FEEDER_VERSION' > adsb.im.version" + + # get the Python module + # for older distros we need to install via pip in order to get flask 2 + if (( $G_DISTRO < 7 )) + then + G_EXEC_OUTPUT=1 G_EXEC pip3 install -U flask + else + G_AGI python3-flask + fi + + # finally ensure that /run allows executables (this is needed for the containers to be able to not do excessive + # writes to physical storage - which might be an SD card) + G_EXEC mount -o remount,exec /run + + # now that everything is in place, run the one time service to get the software pre-configured + # running this as a service allows it to do a bit of housekeeping in the background without disrupting + # the software install flow + G_EXEC systemctl start adsb-nonimage + fi + if To_Install 172 # WireGuard then # Packages available on Buster backports and Bullseye: On Raspbian Buster add Bullseye repo @@ -12689,6 +12746,17 @@ If no WireGuard (auto)start is included, but you require it, please do the follo [[ -d '/etc/yacy' ]] && G_EXEC rm -R /etc/yacy fi + if To_Uninstall 141 # ADS-B Feeder + then + G_EXEC_NOHALT=1 G_EXEC_OUTPUT=1 G_EXEC /opt/adsb/docker-compose-adsb down + Remove_Service adsb-bootstrap + Remove_Service adsb-feeder-update + Remove_Service adsb-setup + Remove_Service adsb-update + command -v docker &> /dev/null && G_EXEC docker image prune -a -f + G_EXEC rm -Rf /opt/adsb /mnt/dietpi_userdata/adsb-feeder /opt/adsb-feeder-update + fi + if To_Uninstall 2 # Folding@Home then # Un-check out all work units, so they can be picked up by other donors prior to timeout: https://github.com/FoldingAtHome/fah-issues/issues/1255