Skip to content

Commit

Permalink
(somewhat) quiet down FAM/daemon spotter logs. Add option to toggle q…
Browse files Browse the repository at this point in the history
…uiet logs on and off
  • Loading branch information
fredclausen committed Nov 1, 2023
1 parent d6baeeb commit 10bd0be
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ ENV BASESTATIONPORT="30003" \
MYSQLPORT=3306 \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
TZ=UTC \
WEBUSER=flightairmap
WEBUSER=flightairmap \
QUIET_FAM=true

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ of this parameter has the format `<VARIABLE_NAME>=<VALUE>`.
| `FAM_INSTALLPASSWORD` | Sets the `$globalInstallPassword` variable in `require/settings.php`. The password to access the install area. If not given, a randomly password will be generated and used. To obtain the generated password, you can issue the command `docker exec flightairmap cat /var/www/flightairmap/htdocs/require/settings.php \| grep globalInstallPassword`. | `unset` | Optional |
| `BASESTATIONHOST` | You can specify the IP or hostname of a host/container running `readsb` or `dump1090`. See [sdre-enthusiasts/docker-readsb-protobuf](https://github.com/sdr-enthusiasts/docker-readsb-protobuf/). If given, FlightAirMap will pull ADS-B data from the specified host/container. Without this, you'll need to set up your own sources via the install area. | `unset` | Optional |
| `BASESTATIONPORT` | If your `readsb` or `dump1090` is running on a non-standard TCP port, you can change it here. | `30003` | Optional |
| `QUIET_FAM` | If set to `true`, will suppress the output of FAM in the logs. | `true` | Optional |
| `FAM_GLOBALSITENAME` | Sets the `$globalName` variable in `require/settings.php`.The name of your site | `My FlightAirMap Site` | Optional |
| `FAM_LANGUAGE` | Sets the `$globalLanguage` variable in `require/settings.php`. Interface language. Can be set to `EN`, `DE` or `FR`. | `EN` | Optional |
| `FAM_MAPPROVIDER` | Sets the `$globalMapProvider` variable in `require/settings.php`. Can be `Mapbox`, `OpenStreetMap`, `MapQuest-OSM` or `MapQuest-Aerial` | `OpenStreetMap` | Optional |
Expand Down
19 changes: 18 additions & 1 deletion rootfs/etc/s6-overlay/scripts/daemon-spotter
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,21 @@
source /scripts/common

s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args)
"${s6wrap[@]}" s6-setuidgid "$WEBUSER" php /var/www/flightairmap/htdocs/scripts/daemon-spotter.php
if chk_enabled $QUIET_FAM; then
"${s6wrap[@]}" s6-setuidgid "$WEBUSER" php /var/www/flightairmap/htdocs/scripts/daemon-spotter.php 2>&1 | \
stdbuf -oL awk '! /\\o\//' | \
stdbuf -oL awk '! /DATA : /' | \
stdbuf -oL awk '! /New flight.../' | \
stdbuf -oL awk '! /New aircraft hex/' | \
stdbuf -oL awk '! /in archive DB/' | \
stdbuf -oL awk '! /already in DB/' | \
stdbuf -oL awk '! /Getting schedule info/' | \
stdbuf -oL awk '! /old values and update latest data/' | \
stdbuf -oL awk '! /Check if aircraft is already in DB/' | \
stdbuf -oL awk '! /get arrival\/departure airport/' | \
stdbuf -oL awk '! /Deleting Live Spotter/' | \
stdbuf -oL awk '! /Calculated Speed/' | \
stdbuf -oL awk '{print $0}'
else
"${s6wrap[@]}" s6-setuidgid "$WEBUSER" php /var/www/flightairmap/htdocs/scripts/daemon-spotter.php
fi

0 comments on commit 10bd0be

Please sign in to comment.