-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
122 additions
and
97 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
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
Empty file.
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,2 @@ | ||
#!/bin/sh | ||
exec /etc/s6-overlay/scripts/tar1090-update |
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 @@ | ||
longrun |
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,47 @@ | ||
#!/command/with-contenv bash | ||
# shellcheck shell=bash disable=SC1091,SC2154 | ||
|
||
source /scripts/common | ||
|
||
if ! chk_enabled "${UPDATE_TAR1090}" || chk_enabled "${TAR1090_DISABLE}"; then | ||
stop_service | ||
fi | ||
|
||
OVERRIDE_GIT_SOURCE="/var/tar1090_git_source" | ||
|
||
if [[ -d "${OVERRIDE_GIT_SOURCE}/html" ]]; then | ||
"${s6wrap[@]}" echo "USING LOCALLY MODIFIED TAR1090 from ${OVERRIDE_GIT_SOURCE}" | ||
"${s6wrap[@]}" bash /tar1090-install.sh /run/readsb webroot "${TAR1090_INSTALL_DIR}" "${OVERRIDE_GIT_SOURCE}" | ||
TAR1090_VERSION="$(cat "${OVERRIDE_GIT_SOURCE}/version") LOCALLY MODIFIED" | ||
else | ||
"${s6wrap[@]}" bash /tar1090-install.sh /run/readsb webroot "${TAR1090_INSTALL_DIR}" | ||
TAR1090_VERSION=$(cat "${TAR1090_UPDATE_DIR}/git/version") | ||
fi | ||
|
||
# aircraft-db | ||
if chk_enabled "$TAR1090_ENABLE_AC_DB" && curl --connect-timeout 10 --silent --show-error "https://raw.githubusercontent.com/wiedehopf/tar1090-db/csv/version" > "/run/aircraft.csv.gz.version.new"; then | ||
if ! diff -q "${TAR1090_UPDATE_DIR}/aircraft.csv.gz.version" "/run/aircraft.csv.gz.version.new" &>/dev/null; then | ||
"${s6wrap[@]}" echo "Downloading https://raw.githubusercontent.com/wiedehopf/tar1090-db/csv/aircraft.csv.gz" | ||
if "${s6wrap[@]}" curl --connect-timeout 10 --silent --show-error -o "${TAR1090_UPDATE_DIR}/aircraft.csv.gz.tmp" \ | ||
"https://raw.githubusercontent.com/wiedehopf/tar1090-db/csv/aircraft.csv.gz"; then | ||
"${s6wrap[@]}" mv -f "${TAR1090_UPDATE_DIR}/aircraft.csv.gz.tmp" "${TAR1090_UPDATE_DIR}/aircraft.csv.gz" | ||
"${s6wrap[@]}" mv -f "/run/aircraft.csv.gz.version.new" "${TAR1090_UPDATE_DIR}/aircraft.csv.gz.version" | ||
fi | ||
fi | ||
fi | ||
|
||
# Print tar1090 version | ||
TAR1090_DB_VERSION=$(cat "${TAR1090_UPDATE_DIR}/git-db/version") | ||
"${s6wrap[@]}" echo "tar1090 version: ${TAR1090_VERSION} tar1090-db version: ${TAR1090_DB_VERSION}" | ||
export TAR1090_VERSION | ||
|
||
# call the necessary scripts to configure the newly created tar1090 html folder | ||
# they were already run on container startup but there is no harm in running them again | ||
"${s6wrap[@]}" bash /etc/s6-overlay/startup.d/04-tar1090-configure | ||
"${s6wrap[@]}" bash /etc/s6-overlay/startup.d/06-range-outline | ||
|
||
if (( UPDATE_TAR1090_DAYS == 0 )); then | ||
stop_service | ||
fi | ||
|
||
exec sleep $(( UPDATE_TAR1090_DAYS * 86400 )) |
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 was deleted.
Oops, something went wrong.
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,47 @@ | ||
#!/command/with-contenv bash | ||
# shellcheck shell=bash disable=SC1091 | ||
|
||
source /scripts/common | ||
|
||
if ! chk_enabled "${HTTP_ACCESS_LOG}"; then | ||
# shellcheck disable=SC1003 | ||
sed -i 's\access_log .*\access_log off;\' /etc/nginx/nginx.conf | ||
else | ||
# shellcheck disable=SC1003 | ||
sed -i 's\access_log .*\access_log /dev/stdout;\' /etc/nginx/nginx.conf | ||
fi | ||
|
||
if ! chk_enabled "${HTTP_ERROR_LOG}"; then | ||
# shellcheck disable=SC1003 | ||
sed -i 's\error_log .*\error_log /dev/null crit;\' /etc/nginx/nginx.conf | ||
else | ||
# shellcheck disable=SC1003 | ||
sed -i 's\error_log .*\error_log /dev/stdout notice;\' /etc/nginx/nginx.conf | ||
fi | ||
|
||
|
||
# Add in CORS header for tar1090 data/aircraft.json file | ||
# adjust the tar1090 runtime directory to /run/tar1090 | ||
|
||
sed -i \ | ||
-e 's/location ~ aircraft\\.json$ {/location ~ aircraft\.json$ {\n add_header Access-Control-Allow-Origin "\*";/g' \ | ||
-e 's#/run/tar1090-webroot/#/run/tar1090/#' \ | ||
"/etc/nginx/nginx-tar1090-webroot.conf" | ||
|
||
if chk_enabled "${TAR1090_DISABLE}"; then | ||
rm -f /etc/nginx/sites-enabled/tar1090 | ||
fi | ||
|
||
if chk_enabled "${READSB_ENABLE_API}"; then | ||
# shellcheck disable=SC2016 | ||
sed -i -e 's|#sed_placeholder_API_proxy|location /re-api/ {\ | ||
gzip on;\ | ||
proxy_http_version 1.1;\ | ||
proxy_max_temp_file_size 0;\ | ||
proxy_set_header Connection $http_connection;\ | ||
proxy_set_header Host $http_host;\ | ||
proxy_pass http://unix:/run/readsb/api.sock:/$is_args$args;\ | ||
}|' /etc/nginx/sites-enabled/tar1090 | ||
else | ||
cp -Tf /etc/nginx.tar1090/sites-enabled/tar1090 /etc/nginx/sites-enabled/tar1090 | ||
fi |
This file was deleted.
Oops, something went wrong.
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