forked from compujuckel/adsb-docker
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add tar1090 and graphs1090 displays
- add tar1090 and graphs1090 using sdr-enthusiasts prebuilt container - add dockerfile modifications for running on balena - add start script for checks and setup Closes: #24 Closes: #41
- Loading branch information
Showing
3 changed files
with
102 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/command/with-contenv bash | ||
# this ^ is a custom s6 helper for bringning in env variables | ||
set -e | ||
|
||
# Bring in the common scripts from sdr-enthusiasts base image | ||
source /scripts/common | ||
|
||
# Check if service has been disabled through the DISABLED_SERVICES environment variable. | ||
|
||
if [[ ",$(echo -e "${DISABLED_SERVICES}" | tr -d '[:space:]')," = *",$BALENA_SERVICE_NAME,"* ]]; then | ||
echo "$BALENA_SERVICE_NAME is manually disabled. Sending request to stop the service:" | ||
curl --header "Content-Type:application/json" "$BALENA_SUPERVISOR_ADDRESS/v2/applications/$BALENA_APP_ID/stop-service?apikey=$BALENA_SUPERVISOR_API_KEY" -d '{"serviceName": "'$BALENA_SERVICE_NAME'"}' | ||
echo " " | ||
sleep infinity | ||
fi | ||
|
||
# Verify that all the required variables are set before starting up the application. | ||
|
||
echo "Verifying settings..." | ||
echo " " | ||
sleep 2 | ||
|
||
missing_variables=false | ||
|
||
# Begin defining all the required configuration variables. | ||
|
||
[ -z "$LAT" ] && echo "Receiver latitude is missing, will abort startup." && missing_variables=true || echo "Receiver latitude is set: $LAT" | ||
[ -z "$LON" ] && echo "Receiver longitude is missing, will abort startup." && missing_variables=true || echo "Receiver longitude is set: $LON" | ||
|
||
if [ -z "${BEASTHOST}" ] && [ -z "${MLATHOST}" ] && [ -z "${READSB_DEVICE_TYPE}" ] && [ -z "${READSB_NET_CONNECTOR}" ] \ | ||
&& ! grep -qs -e 'adsb[^;]*_in' <<< "${ULTRAFEEDER_CONFIG}${ULTRAFEEDER_NET_CONNECTOR}"; then | ||
echo -e "WARNING: No obvious data input configured: BEASTHOST / MLATHOST / READSB_NET_CONNECTOR / READSB_DEVICE_TYPE environment variables not set." | ||
missing_variables=true | ||
fi | ||
|
||
# End defining all the required configuration variables. | ||
|
||
echo " " | ||
|
||
if [ "$missing_variables" = true ] | ||
then | ||
echo "Settings missing, aborting..." | ||
echo " " | ||
sleep infinity | ||
fi | ||
|
||
echo "Settings verified, proceeding with startup." | ||
echo " " | ||
|
||
# We use LON for longitude but docker-tar1090 uses LONG | ||
echo "$LON" > /var/run/s6/container_environment/LONG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM ghcr.io/sdr-enthusiasts/docker-tar1090:latest AS base | ||
LABEL maintainer="https://github.com/ketilmo" | ||
|
||
COPY 00-startup-checks /etc/s6-overlay/startup.d | ||
|
||
RUN rm -f /etc/nginx/nginx-tar1090-webroot.conf && \ | ||
wget -O /etc/nginx/nginx-tar1090.conf https://raw.githubusercontent.com/wiedehopf/tar1090/refs/heads/master/nginx.conf && \ | ||
mv /usr/local/share/tar1090/html-webroot /usr/local/share/tar1090/html && \ | ||
html_path=/usr/local/share/tar1090/html && \ | ||
srcdir=/run/readsb && \ | ||
service=tar1090 && \ | ||
instance=tar1090 && \ | ||
sed -i.orig -e "s?SOURCE_DIR?$srcdir?g" -e "s?SERVICE?${service}?g" \ | ||
-e "s?INSTANCE?$instance?g" -e "s?HTMLPATH?$html_path?g" /etc/nginx/nginx-tar1090.conf && \ | ||
sed -i -e 's/html-webroot/html/g' /etc/s6-overlay/startup.d/04-tar1090-configure && \ | ||
sed -i -e 's?href="graphs1090/"?href="../graphs1090/"?g' /etc/s6-overlay/startup.d/04-tar1090-configure && \ | ||
sed -i -e 's/html-webroot/html/g' /etc/s6-overlay/startup.d/06-range-outline && \ | ||
sed -i -e 's/webroot/tar1090/g' /etc/s6-overlay/scripts/tar1090-update && \ | ||
sed -i -e 's/nginx-tar1090-webroot/nginx-tar1090/g' /etc/nginx.tar1090/sites-enabled/tar1090 && \ | ||
sed -i -e 's/nginx-tar1090-webroot/nginx-tar1090/g' /etc/nginx/sites-enabled/tar1090 && \ | ||
sed -i -e 's/nginx-tar1090-webroot/nginx-tar1090/g' /etc/s6-overlay/startup.d/07-nginx-configure | ||
|
||
HEALTHCHECK NONE |