From df7d2d78e3a2d4afa2912ac175e78c768b60380c Mon Sep 17 00:00:00 2001 From: Fred Clausen <43556888+fredclausen@users.noreply.github.com> Date: Fri, 27 Oct 2023 07:26:00 -0600 Subject: [PATCH 01/12] Update readme to use linux server maria db Closes #25 --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 22b384f..935dd1b 100644 --- a/README.md +++ b/README.md @@ -108,18 +108,20 @@ networks: services: flightairmap_db: - image: mariadb - command: --default-authentication-plugin=mysql_native_password + image: lscr.io/linuxserver/mariadb:latest tty: true container_name: flightairmap_db restart: always environment: + - PUID=0 + - PGID=0 - MYSQL_ROOT_PASSWORD=shai5Eisah7phe0aic5foote - MYSQL_DATABASE=flightairmap - MYSQL_USER=flightairmap + - TZ=Europe/London - MYSQL_PASSWORD=xi6Paig4yeitae3Pah9aew3j volumes: - - fam_db:/var/lib/mysql + - fam_db:/config flightairmap: image: ghcr.io/sdr-enthusiasts/docker-flightairmap:latest From 7f1a9751c79ea4b4cb0bef29a4fd5a0a87ca49b0 Mon Sep 17 00:00:00 2001 From: Fred Clausen <43556888+fredclausen@users.noreply.github.com> Date: Fri, 27 Oct 2023 07:27:46 -0600 Subject: [PATCH 02/12] Use standard .env convention for FEEDER_TZ in readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 935dd1b..462562b 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ services: - MYSQL_ROOT_PASSWORD=shai5Eisah7phe0aic5foote - MYSQL_DATABASE=flightairmap - MYSQL_USER=flightairmap - - TZ=Europe/London + - TZ=${FEEDER_TZ} - MYSQL_PASSWORD=xi6Paig4yeitae3Pah9aew3j volumes: - fam_db:/config @@ -131,7 +131,7 @@ services: ports: - 8080:80 environment: - - TZ=Australia/Perth + - TZ=${FEEDER_TZ} - BASESTATIONHOST=readsb - FAM_INSTALLPASSWORD="very_secure_password_12345" - MYSQLHOSTNAME=flightairmap_db From 3a8885c7030632e6809194cb942dbee79195d837 Mon Sep 17 00:00:00 2001 From: Fred Clausen <43556888+fredclausen@users.noreply.github.com> Date: Fri, 27 Oct 2023 07:30:55 -0600 Subject: [PATCH 03/12] remove duplicated notes and remove docker run command entirely --- README.md | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 462562b..30d3ec0 100644 --- a/README.md +++ b/README.md @@ -26,25 +26,7 @@ This container is designed to work in conjunction with a Mode-S / BEAST provider --- -## Quick Start with `docker run` - -**NOTE**: The Docker command provided in this quick start is given as an example and parameters should be adjusted to suit your needs. - -Launch the FlightAwareMap docker container with the following commands: - -```shell -docker volume create flightairmap_db -docker volume create flightairmap_webapp -docker run -d \ - --name=flightairmap \ - -p 8080:80 \ - -e BASESTATIONHOST=readsb \ - -e TZ=Australia/Perth \ - -e FAM_INSTALLPASSWORD="very_secure_password_12345" \ - -v flightairmap_db:/var/lib/mysql \ - -v flightairmap_webapp:/var/www/flightairmap \ - ghcr.io/sdr-enthusiasts/docker-flightairmap:latest -``` +## Container notes On the first run of the container, the database will be created & populated and data will be downloaded from the internet. This process can take quite some time. On my system, around 30 minutes. Once the first run processes are finished, to access FlightAirMap, you can: @@ -75,7 +57,7 @@ services: ports: - 8080:80 environment: - - TZ=Australia/Perth + - TZ=${FEEDER_TZ} - BASESTATIONHOST=readsb - FAM_INSTALLPASSWORD="very_secure_password_12345" volumes: @@ -83,13 +65,6 @@ services: - fam_webapp:/var/www/flightairmap ``` -On the first run of the container, the database will be created & populated and data will be downloaded from the internet. This process can take quite some time. On my system, around 30 minutes. Once the first run processes are finished, to access FlightAirMap, you can: - -- Browse to `http://dockerhost:8080/` to access the FlightAirMap GUI. -- Browse to `http://dockerhost:8080/install/` to access the FlightAirMap settings area. - -With regards to settings - where one exists, you should use an environment variable to set your desired setting. The environment variables get written to the `require/settings.php` file on container start, so any configuration items applied via with `/install/` area may be overwritten. Long story short, your first port of call for configuration should be environment variables. - ## Quick Start with `docker-compose` using external database **NOTE**: The Docker command provided in this quick start is given as an example and parameters should be adjusted to suit your needs. @@ -145,13 +120,6 @@ services: - flightairmap_db ``` -On the first run of the container, the database will be created & populated and data will be downloaded from the internet. This process can take quite some time. On my system, around 30 minutes. Once the first run processes are finished, to access FlightAirMap, you can: - -- Browse to `http://dockerhost:8080/` to access the FlightAirMap GUI. -- Browse to `http://dockerhost:8080/install/` to access the FlightAirMap settings area. - -With regards to settings - where one exists, you should use an environment variable to set your desired setting. The environment variables get written to the `require/settings.php` file on container start, so any configuration items applied via with `/install/` area may be overwritten. Long story short, your first port of call for configuration should be environment variables. - ### Environment Variables To customize some properties of the container, the following environment From c4adaf9aafce3a1fe15358fae8f257d076fc3815 Mon Sep 17 00:00:00 2001 From: Fred Clausen <43556888+fredclausen@users.noreply.github.com> Date: Fri, 27 Oct 2023 07:36:25 -0600 Subject: [PATCH 04/12] linting --- rootfs/etc/s6-overlay/scripts/03-settings | 1 + 1 file changed, 1 insertion(+) diff --git a/rootfs/etc/s6-overlay/scripts/03-settings b/rootfs/etc/s6-overlay/scripts/03-settings index d6bd804..fc5425c 100755 --- a/rootfs/etc/s6-overlay/scripts/03-settings +++ b/rootfs/etc/s6-overlay/scripts/03-settings @@ -1,6 +1,7 @@ #!/command/with-contenv /bin/bash #shellcheck shell=bash +#shellcheck disable=SC1091 source /scripts/common NOCOLOR='\033[0m' From 77dac32f25bc01b610fa1c0a5303cf1b1bbe3506 Mon Sep 17 00:00:00 2001 From: Fred Clausen <43556888+fredclausen@users.noreply.github.com> Date: Wed, 1 Nov 2023 09:47:10 -0600 Subject: [PATCH 05/12] S6 wrap and run mariadb as root --- rootfs/etc/s6-overlay/scripts/02-firstrun | 4 ++-- rootfs/etc/s6-overlay/scripts/daemon-acars | 3 ++- rootfs/etc/s6-overlay/scripts/daemon-spotter | 3 ++- rootfs/etc/s6-overlay/scripts/mysql | 6 ++++-- rootfs/etc/s6-overlay/scripts/nginx | 3 ++- rootfs/etc/s6-overlay/scripts/php-fpm | 3 ++- rootfs/etc/s6-overlay/scripts/socat | 6 ++++-- rootfs/etc/s6-overlay/scripts/update_db | 5 +++-- 8 files changed, 21 insertions(+), 12 deletions(-) diff --git a/rootfs/etc/s6-overlay/scripts/02-firstrun b/rootfs/etc/s6-overlay/scripts/02-firstrun index da18005..b9b7094 100755 --- a/rootfs/etc/s6-overlay/scripts/02-firstrun +++ b/rootfs/etc/s6-overlay/scripts/02-firstrun @@ -35,7 +35,7 @@ fi if [ -z "${MYSQLHOSTNAME}" ]; then # Check if the flightairmap database exists # Start mysqld without permissions - /usr/sbin/mysqld --skip-networking --console --log-error='' --skip-grant-tables --silent-startup & + /usr/sbin/mysqld --skip-networking --console --log-error='' --skip-grant-tables --silent-startup --user=root & # Wait for mysqld to init while : do @@ -84,7 +84,7 @@ if [ -z "${MYSQLHOSTNAME}" ]; then MYSQLPASSWORD="$(pwgen -cns 30 999 | tail -1)" mysqladmin shutdown - /usr/sbin/mysqld --console --log-error='' --silent-startup & + /usr/sbin/mysqld --console --log-error='' --silent-startup --user=root & # Wait for mysqld to init echo "Waiting for database..." while : diff --git a/rootfs/etc/s6-overlay/scripts/daemon-acars b/rootfs/etc/s6-overlay/scripts/daemon-acars index f851738..768ea77 100755 --- a/rootfs/etc/s6-overlay/scripts/daemon-acars +++ b/rootfs/etc/s6-overlay/scripts/daemon-acars @@ -1,4 +1,5 @@ #!/command/with-contenv sh # shellcheck shell=sh -s6-setuidgid "$WEBUSER" php /var/www/flightairmap/htdocs/scripts/daemon-acars.php 2>&1 | awk '{print "[daemon-acars] " $0}' +s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) +"${s6wrap[@]}" s6-setuidgid "$WEBUSER" php /var/www/flightairmap/htdocs/scripts/daemon-acars.php 2>&1 | awk '{print "[daemon-acars] " $0}' diff --git a/rootfs/etc/s6-overlay/scripts/daemon-spotter b/rootfs/etc/s6-overlay/scripts/daemon-spotter index 46f78d0..296c43e 100755 --- a/rootfs/etc/s6-overlay/scripts/daemon-spotter +++ b/rootfs/etc/s6-overlay/scripts/daemon-spotter @@ -1,4 +1,5 @@ #!/command/with-contenv sh # shellcheck shell=sh -s6-setuidgid "$WEBUSER" php /var/www/flightairmap/htdocs/scripts/daemon-spotter.php 2>&1 | awk '{print "[daemon-spotter] " $0}' +s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) +"${s6wrap[@]}" s6-setuidgid "$WEBUSER" php /var/www/flightairmap/htdocs/scripts/daemon-spotter.php 2>&1 | awk '{print "[daemon-spotter] " $0}' diff --git a/rootfs/etc/s6-overlay/scripts/mysql b/rootfs/etc/s6-overlay/scripts/mysql index 68304a1..7eac8c2 100755 --- a/rootfs/etc/s6-overlay/scripts/mysql +++ b/rootfs/etc/s6-overlay/scripts/mysql @@ -1,9 +1,11 @@ #!/command/with-contenv sh # shellcheck shell=sh +s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) + # if using local database if [ -z "${MYSQLHOSTNAME}" ]; then - /usr/sbin/mysqld --console --log-error='' 2>&1 | awk '{print "[mariadb] " $0}' + "${s6wrap[@]}" /usr/sbin/mysqld --console --log-error='' --user=root 2>&1 | awk '{print "[mariadb] " $0}' else - sleep 3600 + "${s6wrap[@]}" sleep 3600 fi diff --git a/rootfs/etc/s6-overlay/scripts/nginx b/rootfs/etc/s6-overlay/scripts/nginx index b7399f1..bb4b513 100755 --- a/rootfs/etc/s6-overlay/scripts/nginx +++ b/rootfs/etc/s6-overlay/scripts/nginx @@ -1,4 +1,5 @@ #!/command/with-contenv sh # shellcheck shell=sh -/usr/sbin/nginx 2>&1 | awk '{print "[nginx] " $0}' +s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) +"${s6wrap[@]}" /usr/sbin/nginx 2>&1 | awk '{print "[nginx] " $0}' diff --git a/rootfs/etc/s6-overlay/scripts/php-fpm b/rootfs/etc/s6-overlay/scripts/php-fpm index 7c41885..3d2934c 100755 --- a/rootfs/etc/s6-overlay/scripts/php-fpm +++ b/rootfs/etc/s6-overlay/scripts/php-fpm @@ -1,4 +1,5 @@ #!/command/with-contenv sh # shellcheck shell=sh -/usr/sbin/php-fpm7.4 --nodaemonize 2>&1 | awk '{print "[php-fpm] " $0}' +s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) +"${s6wrap[@]}" /usr/sbin/php-fpm7.4 --nodaemonize 2>&1 | awk '{print "[php-fpm] " $0}' diff --git a/rootfs/etc/s6-overlay/scripts/socat b/rootfs/etc/s6-overlay/scripts/socat index 4cb9814..ce38e98 100755 --- a/rootfs/etc/s6-overlay/scripts/socat +++ b/rootfs/etc/s6-overlay/scripts/socat @@ -1,9 +1,11 @@ #!/command/with-contenv sh # shellcheck shell=sh +s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) + if [ -z "${BASESTATIONHOST}" ]; then - sleep 3600 + "${s6wrap[@]}" sleep 3600 else # shellcheck disable=SC2153 - socat -d -d TCP-LISTEN:30003,fork TCP:"${BASESTATIONHOST}":"${BASESTATIONPORT}" + "${s6wrap[@]}" socat -d -d TCP-LISTEN:30003,fork TCP:"${BASESTATIONHOST}":"${BASESTATIONPORT}" fi diff --git a/rootfs/etc/s6-overlay/scripts/update_db b/rootfs/etc/s6-overlay/scripts/update_db index 85935c3..2dbd15e 100755 --- a/rootfs/etc/s6-overlay/scripts/update_db +++ b/rootfs/etc/s6-overlay/scripts/update_db @@ -1,5 +1,6 @@ #!/command/with-contenv sh # shellcheck shell=sh -sleep 1h -s6-setuidgid "$WEBUSER" php /var/www/flightairmap/htdocs/scripts/update_db.php 2>&1 | awk '{print "[update_db] " $0}' +s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) +"${s6wrap[@]}" sleep 1h +"${s6wrap[@]}" s6-setuidgid "$WEBUSER" php /var/www/flightairmap/htdocs/scripts/update_db.php 2>&1 | awk '{print "[update_db] " $0}' From b8a19668d975d8c388c2e39c7261f151f600f5bf Mon Sep 17 00:00:00 2001 From: Fred Clausen <43556888+fredclausen@users.noreply.github.com> Date: Wed, 1 Nov 2023 10:28:18 -0600 Subject: [PATCH 06/12] remove awk redirection on commands since we are now running via s6-wrap --- rootfs/etc/s6-overlay/scripts/daemon-acars | 2 +- rootfs/etc/s6-overlay/scripts/daemon-spotter | 2 +- rootfs/etc/s6-overlay/scripts/mysql | 2 +- rootfs/etc/s6-overlay/scripts/nginx | 2 +- rootfs/etc/s6-overlay/scripts/php-fpm | 2 +- rootfs/etc/s6-overlay/scripts/update_db | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rootfs/etc/s6-overlay/scripts/daemon-acars b/rootfs/etc/s6-overlay/scripts/daemon-acars index 768ea77..e2f4c92 100755 --- a/rootfs/etc/s6-overlay/scripts/daemon-acars +++ b/rootfs/etc/s6-overlay/scripts/daemon-acars @@ -2,4 +2,4 @@ # shellcheck shell=sh s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) -"${s6wrap[@]}" s6-setuidgid "$WEBUSER" php /var/www/flightairmap/htdocs/scripts/daemon-acars.php 2>&1 | awk '{print "[daemon-acars] " $0}' +"${s6wrap[@]}" s6-setuidgid "$WEBUSER" php /var/www/flightairmap/htdocs/scripts/daemon-acars.php diff --git a/rootfs/etc/s6-overlay/scripts/daemon-spotter b/rootfs/etc/s6-overlay/scripts/daemon-spotter index 296c43e..76167fc 100755 --- a/rootfs/etc/s6-overlay/scripts/daemon-spotter +++ b/rootfs/etc/s6-overlay/scripts/daemon-spotter @@ -2,4 +2,4 @@ # shellcheck shell=sh s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) -"${s6wrap[@]}" s6-setuidgid "$WEBUSER" php /var/www/flightairmap/htdocs/scripts/daemon-spotter.php 2>&1 | awk '{print "[daemon-spotter] " $0}' +"${s6wrap[@]}" s6-setuidgid "$WEBUSER" php /var/www/flightairmap/htdocs/scripts/daemon-spotter.php diff --git a/rootfs/etc/s6-overlay/scripts/mysql b/rootfs/etc/s6-overlay/scripts/mysql index 7eac8c2..7e3ad36 100755 --- a/rootfs/etc/s6-overlay/scripts/mysql +++ b/rootfs/etc/s6-overlay/scripts/mysql @@ -5,7 +5,7 @@ s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) # if using local database if [ -z "${MYSQLHOSTNAME}" ]; then - "${s6wrap[@]}" /usr/sbin/mysqld --console --log-error='' --user=root 2>&1 | awk '{print "[mariadb] " $0}' + "${s6wrap[@]}" /usr/sbin/mysqld --console --log-error='' --user=root else "${s6wrap[@]}" sleep 3600 fi diff --git a/rootfs/etc/s6-overlay/scripts/nginx b/rootfs/etc/s6-overlay/scripts/nginx index bb4b513..1f0cb6d 100755 --- a/rootfs/etc/s6-overlay/scripts/nginx +++ b/rootfs/etc/s6-overlay/scripts/nginx @@ -2,4 +2,4 @@ # shellcheck shell=sh s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) -"${s6wrap[@]}" /usr/sbin/nginx 2>&1 | awk '{print "[nginx] " $0}' +"${s6wrap[@]}" /usr/sbin/nginx diff --git a/rootfs/etc/s6-overlay/scripts/php-fpm b/rootfs/etc/s6-overlay/scripts/php-fpm index 3d2934c..972699c 100755 --- a/rootfs/etc/s6-overlay/scripts/php-fpm +++ b/rootfs/etc/s6-overlay/scripts/php-fpm @@ -2,4 +2,4 @@ # shellcheck shell=sh s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) -"${s6wrap[@]}" /usr/sbin/php-fpm7.4 --nodaemonize 2>&1 | awk '{print "[php-fpm] " $0}' +"${s6wrap[@]}" /usr/sbin/php-fpm7.4 --nodaemonize diff --git a/rootfs/etc/s6-overlay/scripts/update_db b/rootfs/etc/s6-overlay/scripts/update_db index 2dbd15e..9a9059d 100755 --- a/rootfs/etc/s6-overlay/scripts/update_db +++ b/rootfs/etc/s6-overlay/scripts/update_db @@ -3,4 +3,4 @@ s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) "${s6wrap[@]}" sleep 1h -"${s6wrap[@]}" s6-setuidgid "$WEBUSER" php /var/www/flightairmap/htdocs/scripts/update_db.php 2>&1 | awk '{print "[update_db] " $0}' +"${s6wrap[@]}" s6-setuidgid "$WEBUSER" php /var/www/flightairmap/htdocs/scripts/update_db.php From ebfe0bf20515e00e007434a47e11e3b2820027d4 Mon Sep 17 00:00:00 2001 From: Fred Clausen <43556888+fredclausen@users.noreply.github.com> Date: Wed, 1 Nov 2023 10:28:38 -0600 Subject: [PATCH 07/12] Use table formatting for vars in readme --- README.md | 137 +++++++++++++++++++----------------------------------- 1 file changed, 49 insertions(+), 88 deletions(-) diff --git a/README.md b/README.md index 30d3ec0..eeff81d 100644 --- a/README.md +++ b/README.md @@ -126,97 +126,58 @@ To customize some properties of the container, the following environment variables can be passed via the `-e` parameter (one for each variable). Value of this parameter has the format `=`. -`TZ`: Your local timezone in "TZ database name" format [List-of-tz-database-time-zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). Default `UTC`. Optional. - -`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`. Optional. - -`BASESTATIONHOST`: You can specify the IP or hostname of a host/container running `readsb` or `dump1090`. See [mikenye/readsb](https://hub.docker.com/r/mikenye/readsb). 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. Default is unset. Optional. - -`BASESTATIONPORT`: If your `readsb` or `dump1090` is running on a non-standard TCP port, you can change it here. Default `30003`. Optional. - -`FAM_GLOBALSITENAME`: Sets the `$globalName` variable in `require/settings.php`.The name of your site. Default `My FlightAirMap Site`. Optional. - -`FAM_LANGUAGE`: Sets the `$globalLanguage` variable in `require/settings.php`. Interface language. Can be set to `EN`, `DE` or `FR`. Default `EN`. Optional. - -`FAM_MAPPROVIDER`: Sets the `$globalMapProvider` variable in `require/settings.php`. Can be `Mapbox`, `OpenStreetMap`, `MapQuest-OSM` or `MapQuest-Aerial`. Default `OpenStreetMap`. Optional. - -`FAM_MAPBOXID`: Sets the `$globalMapboxId` variable in `require/settings.php`. Default: "examples.map-i86nkdio" Optional. - -`FAM_MAPBOXTOKEN`: Sets the `$globalMapboxToken` variable in `require/settings.php`. Default is unset. Optional. - -`FAM_GOOGLEKEY`: Sets the `$globalGoogleAPIKey` variable in `require/settings.php`. Default is unset. Optional. - -`FAM_BINGKEY`: Sets the `$globalBingMapKey` variable in `require/settings.php`. Default is unset. Optional. - -`FAM_MAPQUESTKEY`: Sets the `$globalMapQuestKey` variable in `require/settings.php`. Default is unset. Optional. - -`FAM_HEREAPPID`: Sets the `$globalHereappID` variable in `require/settings.php`. Default is unset. Optional. - -`FAM_HEREAPPCODE`: Sets the `$globalHereappCode` variable in `require/settings.php`. Default is unset. Optional. - -`FAM_OPENWEATHERMAPKEY`: Sets the `$globalOpenWeatherMapKey` variable in `require/settings.php`. Default is unset. Optional. - -`FAM_LATITUDEMAX`: Sets the `$globalLatitudeMax` variable in `require/settings.php`. Default is `46.92`. Optional. - -`FAM_LATITUDEMIN`: Sets the `$globalLatitudeMin` variable in `require/settings.php`. Default is `42.14`. Optional. - -`FAM_LONGITUDEMAX`: Sets the `$globalLongitudeMax` variable in `require/settings.php`. Default is `6.2`. Optional. - -`FAM_LONGITUDEMIN`: Sets the `$globalLongitudeMin` variable in `require/settings.php`. Default is `1.0`. Optional. - -`FAM_LATITUDECENTER`: Sets the `$globalCenterLatitude` variable in `require/settings.php`. Default is `46.38`. Optional. - -`FAM_LONGITUDECENTER`: Sets the `$globalCenterLongitude` variable in `require/settings.php`. Default is `5.29`. Optional. - -`FAM_LIVEZOOM`: Sets the `$globalLiveZoom` variable in `require/settings.php`. Default is `9`. Optional. - -`FAM_SQUAWK_COUNTRY`: Sets the `$globalSquawkCountry` variable in `require/settings.php`. Can be set to `UK`, `NZ`, `US`, `AU`, `NL`, `FR` or `TR`. Default `EU`. Optional. - -`FAM_SAILAWAYEMAIL`: Sets the `$globalSailaway` array's `email` value in `require/settings.php`. Default is unset. Optional. - -`FAM_SAILAWAYPASSWORD`: Sets the `$globalSailaway` array's `password` value in `require/settings.php`. Default is unset. Optional. - -`FAM_SAILAWAYKEY`: Sets the `$globalSailaway` array's `key` value in `require/settings.php`. Default is unset. Optional. - -`FAM_BRITISHAIRWAYSAPIKEY`: Sets the `$globalBritishAirwaysKey` variable in `require/settings.php`. Default is unset. Optional. - -`FAM_CORSPROXY`: Sets the `$globalCORSproxy` variable in `require/settings.php`. Default `https://galvanize-cors-proxy.herokuapp.com/`. Optional. - -`FAM_LUFTHANSAKEY`: Sets the `$globalLufthansaKey` array's `key` value in `require/settings.php`. Default is unset. Optional. - -`FAM_LUFTHANSASECRET`: Sets the `$globalLufthansaKey` array's `secret` value in `require/settings.php`. Default is unset. Optional. - -`FAM_FLIGHTAWAREUSERNAME`: Sets the `$globalFlightAwareUsername` variable in `require/settings.php`. Default is unset. Optional. - -`FAM_FLIGHTAWAREPASSWORD`: Sets the `$globalFlightAwarePassword` variable in `require/settings.php`. Default is unset. Optional. - -`FAM_MAPMATCHINGSOURCE`: Sets the `$globalMapMatchingSource` variable in `require/settings.php`. Default is `fam`. Optional. - -`FAM_GRAPHHOPPERAPIKEY`: Sets the `$globalGraphHopperKey` variable in `require/settings.php`. Default is unset. Optional. - -`FAM_NOTAMSOURCE`: Sets the `$globalNOTAMSource` variable in `require/settings.php`. Default is unset. Optional. - -`FAM_METARSOURCE`: Sets the `$globalMETARurl` variable in `require/settings.php`. Default is unset. Optional. - -`FAM_BITLYACCESSTOKENAPI`: Sets the `$globalBitlyAccessToken` variable in `require/settings.php`. Default is unset. Optional. - -`FAM_GEOID_SOURCE` Sets the `$globalGeoidSource` variable in `require/settings.php`. Default `egm96-15`. Optional. - -`FAM_ENABLE_ACARS` Sets the `$globalACARS` variable in `require/settings.php`. Default `false`. Optional. - -`FAM_GLOBAL_URL` Sets the `$globalURL` variable in `require/settings.php`. Default is unset. Sets the URL pathing for asset requests. Useful for running FAM behind a proxy. No trailing `/`. Optional. +| Name | Description | Default | Required | +| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | --------- | +| `TZ` | Your local timezone in "TZ database name" format [List-of-tz-database-time-zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | `UTC` | Optional. | +| `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 | +| `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 | +| `FAM_MAPBOXID` | Sets the `$globalMapboxId` variable in `require/settings.php`. | `examples.map-i86nkdio` | Optional | +| `FAM_MAPBOXTOKEN` | Sets the `$globalMapboxToken` variable in `require/settings.php` . | `unset` | Optional | +| `FAM_GOOGLEKEY` | Sets the `$globalGoogleAPIKey` variable in `require/settings.php` . | `unset` | Optional | +| `FAM_BINGKEY` | Sets the `$globalBingMapKey` variable in `require/settings.php` . | `unset` | Optional | +| `FAM_MAPQUESTKEY` | Sets the `$globalMapQuestKey` variable in `require/settings.php` . | `unset` | Optional | +| `FAM_HEREAPPID` | Sets the `$globalHereappID` variable in `require/settings.php` . | `unset` | Optional | +| `FAM_HEREAPPCODE` | Sets the `$globalHereappCode` variable in `require/settings.php` . | `unset` | Optional | +| `FAM_OPENWEATHERMAPKEY` | Sets the `$globalOpenWeatherMapKey` variable in `require/settings.php` . | `unset` | Optional | +| `FAM_LATITUDEMAX` | Sets the `$globalLatitudeMax` variable in `require/settings.php`. | 46.92`. | Optional | +| `FAM_LATITUDEMIN` | Sets the `$globalLatitudeMin` variable in `require/settings.php`. | 42.14`. | Optional | +| `FAM_LONGITUDEMAX` | Sets the `$globalLongitudeMax` variable in `require/settings.php`. | `6.2`. | Optional | +| `FAM_LONGITUDEMIN` | Sets the `$globalLongitudeMin` variable in `require/settings.php`. | `1.0`. | Optional | +| `FAM_LATITUDECENTER` | Sets the `$globalCenterLatitude` variable in `require/settings.php`. | `46.38`. | Optional | +| `FAM_LONGITUDECENTER` | Sets the `$globalCenterLongitude` variable in `require/settings.php`. | `5.29`. | Optional | +| `FAM_LIVEZOOM` | Sets the `$globalLiveZoom` variable in `require/settings.php`. | `9`. | Optional | +| `FAM_SQUAWK_COUNTRY` | Sets the `$globalSquawkCountry` variable in `require/settings.php`. Can be set to `UK`, `NZ`, `US`, `AU`, `NL`, `FR` or `TR`. | `EU`. | Optional | +| `FAM_SAILAWAYEMAIL` | Sets the `$globalSailaway` array's `email` value in `require/settings.php` . | `unset` | Optional | +| `FAM_SAILAWAYPASSWORD` | Sets the `$globalSailaway` array's `password` value in `require/settings.php` . | `unset` | Optional | +| `FAM_SAILAWAYKEY` | Sets the `$globalSailaway` array's `key` value in `require/settings.php` . | `unset` | Optional | +| `FAM_BRITISHAIRWAYSAPIKEY` | Sets the `$globalBritishAirwaysKey` variable in `require/settings.php` . | `unset` | Optional | +| `FAM_CORSPROXY` | Sets the `$globalCORSproxy` variable in `require/settings.php`. | `https://galvanize-cors-proxy.herokuapp.com/`. | Optional | +| `FAM_LUFTHANSAKEY` | Sets the `$globalLufthansaKey` array's `key` value in `require/settings.php` . | `unset` | Optional | +| `FAM_LUFTHANSASECRET` | Sets the `$globalLufthansaKey` array's `secret` value in `require/settings.php` . | `unset` | Optional | +| `FAM_FLIGHTAWAREUSERNAME` | Sets the `$globalFlightAwareUsername` variable in `require/settings.php` . | `unset` | Optional | +| `FAM_FLIGHTAWAREPASSWORD` | Sets the `$globalFlightAwarePassword` variable in `require/settings.php` . | `unset` | Optional | +| `FAM_MAPMATCHINGSOURCE` | Sets the `$globalMapMatchingSource` variable in `require/settings.php`. | `fam`. | Optional | +| `FAM_GRAPHHOPPERAPIKEY` | Sets the `$globalGraphHopperKey` variable in `require/settings.php` . | `unset` | Optional | +| `FAM_NOTAMSOURCE` | Sets the `$globalNOTAMSource` variable in `require/settings.php` . | `unset` | Optional | +| `FAM_METARSOURCE` | Sets the `$globalMETARurl` variable in `require/settings.php` . | `unset` | Optional | +| `FAM_BITLYACCESSTOKENAPI` | Sets the `$globalBitlyAccessToken` variable in `require/settings.php` . | `unset` | Optional | +| `FAM_GEOID_SOURCE` | Sets the `$globalGeoidSource` variable in `require/settings.php`. | egm96-15`. | Optional | +| `FAM_ENABLE_ACARS` | Sets the `$globalACARS` variable in `require/settings.php`. | `false` | Optional | +| `FAM_GLOBAL_URL` | Sets the `$globalURL` variable in `require/settings.php`. Default is unset. Sets the URL pathing for asset requests. Useful for running FAM behind a proxy. No trailing `/`. | `unset` | Optional | If you wish to use an external database: -`MYSQLHOSTNAME` Sets the hostname of the mysql/mariadb server. - -`MYSQLPORT` Sets the port used to communicate to mysql/mariadb. Default `3306`. Optional. - -`MYSQLDATABASE` Sets the mysql/mariadb database name. Default `flightairmap`. Optional. - -`MYSQLUSERNAME` Sets the mysql/mariadb user name. Default `flightairmap`. Optional. - -`MYSQLPASSWORD` Sets the mysql/mariadb password. +| Name | Description | Default | Required | +| --------------- | --------------------------------------------------- | --------------- | -------------------------------------------------------- | +| `MYSQLHOSTNAME` | Sets the hostname of the mysql/mariadb server. | `unset` | Required for external databases, else please leave unset | +| `MYSQLPORT` | Sets the port used to communicate to mysql/mariadb. | `3306` | Required for external databases, else please leave unset | +| `MYSQLDATABASE` | Sets the mysql/mariadb database name. | `flightairmap`. | Required for external databases, else please leave unset | +| `MYSQLUSERNAME` | Sets the mysql/mariadb user name. | `flightairmap`. | Required for external databases, else please leave unset | +| `MYSQLPASSWORD` | Sets the mysql/mariadb password. | `unset` | Required for external databases, else please leave unset | ### Data Volumes From d6baeeb0ca92134610e8f82f471088f06b09a1bb Mon Sep 17 00:00:00 2001 From: Fred Clausen <43556888+fredclausen@users.noreply.github.com> Date: Wed, 1 Nov 2023 11:59:59 -0600 Subject: [PATCH 08/12] Change scripts to use bash for startup and source /scripts/common. ngninx as no-daemon --- rootfs/etc/s6-overlay/scripts/daemon-acars | 6 ++++-- rootfs/etc/s6-overlay/scripts/daemon-spotter | 6 ++++-- rootfs/etc/s6-overlay/scripts/mysql | 6 ++++-- rootfs/etc/s6-overlay/scripts/nginx | 8 +++++--- rootfs/etc/s6-overlay/scripts/php-fpm | 6 ++++-- rootfs/etc/s6-overlay/scripts/socat | 6 ++++-- rootfs/etc/s6-overlay/scripts/update_db | 6 ++++-- 7 files changed, 29 insertions(+), 15 deletions(-) diff --git a/rootfs/etc/s6-overlay/scripts/daemon-acars b/rootfs/etc/s6-overlay/scripts/daemon-acars index e2f4c92..7f9bb43 100755 --- a/rootfs/etc/s6-overlay/scripts/daemon-acars +++ b/rootfs/etc/s6-overlay/scripts/daemon-acars @@ -1,5 +1,7 @@ -#!/command/with-contenv sh -# shellcheck shell=sh +#!/command/with-contenv bash +# shellcheck shell=bash + +source /scripts/common s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) "${s6wrap[@]}" s6-setuidgid "$WEBUSER" php /var/www/flightairmap/htdocs/scripts/daemon-acars.php diff --git a/rootfs/etc/s6-overlay/scripts/daemon-spotter b/rootfs/etc/s6-overlay/scripts/daemon-spotter index 76167fc..0a5c885 100755 --- a/rootfs/etc/s6-overlay/scripts/daemon-spotter +++ b/rootfs/etc/s6-overlay/scripts/daemon-spotter @@ -1,5 +1,7 @@ -#!/command/with-contenv sh -# shellcheck shell=sh +#!/command/with-contenv bash +# shellcheck shell=bash + +source /scripts/common s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) "${s6wrap[@]}" s6-setuidgid "$WEBUSER" php /var/www/flightairmap/htdocs/scripts/daemon-spotter.php diff --git a/rootfs/etc/s6-overlay/scripts/mysql b/rootfs/etc/s6-overlay/scripts/mysql index 7e3ad36..1c8d467 100755 --- a/rootfs/etc/s6-overlay/scripts/mysql +++ b/rootfs/etc/s6-overlay/scripts/mysql @@ -1,5 +1,7 @@ -#!/command/with-contenv sh -# shellcheck shell=sh +#!/command/with-contenv bash +# shellcheck shell=bash + +source /scripts/common s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) diff --git a/rootfs/etc/s6-overlay/scripts/nginx b/rootfs/etc/s6-overlay/scripts/nginx index 1f0cb6d..8d33d2e 100755 --- a/rootfs/etc/s6-overlay/scripts/nginx +++ b/rootfs/etc/s6-overlay/scripts/nginx @@ -1,5 +1,7 @@ -#!/command/with-contenv sh -# shellcheck shell=sh +#!/command/with-contenv bash +# shellcheck shell=bash + +source /scripts/common s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) -"${s6wrap[@]}" /usr/sbin/nginx +"${s6wrap[@]}" /usr/sbin/nginx -g 'daemon off;' diff --git a/rootfs/etc/s6-overlay/scripts/php-fpm b/rootfs/etc/s6-overlay/scripts/php-fpm index 972699c..ea36ca5 100755 --- a/rootfs/etc/s6-overlay/scripts/php-fpm +++ b/rootfs/etc/s6-overlay/scripts/php-fpm @@ -1,5 +1,7 @@ -#!/command/with-contenv sh -# shellcheck shell=sh +#!/command/with-contenv bash +# shellcheck shell=bash + +source /scripts/common s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) "${s6wrap[@]}" /usr/sbin/php-fpm7.4 --nodaemonize diff --git a/rootfs/etc/s6-overlay/scripts/socat b/rootfs/etc/s6-overlay/scripts/socat index ce38e98..99582c7 100755 --- a/rootfs/etc/s6-overlay/scripts/socat +++ b/rootfs/etc/s6-overlay/scripts/socat @@ -1,5 +1,7 @@ -#!/command/with-contenv sh -# shellcheck shell=sh +#!/command/with-contenv bash +# shellcheck shell=bash + +source /scripts/common s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) diff --git a/rootfs/etc/s6-overlay/scripts/update_db b/rootfs/etc/s6-overlay/scripts/update_db index 9a9059d..53589c4 100755 --- a/rootfs/etc/s6-overlay/scripts/update_db +++ b/rootfs/etc/s6-overlay/scripts/update_db @@ -1,5 +1,7 @@ -#!/command/with-contenv sh -# shellcheck shell=sh +#!/command/with-contenv bash +# shellcheck shell=bash + +source /scripts/common s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) "${s6wrap[@]}" sleep 1h From 10bd0be1a47fc30b941dca896898f9bdeb6a5fd7 Mon Sep 17 00:00:00 2001 From: Fred Clausen <43556888+fredclausen@users.noreply.github.com> Date: Wed, 1 Nov 2023 12:32:49 -0600 Subject: [PATCH 09/12] (somewhat) quiet down FAM/daemon spotter logs. Add option to toggle quiet logs on and off --- Dockerfile | 3 ++- README.md | 1 + rootfs/etc/s6-overlay/scripts/daemon-spotter | 19 ++++++++++++++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1c10681..cefbc5c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/README.md b/README.md index eeff81d..be6fdd2 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,7 @@ of this parameter has the format `=`. | `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 | diff --git a/rootfs/etc/s6-overlay/scripts/daemon-spotter b/rootfs/etc/s6-overlay/scripts/daemon-spotter index 0a5c885..3949762 100755 --- a/rootfs/etc/s6-overlay/scripts/daemon-spotter +++ b/rootfs/etc/s6-overlay/scripts/daemon-spotter @@ -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 From 095cb9e67b464a8627ddd9583332b3eb668b9ebb Mon Sep 17 00:00:00 2001 From: Fred Clausen <43556888+fredclausen@users.noreply.github.com> Date: Wed, 1 Nov 2023 12:36:05 -0600 Subject: [PATCH 10/12] linting --- rootfs/etc/s6-overlay/scripts/daemon-acars | 1 + rootfs/etc/s6-overlay/scripts/daemon-spotter | 5 +++++ rootfs/etc/s6-overlay/scripts/mysql | 1 + rootfs/etc/s6-overlay/scripts/nginx | 1 + rootfs/etc/s6-overlay/scripts/php-fpm | 1 + rootfs/etc/s6-overlay/scripts/socat | 1 + rootfs/etc/s6-overlay/scripts/update_db | 1 + 7 files changed, 11 insertions(+) diff --git a/rootfs/etc/s6-overlay/scripts/daemon-acars b/rootfs/etc/s6-overlay/scripts/daemon-acars index 7f9bb43..d02ae3c 100755 --- a/rootfs/etc/s6-overlay/scripts/daemon-acars +++ b/rootfs/etc/s6-overlay/scripts/daemon-acars @@ -1,6 +1,7 @@ #!/command/with-contenv bash # shellcheck shell=bash +# shellcheck disable=SC1091,SC2086,SC2016 source /scripts/common s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) diff --git a/rootfs/etc/s6-overlay/scripts/daemon-spotter b/rootfs/etc/s6-overlay/scripts/daemon-spotter index 3949762..b33ba0d 100755 --- a/rootfs/etc/s6-overlay/scripts/daemon-spotter +++ b/rootfs/etc/s6-overlay/scripts/daemon-spotter @@ -1,10 +1,12 @@ #!/command/with-contenv bash # shellcheck shell=bash +# shellcheck disable=SC1091,SC2086,SC2016 source /scripts/common s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) if chk_enabled $QUIET_FAM; then +# shellcheck disable=SC1091,SC2086,SC2016 "${s6wrap[@]}" s6-setuidgid "$WEBUSER" php /var/www/flightairmap/htdocs/scripts/daemon-spotter.php 2>&1 | \ stdbuf -oL awk '! /\\o\//' | \ stdbuf -oL awk '! /DATA : /' | \ @@ -18,7 +20,10 @@ if chk_enabled $QUIET_FAM; then stdbuf -oL awk '! /get arrival\/departure airport/' | \ stdbuf -oL awk '! /Deleting Live Spotter/' | \ stdbuf -oL awk '! /Calculated Speed/' | \ + stdbuf -oL awk '! /Calculated Altitude/' | \ + stdbuf -oL awk '! /Calculated Heading/' | \ stdbuf -oL awk '{print $0}' else +# shellcheck disable=SC1091,SC2086,SC2016 "${s6wrap[@]}" s6-setuidgid "$WEBUSER" php /var/www/flightairmap/htdocs/scripts/daemon-spotter.php fi diff --git a/rootfs/etc/s6-overlay/scripts/mysql b/rootfs/etc/s6-overlay/scripts/mysql index 1c8d467..58177ea 100755 --- a/rootfs/etc/s6-overlay/scripts/mysql +++ b/rootfs/etc/s6-overlay/scripts/mysql @@ -1,6 +1,7 @@ #!/command/with-contenv bash # shellcheck shell=bash +# shellcheck disable=SC1091,SC2086,SC2016 source /scripts/common s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) diff --git a/rootfs/etc/s6-overlay/scripts/nginx b/rootfs/etc/s6-overlay/scripts/nginx index 8d33d2e..3d30efd 100755 --- a/rootfs/etc/s6-overlay/scripts/nginx +++ b/rootfs/etc/s6-overlay/scripts/nginx @@ -1,6 +1,7 @@ #!/command/with-contenv bash # shellcheck shell=bash +# shellcheck disable=SC1091,SC2086,SC2016 source /scripts/common s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) diff --git a/rootfs/etc/s6-overlay/scripts/php-fpm b/rootfs/etc/s6-overlay/scripts/php-fpm index ea36ca5..a2811de 100755 --- a/rootfs/etc/s6-overlay/scripts/php-fpm +++ b/rootfs/etc/s6-overlay/scripts/php-fpm @@ -1,6 +1,7 @@ #!/command/with-contenv bash # shellcheck shell=bash +# shellcheck disable=SC1091,SC2086,SC2016 source /scripts/common s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) diff --git a/rootfs/etc/s6-overlay/scripts/socat b/rootfs/etc/s6-overlay/scripts/socat index 99582c7..72e70be 100755 --- a/rootfs/etc/s6-overlay/scripts/socat +++ b/rootfs/etc/s6-overlay/scripts/socat @@ -1,6 +1,7 @@ #!/command/with-contenv bash # shellcheck shell=bash +# shellcheck disable=SC1091,SC2086,SC2016 source /scripts/common s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) diff --git a/rootfs/etc/s6-overlay/scripts/update_db b/rootfs/etc/s6-overlay/scripts/update_db index 53589c4..5ca86a6 100755 --- a/rootfs/etc/s6-overlay/scripts/update_db +++ b/rootfs/etc/s6-overlay/scripts/update_db @@ -1,6 +1,7 @@ #!/command/with-contenv bash # shellcheck shell=bash +# shellcheck disable=SC1091,SC2086,SC2016 source /scripts/common s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) From dcfed356a07238394770b1cbddd039d9a2d1dff2 Mon Sep 17 00:00:00 2001 From: Fred Clausen <43556888+fredclausen@users.noreply.github.com> Date: Wed, 1 Nov 2023 12:37:59 -0600 Subject: [PATCH 11/12] more linting --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index be6fdd2..ddd5b0d 100644 --- a/README.md +++ b/README.md @@ -144,14 +144,14 @@ of this parameter has the format `=`. | `FAM_HEREAPPID` | Sets the `$globalHereappID` variable in `require/settings.php` . | `unset` | Optional | | `FAM_HEREAPPCODE` | Sets the `$globalHereappCode` variable in `require/settings.php` . | `unset` | Optional | | `FAM_OPENWEATHERMAPKEY` | Sets the `$globalOpenWeatherMapKey` variable in `require/settings.php` . | `unset` | Optional | -| `FAM_LATITUDEMAX` | Sets the `$globalLatitudeMax` variable in `require/settings.php`. | 46.92`. | Optional | -| `FAM_LATITUDEMIN` | Sets the `$globalLatitudeMin` variable in `require/settings.php`. | 42.14`. | Optional | -| `FAM_LONGITUDEMAX` | Sets the `$globalLongitudeMax` variable in `require/settings.php`. | `6.2`. | Optional | -| `FAM_LONGITUDEMIN` | Sets the `$globalLongitudeMin` variable in `require/settings.php`. | `1.0`. | Optional | -| `FAM_LATITUDECENTER` | Sets the `$globalCenterLatitude` variable in `require/settings.php`. | `46.38`. | Optional | -| `FAM_LONGITUDECENTER` | Sets the `$globalCenterLongitude` variable in `require/settings.php`. | `5.29`. | Optional | -| `FAM_LIVEZOOM` | Sets the `$globalLiveZoom` variable in `require/settings.php`. | `9`. | Optional | -| `FAM_SQUAWK_COUNTRY` | Sets the `$globalSquawkCountry` variable in `require/settings.php`. Can be set to `UK`, `NZ`, `US`, `AU`, `NL`, `FR` or `TR`. | `EU`. | Optional | +| `FAM_LATITUDEMAX` | Sets the `$globalLatitudeMax` variable in `require/settings.php`. | `46.92` | Optional | +| `FAM_LATITUDEMIN` | Sets the `$globalLatitudeMin` variable in `require/settings.php`. | 42.14` | Optional | +| `FAM_LONGITUDEMAX` | Sets the `$globalLongitudeMax` variable in `require/settings.php`. | `6.2` | Optional | +| `FAM_LONGITUDEMIN` | Sets the `$globalLongitudeMin` variable in `require/settings.php`. | `1.0` | Optional | +| `FAM_LATITUDECENTER` | Sets the `$globalCenterLatitude` variable in `require/settings.php`. | `46.38` | Optional | +| `FAM_LONGITUDECENTER` | Sets the `$globalCenterLongitude` variable in `require/settings.php`. | `5.29` | Optional | +| `FAM_LIVEZOOM` | Sets the `$globalLiveZoom` variable in `require/settings.php`. | `9` | Optional | +| `FAM_SQUAWK_COUNTRY` | Sets the `$globalSquawkCountry` variable in `require/settings.php`. Can be set to `UK`, `NZ`, `US`, `AU`, `NL`, `FR` or `TR`. | `EU` | Optional | | `FAM_SAILAWAYEMAIL` | Sets the `$globalSailaway` array's `email` value in `require/settings.php` . | `unset` | Optional | | `FAM_SAILAWAYPASSWORD` | Sets the `$globalSailaway` array's `password` value in `require/settings.php` . | `unset` | Optional | | `FAM_SAILAWAYKEY` | Sets the `$globalSailaway` array's `key` value in `require/settings.php` . | `unset` | Optional | @@ -161,12 +161,12 @@ of this parameter has the format `=`. | `FAM_LUFTHANSASECRET` | Sets the `$globalLufthansaKey` array's `secret` value in `require/settings.php` . | `unset` | Optional | | `FAM_FLIGHTAWAREUSERNAME` | Sets the `$globalFlightAwareUsername` variable in `require/settings.php` . | `unset` | Optional | | `FAM_FLIGHTAWAREPASSWORD` | Sets the `$globalFlightAwarePassword` variable in `require/settings.php` . | `unset` | Optional | -| `FAM_MAPMATCHINGSOURCE` | Sets the `$globalMapMatchingSource` variable in `require/settings.php`. | `fam`. | Optional | +| `FAM_MAPMATCHINGSOURCE` | Sets the `$globalMapMatchingSource` variable in `require/settings.php`. | `fam` | Optional | | `FAM_GRAPHHOPPERAPIKEY` | Sets the `$globalGraphHopperKey` variable in `require/settings.php` . | `unset` | Optional | | `FAM_NOTAMSOURCE` | Sets the `$globalNOTAMSource` variable in `require/settings.php` . | `unset` | Optional | | `FAM_METARSOURCE` | Sets the `$globalMETARurl` variable in `require/settings.php` . | `unset` | Optional | | `FAM_BITLYACCESSTOKENAPI` | Sets the `$globalBitlyAccessToken` variable in `require/settings.php` . | `unset` | Optional | -| `FAM_GEOID_SOURCE` | Sets the `$globalGeoidSource` variable in `require/settings.php`. | egm96-15`. | Optional | +| `FAM_GEOID_SOURCE` | Sets the `$globalGeoidSource` variable in `require/settings.php`. | `egm96-15` | Optional | | `FAM_ENABLE_ACARS` | Sets the `$globalACARS` variable in `require/settings.php`. | `false` | Optional | | `FAM_GLOBAL_URL` | Sets the `$globalURL` variable in `require/settings.php`. Default is unset. Sets the URL pathing for asset requests. Useful for running FAM behind a proxy. No trailing `/`. | `unset` | Optional | From 339f5d3da1c8b7fecc40b3bfe187dde5bda018e1 Mon Sep 17 00:00:00 2001 From: Fred Clausen <43556888+fredclausen@users.noreply.github.com> Date: Wed, 1 Nov 2023 12:41:59 -0600 Subject: [PATCH 12/12] linting --- README.md | 86 +++++++++++++++++++++++++++---------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index ddd5b0d..3953550 100644 --- a/README.md +++ b/README.md @@ -126,49 +126,49 @@ To customize some properties of the container, the following environment variables can be passed via the `-e` parameter (one for each variable). Value of this parameter has the format `=`. -| Name | Description | Default | Required | -| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | --------- | -| `TZ` | Your local timezone in "TZ database name" format [List-of-tz-database-time-zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | `UTC` | Optional. | -| `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 | -| `FAM_MAPBOXID` | Sets the `$globalMapboxId` variable in `require/settings.php`. | `examples.map-i86nkdio` | Optional | -| `FAM_MAPBOXTOKEN` | Sets the `$globalMapboxToken` variable in `require/settings.php` . | `unset` | Optional | -| `FAM_GOOGLEKEY` | Sets the `$globalGoogleAPIKey` variable in `require/settings.php` . | `unset` | Optional | -| `FAM_BINGKEY` | Sets the `$globalBingMapKey` variable in `require/settings.php` . | `unset` | Optional | -| `FAM_MAPQUESTKEY` | Sets the `$globalMapQuestKey` variable in `require/settings.php` . | `unset` | Optional | -| `FAM_HEREAPPID` | Sets the `$globalHereappID` variable in `require/settings.php` . | `unset` | Optional | -| `FAM_HEREAPPCODE` | Sets the `$globalHereappCode` variable in `require/settings.php` . | `unset` | Optional | -| `FAM_OPENWEATHERMAPKEY` | Sets the `$globalOpenWeatherMapKey` variable in `require/settings.php` . | `unset` | Optional | -| `FAM_LATITUDEMAX` | Sets the `$globalLatitudeMax` variable in `require/settings.php`. | `46.92` | Optional | -| `FAM_LATITUDEMIN` | Sets the `$globalLatitudeMin` variable in `require/settings.php`. | 42.14` | Optional | -| `FAM_LONGITUDEMAX` | Sets the `$globalLongitudeMax` variable in `require/settings.php`. | `6.2` | Optional | -| `FAM_LONGITUDEMIN` | Sets the `$globalLongitudeMin` variable in `require/settings.php`. | `1.0` | Optional | -| `FAM_LATITUDECENTER` | Sets the `$globalCenterLatitude` variable in `require/settings.php`. | `46.38` | Optional | -| `FAM_LONGITUDECENTER` | Sets the `$globalCenterLongitude` variable in `require/settings.php`. | `5.29` | Optional | -| `FAM_LIVEZOOM` | Sets the `$globalLiveZoom` variable in `require/settings.php`. | `9` | Optional | -| `FAM_SQUAWK_COUNTRY` | Sets the `$globalSquawkCountry` variable in `require/settings.php`. Can be set to `UK`, `NZ`, `US`, `AU`, `NL`, `FR` or `TR`. | `EU` | Optional | -| `FAM_SAILAWAYEMAIL` | Sets the `$globalSailaway` array's `email` value in `require/settings.php` . | `unset` | Optional | -| `FAM_SAILAWAYPASSWORD` | Sets the `$globalSailaway` array's `password` value in `require/settings.php` . | `unset` | Optional | -| `FAM_SAILAWAYKEY` | Sets the `$globalSailaway` array's `key` value in `require/settings.php` . | `unset` | Optional | -| `FAM_BRITISHAIRWAYSAPIKEY` | Sets the `$globalBritishAirwaysKey` variable in `require/settings.php` . | `unset` | Optional | -| `FAM_CORSPROXY` | Sets the `$globalCORSproxy` variable in `require/settings.php`. | `https://galvanize-cors-proxy.herokuapp.com/`. | Optional | -| `FAM_LUFTHANSAKEY` | Sets the `$globalLufthansaKey` array's `key` value in `require/settings.php` . | `unset` | Optional | -| `FAM_LUFTHANSASECRET` | Sets the `$globalLufthansaKey` array's `secret` value in `require/settings.php` . | `unset` | Optional | -| `FAM_FLIGHTAWAREUSERNAME` | Sets the `$globalFlightAwareUsername` variable in `require/settings.php` . | `unset` | Optional | -| `FAM_FLIGHTAWAREPASSWORD` | Sets the `$globalFlightAwarePassword` variable in `require/settings.php` . | `unset` | Optional | -| `FAM_MAPMATCHINGSOURCE` | Sets the `$globalMapMatchingSource` variable in `require/settings.php`. | `fam` | Optional | -| `FAM_GRAPHHOPPERAPIKEY` | Sets the `$globalGraphHopperKey` variable in `require/settings.php` . | `unset` | Optional | -| `FAM_NOTAMSOURCE` | Sets the `$globalNOTAMSource` variable in `require/settings.php` . | `unset` | Optional | -| `FAM_METARSOURCE` | Sets the `$globalMETARurl` variable in `require/settings.php` . | `unset` | Optional | -| `FAM_BITLYACCESSTOKENAPI` | Sets the `$globalBitlyAccessToken` variable in `require/settings.php` . | `unset` | Optional | -| `FAM_GEOID_SOURCE` | Sets the `$globalGeoidSource` variable in `require/settings.php`. | `egm96-15` | Optional | -| `FAM_ENABLE_ACARS` | Sets the `$globalACARS` variable in `require/settings.php`. | `false` | Optional | -| `FAM_GLOBAL_URL` | Sets the `$globalURL` variable in `require/settings.php`. Default is unset. Sets the URL pathing for asset requests. Useful for running FAM behind a proxy. No trailing `/`. | `unset` | Optional | +| Name | Description | Default | Required | +| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | --------- | +| `TZ` | Your local timezone in "TZ database name" format [List-of-tz-database-time-zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | `UTC` | Optional. | +| `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 | +| `FAM_MAPBOXID` | Sets the `$globalMapboxId` variable in `require/settings.php` | `examples.map-i86nkdio` | Optional | +| `FAM_MAPBOXTOKEN` | Sets the `$globalMapboxToken` variable in `require/settings.php` | `unset` | Optional | +| `FAM_GOOGLEKEY` | Sets the `$globalGoogleAPIKey` variable in `require/settings.php` | `unset` | Optional | +| `FAM_BINGKEY` | Sets the `$globalBingMapKey` variable in `require/settings.php` | `unset` | Optional | +| `FAM_MAPQUESTKEY` | Sets the `$globalMapQuestKey` variable in `require/settings.php` | `unset` | Optional | +| `FAM_HEREAPPID` | Sets the `$globalHereappID` variable in `require/settings.php` | `unset` | Optional | +| `FAM_HEREAPPCODE` | Sets the `$globalHereappCode` variable in `require/settings.php` | `unset` | Optional | +| `FAM_OPENWEATHERMAPKEY` | Sets the `$globalOpenWeatherMapKey` variable in `require/settings.php` | `unset` | Optional | +| `FAM_LATITUDEMAX` | Sets the `$globalLatitudeMax` variable in `require/settings.php` | `46.92` | Optional | +| `FAM_LATITUDEMIN` | Sets the `$globalLatitudeMin` variable in `require/settings.php` | 42.14` | Optional | +| `FAM_LONGITUDEMAX` | Sets the `$globalLongitudeMax` variable in `require/settings.php` | `6.2` | Optional | +| `FAM_LONGITUDEMIN` | Sets the `$globalLongitudeMin` variable in `require/settings.php` | `1.0` | Optional | +| `FAM_LATITUDECENTER` | Sets the `$globalCenterLatitude` variable in `require/settings.php` | `46.38` | Optional | +| `FAM_LONGITUDECENTER` | Sets the `$globalCenterLongitude` variable in `require/settings.php` | `5.29` | Optional | +| `FAM_LIVEZOOM` | Sets the `$globalLiveZoom` variable in `require/settings.php` | `9` | Optional | +| `FAM_SQUAWK_COUNTRY` | Sets the `$globalSquawkCountry` variable in `require/settings.php`. Can be set to `UK`, `NZ`, `US`, `AU`, `NL`, `FR` or `TR` | `EU` | Optional | +| `FAM_SAILAWAYEMAIL` | Sets the `$globalSailaway` array's `email` value in `require/settings.php` | `unset` | Optional | +| `FAM_SAILAWAYPASSWORD` | Sets the `$globalSailaway` array's `password` value in `require/settings.php` | `unset` | Optional | +| `FAM_SAILAWAYKEY` | Sets the `$globalSailaway` array's `key` value in `require/settings.php` | `unset` | Optional | +| `FAM_BRITISHAIRWAYSAPIKEY` | Sets the `$globalBritishAirwaysKey` variable in `require/settings.php` | `unset` | Optional | +| `FAM_CORSPROXY` | Sets the `$globalCORSproxy` variable in `require/settings.php` | [cors](https://galvanize-cors-proxy.herokuapp.com/) | Optional | +| `FAM_LUFTHANSAKEY` | Sets the `$globalLufthansaKey` array's `key` value in `require/settings.php` | `unset` | Optional | +| `FAM_LUFTHANSASECRET` | Sets the `$globalLufthansaKey` array's `secret` value in `require/settings.php` | `unset` | Optional | +| `FAM_FLIGHTAWAREUSERNAME` | Sets the `$globalFlightAwareUsername` variable in `require/settings.php` | `unset` | Optional | +| `FAM_FLIGHTAWAREPASSWORD` | Sets the `$globalFlightAwarePassword` variable in `require/settings.php` | `unset` | Optional | +| `FAM_MAPMATCHINGSOURCE` | Sets the `$globalMapMatchingSource` variable in `require/settings.php` | `fam` | Optional | +| `FAM_GRAPHHOPPERAPIKEY` | Sets the `$globalGraphHopperKey` variable in `require/settings.php` | `unset` | Optional | +| `FAM_NOTAMSOURCE` | Sets the `$globalNOTAMSource` variable in `require/settings.php` | `unset` | Optional | +| `FAM_METARSOURCE` | Sets the `$globalMETARurl` variable in `require/settings.php` | `unset` | Optional | +| `FAM_BITLYACCESSTOKENAPI` | Sets the `$globalBitlyAccessToken` variable in `require/settings.php` | `unset` | Optional | +| `FAM_GEOID_SOURCE` | Sets the `$globalGeoidSource` variable in `require/settings.php` | `egm96-15` | Optional | +| `FAM_ENABLE_ACARS` | Sets the `$globalACARS` variable in `require/settings.php` | `false` | Optional | +| `FAM_GLOBAL_URL` | Sets the `$globalURL` variable in `require/settings.php`. Default is unset. Sets the URL pathing for asset requests. Useful for running FAM behind a proxy. No trailing `/` | `unset` | Optional | If you wish to use an external database: