diff --git a/variables-virtualradar.env b/variables-virtualradar.env index e073f2d..3250804 100644 --- a/variables-virtualradar.env +++ b/variables-virtualradar.env @@ -2,3 +2,6 @@ VIRTUALRADAR_DEFAULT_ADMIN_USER=admin VIRTUALRADAR_DEFAULT_ADMIN_PASSWORD=admin + +VIRTUALRADAR_LATITUDE=0.0 +VIRTUALRADAR_LONGITUDE=0.0 diff --git a/virtualradar/Configuration.xml b/virtualradar/Configuration.xml new file mode 100644 index 0000000..a40594f --- /dev/null +++ b/virtualradar/Configuration.xml @@ -0,0 +1,197 @@ + + + 9 + + TCP + false +
127.0.0.1
+ 30003 + 115200 + 8 + One + None + None + #43-02\r + #43-00\r + /tmp/StandingData.sqb + false + 30 + 600 + 60 + 120 + true + false + 60 + true + true +
+ + true + + + Anonymous + false + + + 1 + 1 + + false + 80 + true + false + + + Leaflet + 51.47 + -0.6 + ROADMAP + 11 + 1 + 1 + 30 + NauticalMiles + Feet + Knots + true + true + true + true + 3 + 3 + 3 + Unknown + false + false + OpenStreetMap + + + true + 1 + + + false + false + false + false + 20 + false + false + false + + + true + 0 + + + 0 + 650 + false + true + false + 10 + 25 + 50 + 15 + 5 + 3 + false + 1 + 1 + 0 + 5 + true + false + true + false + + + true + + + + true + 1 + dump1090 + Beast + TCP + true + false + false + + Unrestricted + + +
DUMP1090_SERVER
+ DUMP1090_PORT + true + 60000 + 115200 + 8 + One + None + None + #43-02\r + #43-00\r + 1 + Normal +
+ + true + 2 + adsbexchange-mlat + Beast + TCP + true + false + false + + Unrestricted + + +
ADSBEXCHANGE_MLAT_SERVER
+ ADSBEXCHANGE_MLAT_PORT + true + 60000 + 115200 + 8 + One + None + None + #43-02\r + #43-00\r + 1 + Normal +
+
+ + + true + 3 + Merged Feed + + 1 + 2 + + + + 2 + true + + + 3000 + false + Normal + + + + + 1 + Receiver Location + VIRTUALRADAR_LATITUDE + VIRTUALRADAR_LONGITUDE + false + + + +
diff --git a/virtualradar/Dockerfile-virtualradar b/virtualradar/Dockerfile-virtualradar index 0b7c011..9e03cd9 100644 --- a/virtualradar/Dockerfile-virtualradar +++ b/virtualradar/Dockerfile-virtualradar @@ -65,6 +65,7 @@ FROM base COPY --from=builder /vrs /opt/vrs COPY InstallerConfiguration.xml /root/.local/share/VirtualRadar/InstallerConfiguration.xml +COPY Configuration.xml /root/.local/share/VirtualRadar/Configuration.xml COPY vrs-runner.sh /usr/local/bin/vrs-runner EXPOSE 30053 diff --git a/virtualradar/vrs-runner.sh b/virtualradar/vrs-runner.sh index e75e09c..27cdbc3 100755 --- a/virtualradar/vrs-runner.sh +++ b/virtualradar/vrs-runner.sh @@ -1,27 +1,68 @@ -#!/bin/sh +#!/bin/bash set -o errexit # Exit on most errors (see the manual) -#set -o errtrace # Make sure any error trap is inherited +set -o errtrace # Make sure any error trap is inherited set -o nounset # Disallow expansion of unset variables -#set -o pipefail # Use last non-zero exit code in a pipeline -set -o xtrace # Trace the execution of the script (debug) +set -o pipefail # Use last non-zero exit code in a pipeline +#set -o xtrace # Trace the execution of the script (debug) + +function start_secion_spacer { + echo '==============================' + echo "======== ${1}" + echo '==============================' +} + +function end_secion_spacer { + echo '==============================' + echo +} DUMP1090_SERVER='dump1090' DUMP1090_PORT='30005' +ADSBEXCHANGE_MLAT_SERVER='adsbexchange-mlat' +ADSBEXCHANGE_MLAT_PORT='30104' +start_secion_spacer "Running with" +echo " - DUMP1090_SERVER=${DUMP1090_SERVER}" +echo " - DUMP1090_PORT=${DUMP1090_PORT}" +echo " - ADSBEXCHANGE_MLAT_SERVER=${ADSBEXCHANGE_MLAT_SERVER}" +echo " - ADSBEXCHANGE_MLAT_PORT=${ADSBEXCHANGE_MLAT_PORT}" +echo " - VIRTUALRADAR_LATITUDE =${VIRTUALRADAR_LATITUDE}" +echo " - VIRTUALRADAR_LONGITUDE=${VIRTUALRADAR_LONGITUDE}" +end_secion_spacer -echo "Waiting for dump1090 to start up" + +start_secion_spacer "Waiting for ${DUMP1090_SERVER} to start up" sleep 5s +end_secion_spacer -echo "Ping test to dump1090" +start_secion_spacer "Ping test to ${DUMP1090_SERVER}" ping -c 3 "${DUMP1090_SERVER}" +end_secion_spacer + +start_secion_spacer "Downloading route DB" +curl --output '/tmp/StandingData.sqb.gz' 'http://www.virtualradarserver.co.uk/Files/StandingData.sqb.gz' +zcat '/tmp/StandingData.sqb.gz' > '/tmp/StandingData.sqb' +rm '/tmp/StandingData.sqb.gz' +end_secion_spacer + +start_secion_spacer 'customising config' +sed -i "s/DUMP1090_SERVER/${DUMP1090_SERVER}/" /root/.local/share/VirtualRadar/Configuration.xml +sed -i "s/DUMP1090_PORT/${DUMP1090_PORT}/" /root/.local/share/VirtualRadar/Configuration.xml +sed -i "s/ADSBEXCHANGE_MLAT_SERVER/${ADSBEXCHANGE_MLAT_SERVER}/" /root/.local/share/VirtualRadar/Configuration.xml +sed -i "s/ADSBEXCHANGE_MLAT_PORT/${ADSBEXCHANGE_MLAT_PORT}/" /root/.local/share/VirtualRadar/Configuration.xml +sed -i "s/VIRTUALRADAR_LATITUDE/${VIRTUALRADAR_LATITUDE}/" /root/.local/share/VirtualRadar/Configuration.xml +sed -i "s/VIRTUALRADAR_LONGITUDE/${VIRTUALRADAR_LONGITUDE}/" /root/.local/share/VirtualRadar/Configuration.xml +end_secion_spacer + export MONO_PATH="/opt/vrs:${MONO_PATH:=}" # https://www.mono-project.com/docs/advanced/runtime/logging-runtime-events/ -export MONO_LOG_LEVEL='info' -export MONO_LOG_MASK='dll,cfg' +#export MONO_LOG_LEVEL='info' +#export MONO_LOG_MASK='dll,cfg' -mono /opt/vrs/VirtualRadar.exe -nogui -"createAdmin:${VIRTUALRADAR_DEFAULT_ADMIN_USER}" -"password:${VIRTUALRADAR_DEFAULT_ADMIN_PASSWORD}" +start_secion_spacer 'Starting VirtualRadar' +mono /opt/vrs/VirtualRadar.exe -nogui -"createAdmin:${VIRTUALRADAR_DEFAULT_ADMIN_USER}" -"password:${VIRTUALRADAR_DEFAULT_ADMIN_PASSWORD}" || true mono /opt/vrs/VirtualRadar.exe -nogui - +end_secion_spacer