From c323c93f4721afe46904d24cb96c40ad7caf3529 Mon Sep 17 00:00:00 2001 From: wiedehopf Date: Thu, 28 Nov 2024 15:03:46 +0100 Subject: [PATCH] PIAWARE_MINIMAL: make it clear the map is disabled (#215) lighttpd: set 'Cache-Control: no-cache' so changes like the map being disabled are not obscured by the browser cache --- rootfs/etc/lighttpd/skyaware.lighttpd.conf | 2 ++ rootfs/etc/s6-overlay/scripts/01-piaware | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/rootfs/etc/lighttpd/skyaware.lighttpd.conf b/rootfs/etc/lighttpd/skyaware.lighttpd.conf index 29fa95a..adcd472 100644 --- a/rootfs/etc/lighttpd/skyaware.lighttpd.conf +++ b/rootfs/etc/lighttpd/skyaware.lighttpd.conf @@ -82,6 +82,8 @@ $HTTP["url"] =~ "^/dump1090-fa/data/.*\.json$" { setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" ) } +setenv.add-response-header = ( "Cache-Control" => "no-cache" ) + # Allows access to the static files that provide the skyaware978 map view, # and also to the dynamically-generated json parts that contain aircraft # data and are periodically written by the skyaware978 daemon. diff --git a/rootfs/etc/s6-overlay/scripts/01-piaware b/rootfs/etc/s6-overlay/scripts/01-piaware index 1e92a97..aec0f55 100755 --- a/rootfs/etc/s6-overlay/scripts/01-piaware +++ b/rootfs/etc/s6-overlay/scripts/01-piaware @@ -86,7 +86,11 @@ elif [[ "$UAT_RECEIVER_TYPE" == "rtlsdr" ]]; then fi MLAT_RESULTS_STRING="beast,listen,30105 ext_basestation,listen,30106 " -if ! chk_enabled "${PIAWARE_MINIMAL}"; then + +if [[ -n "$BEASTHOST" ]] && chk_enabled "${PIAWARE_MINIMAL}"; then + # make it obvious the map is not available when PIAWARE_MINIMAL is set + sed -i -e "s#'/skyaware.*/'#''#g" -e "s/Go to.*SkyAware Map/Map disabled/g" /var/www/html/index.js +else MLAT_RESULTS_STRING+="beast,connect,localhost:30104 " fi