├── .dictionary.txt ├── .dockerignore ├── .github ├── dependabot.yaml └── workflows │ ├── cancel_dupes.yml │ ├── check_versions.yml │ ├── deploy.yml │ ├── hadolint.yml │ ├── markdownlint.yml │ ├── on_pr.yml │ ├── pre-commit-updates.yaml │ ├── shellcheck.yml │ └── yamllint.yml ├── .gitignore ├── .hadolint.yaml ├── .markdownlint.json ├── .pre-commit-config.yaml ├── Dockerfile ├── README.md ├── buildnow.sh └── rootfs ├── etc ├── nginx.tar1090 │ ├── nginx.conf │ └── sites-enabled │ │ └── tar1090 ├── s6-overlay │ ├── s6-rc.d │ │ ├── 09-rtlsdr-biastee │ │ │ ├── down │ │ │ ├── type │ │ │ └── up │ │ ├── autogain │ │ │ ├── dependencies.d │ │ │ │ ├── readsb │ │ │ │ └── startup │ │ │ ├── run │ │ │ └── type │ │ ├── cleanup_globe_history │ │ │ ├── dependencies.d │ │ │ │ └── startup │ │ │ ├── run │ │ │ └── type │ │ ├── collectd │ │ │ ├── dependencies.d │ │ │ │ └── startup │ │ │ ├── finish │ │ │ ├── run │ │ │ └── type │ │ ├── graphs1090-writeback │ │ │ ├── dependencies.d │ │ │ │ └── startup │ │ │ ├── run │ │ │ └── type │ │ ├── graphs1090 │ │ │ ├── dependencies.d │ │ │ │ ├── collectd │ │ │ │ └── startup │ │ │ ├── finish │ │ │ ├── run │ │ │ └── type │ │ ├── nginx │ │ │ ├── dependencies.d │ │ │ │ └── startup │ │ │ ├── run │ │ │ └── type │ │ ├── readsb │ │ │ ├── dependencies.d │ │ │ │ ├── 09-rtlsdr-biastee │ │ │ │ └── startup │ │ │ ├── finish │ │ │ ├── run │ │ │ └── type │ │ ├── startup │ │ │ ├── dependencies.d │ │ │ │ └── base │ │ │ ├── down │ │ │ ├── type │ │ │ └── up │ │ ├── tar1090-update │ │ │ ├── dependencies.d │ │ │ │ └── startup │ │ │ ├── run │ │ │ └── type │ │ ├── tar1090 │ │ │ ├── dependencies.d │ │ │ │ ├── readsb │ │ │ │ └── startup │ │ │ ├── finish │ │ │ ├── run │ │ │ └── type │ │ ├── telegraf │ │ │ ├── dependencies.d │ │ │ │ └── startup │ │ │ ├── run │ │ │ └── type │ │ ├── timelapse1090 │ │ │ ├── dependencies.d │ │ │ │ └── startup │ │ │ ├── run │ │ │ └── type │ │ └── user │ │ │ └── contents.d │ │ │ ├── autogain │ │ │ ├── cleanup_globe_history │ │ │ ├── collectd │ │ │ ├── graphs1090 │ │ │ ├── graphs1090-writeback │ │ │ ├── nginx │ │ │ ├── readsb │ │ │ ├── startup │ │ │ ├── tar1090 │ │ │ ├── tar1090-update │ │ │ ├── telegraf │ │ │ └── timelapse1090 │ ├── scripts │ │ ├── autogain │ │ ├── cleanup_globe_history │ │ ├── collectd │ │ ├── graphs1090 │ │ ├── graphs1090-writeback │ │ ├── nginx │ │ ├── readsb │ │ ├── startup │ │ ├── startup-finish │ │ ├── tar1090 │ │ ├── tar1090-update │ │ ├── telegraf │ │ └── timelapse1090 │ └── startup.d │ │ ├── 01-sanity-check │ │ ├── 04-tar1090-configure │ │ ├── 06-range-outline │ │ ├── 07-nginx-configure │ │ ├── 08-graphs1090-init │ │ ├── 10-telegraf-conf │ │ ├── 11-timelapse1090 │ │ └── 99-prometheus-conf └── telegraf │ └── telegraf.d │ ├── readsb_aircraft_json.conf │ ├── readsb_receiver_json.conf │ └── readsb_stats_json.conf ├── healthcheck.sh ├── tar1090-install.sh └── usr └── local └── bin └── autogain1090 /.dictionary.txt: -------------------------------------------------------------------------------- 1 | crate 2 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .gitignore 3 | .github 4 | .gitattributes 5 | READMETEMPLATE.md 6 | README.md 7 | buildx.sh 8 | -------------------------------------------------------------------------------- /.github/dependabot.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 2 3 | 4 | updates: 5 | # Maintain dependencies for Docker 6 | - package-ecosystem: "docker" 7 | directory: "/" 8 | schedule: 9 | interval: "weekly" 10 | day: "saturday" 11 | time: "00:00" 12 | timezone: "Etc/UTC" 13 | assignees: 14 | - "mikenye" 15 | - "fredclausen" 16 | 17 | # Maintain dependencies for GitHub Actions 18 | - package-ecosystem: "github-actions" 19 | directory: "/" 20 | schedule: 21 | interval: "weekly" 22 | day: "saturday" 23 | time: "00:00" 24 | timezone: "Etc/UTC" 25 | assignees: 26 | - "mikenye" 27 | - "fredclausen" 28 | -------------------------------------------------------------------------------- /.github/workflows/cancel_dupes.yml: -------------------------------------------------------------------------------- 1 | name: Cancelling Duplicates 2 | on: 3 | workflow_run: 4 | workflows: 5 | - "Deploy" 6 | - "Check Linting" 7 | - "Tests" 8 | types: ["requested"] 9 | 10 | jobs: 11 | cancel-duplicate-workflow-runs: 12 | name: "Cancel duplicate workflow runs" 13 | runs-on: ubuntu-22.04 14 | steps: 15 | - uses: potiuk/cancel-workflow-runs@master 16 | name: "Cancel duplicate workflow runs" 17 | with: 18 | cancelMode: allDuplicates 19 | token: ${{ secrets.GITHUB_TOKEN }} 20 | sourceRunId: ${{ github.event.workflow_run.id }} 21 | -------------------------------------------------------------------------------- /.github/workflows/check_versions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Check container software versions 3 | 4 | on: 5 | workflow_dispatch: 6 | # Check for new versions in adsbx repos 7 | schedule: 8 | - cron: "0 12 * * *" 9 | 10 | env: 11 | GHCR_IMAGE: ${{ github.repository }}:latest 12 | GHCR_REGISTRY: ghcr.io 13 | WORKFLOW_FILE_TO_TRIGGER: deploy.yml 14 | WORKFLOW_AUTH_TOKEN: ${{ secrets.GH_PAT_KX1T }} 15 | 16 | jobs: 17 | version_in_container: 18 | name: Check versions in 'latest' image 19 | runs-on: ubuntu-22.04 20 | outputs: 21 | currverhash: ${{ steps.current-version.outputs.currverhash }} 22 | steps: 23 | - name: Get versions from ${{ env.GHCR_IMAGE }} 24 | id: current-version 25 | run: | 26 | set -x 27 | docker run --rm --entrypoint cat ${{ env.GHCR_REGISTRY }}/${{ env.GHCR_IMAGE }} /VERSIONS 28 | echo "currverhash=$(docker run --rm --entrypoint md5sum ${{ env.GHCR_REGISTRY }}/${{ env.GHCR_IMAGE }} /VERSIONS)" >> $GITHUB_OUTPUT 29 | 30 | latest_version: 31 | name: Check latest versions 32 | runs-on: ubuntu-22.04 33 | outputs: 34 | latestverhash: ${{ steps.latest-version.outputs.latestverhash }} 35 | steps: 36 | - name: Build image 37 | uses: docker/build-push-action@v6.17.0 38 | with: 39 | push: false 40 | load: true 41 | tags: local_image_for_versions:latest 42 | - name: Get versions from newly built image 43 | id: latest-version 44 | run: | 45 | set -x 46 | docker run --rm --entrypoint cat local_image_for_versions /VERSIONS 47 | echo "latestverhash=$(docker run --rm --entrypoint md5sum local_image_for_versions /VERSIONS)" >> $GITHUB_OUTPUT 48 | 49 | display_versions: 50 | name: Display versions 51 | needs: [version_in_container, latest_version] 52 | runs-on: ubuntu-22.04 53 | steps: 54 | - name: Display versions 55 | run: | 56 | echo "version hash in current latest image = ${{ needs.version_in_container.outputs.currverhash }}" 57 | echo "version hash in image just built = ${{ needs.latest_version.outputs.latestverhash }}" 58 | echo "will a deployment be triggered = ${{ needs.version_in_container.outputs.currverhash != needs.latest_version.outputs.latestverhash }}" 59 | 60 | trigger_deploy: 61 | name: Trigger deployment of image 62 | needs: [version_in_container, latest_version] 63 | if: ${{ needs.version_in_container.outputs.currverhash != needs.latest_version.outputs.latestverhash }} 64 | runs-on: ubuntu-22.04 65 | env: 66 | WORKFLOW_AUTH_TOKEN: ${{ secrets.GH_PAT_KX1T }} 67 | WORKFLOW_REPO: sdr-enthusiasts/docker-tar1090 68 | WORKFLOW_FILE: deploy.yml 69 | WORKFLOW_REASON: "triggered via check_versions.yaml. New tar1090 found" 70 | steps: 71 | - name: Trigger ${{ env.WORKFLOW_FILE }} in ${{ env.WORKFLOW_REPO }} 72 | run: | 73 | echo "$WORKFLOW_AUTH_TOKEN" | gh auth login --with-token 74 | gh workflow run --ref main --repo "$WORKFLOW_REPO" "$WORKFLOW_FILE" -f reason="$WORKFLOW_REASON" 75 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | reason: 7 | required: false 8 | description: "Reason for running this workflow" 9 | use_test_image: 10 | required: false 11 | type: boolean 12 | description: "Use base image testpr" 13 | default: false 14 | 15 | push: 16 | branches: 17 | - main 18 | # Trigger only on specific files being updated. 19 | 20 | paths: 21 | - Dockerfile 22 | - rootfs/** 23 | 24 | env: 25 | GHCR_IMAGE: sdr-enthusiasts/docker-tar1090 26 | GHCR_REGISTRY: ghcr.io 27 | GH_LABEL: main 28 | GHCR_TAG: telegraf 29 | 30 | jobs: 31 | workflow-dispatch: 32 | name: Triggered via Workflow Dispatch? 33 | # only run this step if workflow dispatch triggered 34 | # log the reason the workflow dispatch was triggered 35 | if: | 36 | github.event_name == 'workflow_dispatch' && 37 | github.event.inputs.reason != '' 38 | runs-on: ubuntu-22.04 39 | steps: 40 | - name: Log dispatch reason 41 | env: 42 | INPUTS_REASON: ${{ github.event.inputs.reason }} 43 | INPUTS_USE_TEST_IMAGE: ${{ github.event.inputs.use_test_image }} 44 | run: | 45 | echo "Workflow dispatch reason: $INPUTS_REASON" 46 | echo "Use test image: $INPUTS_USE_TEST_IMAGE" 47 | 48 | deploy: 49 | name: Deploy without telegraf 50 | uses: sdr-enthusiasts/common-github-workflows/.github/workflows/build_and_push_image.yml@main 51 | with: 52 | push_enabled: true 53 | push_destinations: ghcr.io 54 | ghcr_repo_owner: ${{ github.repository_owner }} 55 | ghcr_repo: ${{ github.repository }} 56 | get_version_method: git_commit_hash_short 57 | # set build_latest to true if github.event.inputs.use_test_image is false 58 | build_latest: ${{ github.event.inputs.use_test_image == 'false' || github.event.inputs.use_test_image == '' }} 59 | build_baseimage_test: ${{ github.event.inputs.use_test_image == 'true' }} 60 | # only build the entire stack if we are not using the test image 61 | build_version_specific: false 62 | build_platform_specific: false 63 | build_nohealthcheck: false 64 | build_baseimage_url: wreadsb/wreadsb-test-pr 65 | secrets: 66 | ghcr_token: ${{ secrets.GITHUB_TOKEN }} 67 | 68 | # unfortunately we can't use build_and_push_image.yml to build the telegraf label because 69 | # that GH Action doesn't have the capability to build specific custom-named labels 70 | 71 | deploy_with_telegraf: 72 | name: Deploy with telegraf and healthcheck 73 | uses: sdr-enthusiasts/common-github-workflows/.github/workflows/build_and_push_image.yml@main 74 | with: 75 | push_enabled: true 76 | push_destinations: ghcr.io 77 | ghcr_repo_owner: ${{ github.repository_owner }} 78 | ghcr_repo: ${{ github.repository }} 79 | get_version_method: git_commit_hash_short 80 | # set build_latest to true if github.event.inputs.use_test_image is false 81 | build_latest: ${{ github.event.inputs.use_test_image == 'false' || github.event.inputs.use_test_image == '' }} 82 | build_baseimage_test: ${{ github.event.inputs.use_test_image == 'true' }} 83 | build_baseimage_url: wreadsb/wreadsb-test-pr 84 | # only build the entire stack if we are not using the test image 85 | build_version_specific: false 86 | build_platform_specific: false 87 | build_nohealthcheck: false 88 | docker_latest_tag: telegraf 89 | dockerfile_changes: | 90 | ##telegraf##/ 91 | secrets: 92 | ghcr_token: ${{ secrets.GITHUB_TOKEN }} 93 | 94 | trigger_build_sdr-enthusiasts_ultrafeeder: 95 | name: Trigger deploy of sdr-enthusiasts/docker-adsb-ultrafeeder 96 | needs: ["deploy", "deploy_with_telegraf"] 97 | runs-on: ubuntu-22.04 98 | env: 99 | WORKFLOW_AUTH_TOKEN: ${{ secrets.GH_PAT_KX1T }} 100 | WORKFLOW_REPO: sdr-enthusiasts/docker-adsb-ultrafeeder 101 | WORKFLOW_FILE: deploy.yml 102 | WORKFLOW_REASON: "triggered via deploy.yml in sdr-enthusiasts/docker-tar1090" 103 | WORKFLOW_TEST_IMAGE: ${{ github.event.inputs.use_test_image }} 104 | steps: 105 | - name: Trigger ${{ env.WORKFLOW_FILE }} in ${{ env.WORKFLOW_REPO }} 106 | run: | 107 | echo "$WORKFLOW_AUTH_TOKEN" | gh auth login --with-token 108 | gh workflow run --ref main --repo "$WORKFLOW_REPO" "$WORKFLOW_FILE" -f reason="$WORKFLOW_REASON" -f use_test_image="$WORKFLOW_TEST_IMAGE" 109 | -------------------------------------------------------------------------------- /.github/workflows/hadolint.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Linting (Hadolint) 3 | 4 | on: 5 | workflow_dispatch: 6 | pull_request: 7 | branches: 8 | - main 9 | paths: 10 | - "Dockerfile" 11 | 12 | jobs: 13 | hadolint: 14 | name: Run hadolint against docker files 15 | runs-on: ubuntu-22.04 16 | steps: 17 | - uses: actions/checkout@v4.2.2 18 | - name: Pull hadolint/hadolint:latest Image 19 | run: docker pull hadolint/hadolint:latest 20 | - name: Run hadolint against Dockerfiles 21 | run: docker run --rm -i -v "$PWD":/workdir --workdir /workdir --entrypoint hadolint hadolint/hadolint --ignore SC2086 --ignore DL3003 --ignore DL3006 --ignore DL3010 --ignore DL4001 --ignore DL3007 --ignore DL3008 --ignore SC2068 --ignore DL3007 --ignore SC1091 --ignore DL3013 --ignore DL3010 $(find . -type f -iname "Dockerfile*") 22 | -------------------------------------------------------------------------------- /.github/workflows/markdownlint.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Linting (Markdown) 3 | 4 | on: 5 | workflow_dispatch: 6 | pull_request: 7 | branches: 8 | - main 9 | # only run these if markdown files are updated 10 | paths: 11 | - "**.md" 12 | - "**.MD" 13 | 14 | jobs: 15 | markdownlint: 16 | name: Run markdownlint against markdown files 17 | runs-on: ubuntu-22.04 18 | 19 | steps: 20 | - uses: actions/checkout@v4.2.2 21 | - name: Pull markdownlint/markdownlint:latest Image 22 | run: docker pull markdownlint/markdownlint:latest 23 | - name: Run markdownlint against *.md files 24 | run: docker run --rm -i -v "$(pwd)":/workdir --workdir /workdir markdownlint/markdownlint:latest --rules ~MD007,~MD013,~MD033,~MD026,~MD002,~MD022,~MD029 $(find . -type f -iname '*.md' | grep -v '/.git/') 25 | -------------------------------------------------------------------------------- /.github/workflows/on_pr.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Pull Request 3 | 4 | on: 5 | # Enable manual running of action if necessary 6 | workflow_dispatch: 7 | # Test build/deploy on PRs to main/master 8 | pull_request: 9 | # Only publish on push to main branch 10 | branches: 11 | - main 12 | # Don't trigger if it's just a documentation update 13 | paths-ignore: 14 | - "**.md" 15 | - "**.MD" 16 | - "**.yml" 17 | - "LICENSE" 18 | - ".gitattributes" 19 | - ".gitignore" 20 | - ".dockerignore" 21 | 22 | jobs: 23 | test-build: 24 | name: Test 25 | uses: sdr-enthusiasts/common-github-workflows/.github/workflows/build_and_push_image.yml@main 26 | with: 27 | push_enabled: false 28 | get_version_method: git_commit_hash_short 29 | -------------------------------------------------------------------------------- /.github/workflows/pre-commit-updates.yaml: -------------------------------------------------------------------------------- 1 | name: Update pre-commit hooks 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: 0 0 * * 0 7 | 8 | jobs: 9 | pre-commit-update: 10 | runs-on: ubuntu-22.04 11 | name: Updates 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v4.2.2 15 | - name: Update pre-commit hooks 16 | uses: brokenpip3/action-pre-commit-update@0.0.2 17 | with: 18 | github-token: ${{ secrets.GITHUB_TOKEN }} 19 | -------------------------------------------------------------------------------- /.github/workflows/shellcheck.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Linting (Shellcheck) 3 | 4 | on: 5 | workflow_dispatch: 6 | pull_request: 7 | branches: 8 | - main 9 | # only run these if markdown files are updated 10 | 11 | jobs: 12 | shellcheck: 13 | name: Run shellcheck against shell scripts 14 | runs-on: ubuntu-22.04 15 | steps: 16 | - uses: actions/checkout@v4.2.2 17 | - name: Pull koalaman/shellcheck:stable Image 18 | run: docker pull koalaman/shellcheck:stable 19 | - name: Run Shellcheck against shell scripts 20 | run: docker run --rm -i -v "$PWD:/mnt" koalaman/shellcheck:stable $(find . -type f -exec grep -m1 -l -E '^#!.*sh.*' {} \; | grep -v '/.git/') 21 | -------------------------------------------------------------------------------- /.github/workflows/yamllint.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Linting (YAML) 3 | 4 | on: 5 | workflow_dispatch: 6 | pull_request: 7 | branches: 8 | - main 9 | # only run when yaml files are updated 10 | paths: 11 | - "**.yml" 12 | 13 | jobs: 14 | yamllint: 15 | name: Run yamllint against YAML files 16 | runs-on: ubuntu-22.04 17 | steps: 18 | - uses: actions/checkout@v4.2.2 19 | - name: yaml-lint 20 | uses: ibiqlik/action-yamllint@v3.1.1 21 | with: 22 | config_data: | 23 | extends: default 24 | rules: 25 | line-length: 26 | max: 120 27 | level: warning 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig 2 | 3 | # Created by https://www.gitignore.io/api/visualstudiocode,python,macos,virtualenv 4 | # Edit at https://www.gitignore.io/?templates=visualstudiocode,python,macos,virtualenv 5 | 6 | ### macOS ### 7 | # General 8 | .DS_Store 9 | .AppleDouble 10 | .LSOverride 11 | 12 | # Icon must end with two \r 13 | Icon 14 | 15 | # Thumbnails 16 | ._* 17 | 18 | # Files that might appear in the root of a volume 19 | .DocumentRevisions-V100 20 | .fseventsd 21 | .Spotlight-V100 22 | .TemporaryItems 23 | .Trashes 24 | .VolumeIcon.icns 25 | .com.apple.timemachine.donotpresent 26 | 27 | # Directories potentially created on remote AFP share 28 | .AppleDB 29 | .AppleDesktop 30 | Network Trash Folder 31 | Temporary Items 32 | .apdisk 33 | 34 | ### Python ### 35 | # Byte-compiled / optimized / DLL files 36 | __pycache__/ 37 | *.py[cod] 38 | *$py.class 39 | 40 | # C extensions 41 | *.so 42 | 43 | # Distribution / packaging 44 | .Python 45 | build/ 46 | develop-eggs/ 47 | dist/ 48 | downloads/ 49 | eggs/ 50 | .eggs/ 51 | lib/ 52 | lib64/ 53 | parts/ 54 | sdist/ 55 | var/ 56 | wheels/ 57 | pip-wheel-metadata/ 58 | share/python-wheels/ 59 | *.egg-info/ 60 | .installed.cfg 61 | *.egg 62 | MANIFEST 63 | 64 | # PyInstaller 65 | # Usually these files are written by a python script from a template 66 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 67 | *.manifest 68 | *.spec 69 | 70 | # Installer logs 71 | pip-log.txt 72 | pip-delete-this-directory.txt 73 | 74 | # Unit test / coverage reports 75 | htmlcov/ 76 | .tox/ 77 | .nox/ 78 | .coverage 79 | .coverage.* 80 | .cache 81 | nosetests.xml 82 | coverage.xml 83 | *.cover 84 | .hypothesis/ 85 | .pytest_cache/ 86 | 87 | # Translations 88 | *.mo 89 | *.pot 90 | 91 | # Scrapy stuff: 92 | .scrapy 93 | 94 | # Sphinx documentation 95 | docs/_build/ 96 | 97 | # PyBuilder 98 | target/ 99 | 100 | # pyenv 101 | .python-version 102 | 103 | # pipenv 104 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 105 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 106 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 107 | # install all needed dependencies. 108 | #Pipfile.lock 109 | 110 | # celery beat schedule file 111 | celerybeat-schedule 112 | 113 | # SageMath parsed files 114 | *.sage.py 115 | 116 | # Spyder project settings 117 | .spyderproject 118 | .spyproject 119 | 120 | # Rope project settings 121 | .ropeproject 122 | 123 | # Mr Developer 124 | .mr.developer.cfg 125 | .project 126 | .pydevproject 127 | 128 | # mkdocs documentation 129 | /site 130 | 131 | # mypy 132 | .mypy_cache/ 133 | .dmypy.json 134 | dmypy.json 135 | 136 | # Pyre type checker 137 | .pyre/ 138 | 139 | ### VirtualEnv ### 140 | # Virtualenv 141 | # http://iamzed.com/2009/05/07/a-primer-on-virtualenv/ 142 | pyvenv.cfg 143 | .env 144 | .venv 145 | env/ 146 | venv/ 147 | ENV/ 148 | env.bak/ 149 | venv.bak/ 150 | pip-selfcheck.json 151 | 152 | ### VisualStudioCode ### 153 | .vscode/* 154 | !.vscode/settings.json 155 | !.vscode/tasks.json 156 | !.vscode/launch.json 157 | !.vscode/extensions.json 158 | 159 | ### VisualStudioCode Patch ### 160 | # Ignore all local history of files 161 | .history 162 | 163 | # End of https://www.gitignore.io/api/visualstudiocode,python,macos,virtualenv 164 | 165 | # Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option) 166 | 167 | .vscode/* 168 | -------------------------------------------------------------------------------- /.hadolint.yaml: -------------------------------------------------------------------------------- 1 | ignored: 2 | - DL3008 3 | - SC2086 4 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "MD029": false, 3 | "MD013": false, 4 | "MD009": false 5 | } 6 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | # lint yaml, line and whitespace 3 | - repo: https://github.com/pre-commit/pre-commit-hooks 4 | rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0 5 | hooks: 6 | - id: check-yaml 7 | - id: end-of-file-fixer 8 | - id: trailing-whitespace 9 | - id: requirements-txt-fixer 10 | - id: mixed-line-ending 11 | - id: check-executables-have-shebangs 12 | - id: check-shebang-scripts-are-executable 13 | 14 | # lint the dockerfiles 15 | - repo: https://github.com/hadolint/hadolint 16 | rev: c3dc18df7a501f02a560a2cc7ba3c69a85ca01d3 # frozen: v2.13.1-beta 17 | hooks: 18 | - id: hadolint 19 | 20 | # prettier 21 | - repo: https://github.com/pre-commit/mirrors-prettier 22 | rev: "f12edd9c7be1c20cfa42420fd0e6df71e42b51ea" # frozen: v4.0.0-alpha.8 23 | hooks: 24 | - id: prettier 25 | types_or: [file, bash, sh, javascript, jsx, ts, tsx] 26 | additional_dependencies: 27 | - prettier@2.5.1 28 | exclude: ^(Dockerfile*) 29 | 30 | - repo: https://github.com/codespell-project/codespell.git 31 | rev: "63c8f8312b7559622c0d82815639671ae42132ac" # frozen: v2.4.1 32 | hooks: 33 | - id: codespell 34 | types: [text] 35 | args: [--ignore-words=.dictionary.txt] 36 | exclude: ^(Dockerfile*) 37 | 38 | - repo: https://github.com/shellcheck-py/shellcheck-py 39 | rev: a23f6b85d0fdd5bb9d564e2579e678033debbdff # frozen: v0.10.0.1 40 | hooks: 41 | - id: shellcheck 42 | 43 | - repo: https://github.com/sirosen/check-jsonschema 44 | rev: 06e4cc849d03f3a59ca223a4046f4bb5bb2aba6d # frozen: 0.33.0 45 | hooks: 46 | - id: check-github-actions 47 | - id: check-github-workflows 48 | 49 | - repo: https://github.com/doublify/pre-commit-rust 50 | rev: eeee35a89e69d5772bdee97db1a6a898467b686e # frozen: v1.0 51 | hooks: 52 | - id: fmt 53 | - id: cargo-check 54 | 55 | # lint python formatting 56 | - repo: https://github.com/psf/black 57 | rev: 8a737e727ac5ab2f1d4cf5876720ed276dc8dc4b # frozen: 25.1.0 58 | hooks: 59 | - id: black 60 | 61 | - repo: https://github.com/pycqa/flake8 62 | rev: "4b5e89b4b108a6c1a000c591d334a99a80d34c7b" # frozen: 7.2.0 63 | hooks: 64 | - id: flake8 65 | args: ["--extend-ignore=W503,W504,E501"] 66 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Note - do not remove the ##telegraf## tags from this file - they are used to build a tag that includes the telegraf binary 2 | ##telegraf##FROM telegraf:1.26 AS telegraf 3 | 4 | ##telegraf##RUN touch /tmp/emptyfile 5 | 6 | FROM ghcr.io/sdr-enthusiasts/docker-baseimage:wreadsb 7 | 8 | ENV BEASTPORT=30005 \ 9 | GITPATH_TIMELAPSE1090=/opt/timelapse1090 \ 10 | HTTP_ACCESS_LOG="false" \ 11 | HTTP_ERROR_LOG="true" \ 12 | TAR1090_INSTALL_DIR=/usr/local/share/tar1090 \ 13 | TAR1090_UPDATE_DIR=/var/globe_history/tar1090-update \ 14 | MLATPORT=30105 \ 15 | INTERVAL=8 \ 16 | HISTORY_SIZE=450 \ 17 | ENABLE_978=no \ 18 | GZIP_LVL=3 \ 19 | CHUNK_SIZE=60 \ 20 | INT_978=1 \ 21 | COMPRESS_978="" \ 22 | TIMELAPSE1090_SOURCE=/run/readsb \ 23 | TIMELAPSE1090_INTERVAL=10 \ 24 | TIMELAPSE1090_HISTORY=24 \ 25 | TIMELAPSE1090_CHUNK_SIZE=240 \ 26 | GRAPHS1090_REDUCE_IO="false" \ 27 | UPDATE_TAR1090="true" \ 28 | PTRACKS=8 29 | 30 | SHELL ["/bin/bash", "-o", "pipefail", "-c"] 31 | 32 | # add telegraf binary 33 | ##telegraf##COPY --from=telegraf /usr/bin/telegraf /usr/bin/telegraf 34 | 35 | RUN \ 36 | --mount=type=bind,source=./,target=/app/ \ 37 | set -x && \ 38 | TEMP_PACKAGES=() && \ 39 | KEPT_PACKAGES=() && \ 40 | TEMP_PACKAGES+=(git) && \ 41 | # tar1090 42 | KEPT_PACKAGES+=(nginx-light) && \ 43 | # graphs1090 44 | KEPT_PACKAGES+=(collectd-core) && \ 45 | KEPT_PACKAGES+=(rrdtool) && \ 46 | KEPT_PACKAGES+=(bash-builtins) && \ 47 | KEPT_PACKAGES+=(libpython3.11) && \ 48 | KEPT_PACKAGES+=(libncurses6) && \ 49 | # healthchecks 50 | KEPT_PACKAGES+=(jq) && \ 51 | # install packages 52 | apt-get update && \ 53 | apt-get install -y --no-install-suggests --no-install-recommends \ 54 | ${KEPT_PACKAGES[@]} \ 55 | ${TEMP_PACKAGES[@]} \ 56 | && \ 57 | # grab the bias t scripts 58 | curl -o /etc/s6-overlay/scripts/09-rtlsdr-biastee-init https://raw.githubusercontent.com/sdr-enthusiasts/sdre-bias-t-common/main/09-rtlsdr-biastee-init && \ 59 | curl -o /etc/s6-overlay/scripts/09-rtlsdr-biastee-down https://raw.githubusercontent.com/sdr-enthusiasts/sdre-bias-t-common/main/09-rtlsdr-biastee-down && \ 60 | chmod +x /etc/s6-overlay/scripts/09-rtlsdr-biastee-init && \ 61 | chmod +x /etc/s6-overlay/scripts/09-rtlsdr-biastee-down && \ 62 | # nginx: remove default config 63 | rm /etc/nginx/sites-enabled/default && \ 64 | # tar1090: install using project copy of original script 65 | bash /app/rootfs/tar1090-install.sh /run/readsb webroot "${TAR1090_INSTALL_DIR}" && \ 66 | # tar1090-db: document version 67 | echo "tar1090-db $(cat ${TAR1090_UPDATE_DIR}/git-db/version)" >> VERSIONS && \ 68 | # tar1090: document version 69 | echo "tar1090 $(cat ${TAR1090_UPDATE_DIR}/git/version)" >> VERSIONS && \ 70 | # tar1090: remove tar1090-update files as they're not needed unless tar1090-update is active 71 | rm -rf "${TAR1090_UPDATE_DIR}" && \ 72 | # tar1090: add nginx config 73 | cp -Rv /app/rootfs/etc/nginx.tar1090/* /etc/nginx/ && \ 74 | # copy nginx config out of tar1090 install directory which might be updated while the container is running 75 | cp -v "${TAR1090_INSTALL_DIR}/nginx-tar1090-webroot.conf" /etc/nginx/ && \ 76 | # aircraft-db, file in TAR1090_UPDATE_DIR will be preferred when starting readsb if tar1090-update enabled 77 | curl -o "${TAR1090_INSTALL_DIR}/aircraft.csv.gz" "https://raw.githubusercontent.com/wiedehopf/tar1090-db/csv/aircraft.csv.gz" && \ 78 | # clone graphs1090 repo 79 | git clone \ 80 | -b master \ 81 | --depth 1 \ 82 | https://github.com/wiedehopf/graphs1090.git \ 83 | /usr/share/graphs1090/git \ 84 | && \ 85 | # ref: https://github.com/wiedehopf/graphs1090/blob/151e63a810d6b087518992d4f366d9776c5c826b/install.sh#L145 86 | cp -v \ 87 | /usr/share/graphs1090/git/dump1090.db \ 88 | /usr/share/graphs1090/git/dump1090.py \ 89 | /usr/share/graphs1090/git/system_stats.py \ 90 | /usr/share/graphs1090/git/LICENSE \ 91 | /usr/share/graphs1090/ \ 92 | && \ 93 | # ref: https://github.com/wiedehopf/graphs1090/blob/151e63a810d6b087518992d4f366d9776c5c826b/install.sh#L146 94 | cp -v \ 95 | /usr/share/graphs1090/git/*.sh \ 96 | /usr/share/graphs1090/ \ 97 | && \ 98 | # adjust scripts using systemctl for container (only affects speciality scripts) 99 | bash /usr/share/graphs1090/git/adjust-scripts-s6-sh && \ 100 | # ref: https://github.com/wiedehopf/graphs1090/blob/151e63a810d6b087518992d4f366d9776c5c826b/install.sh#L147 101 | cp -v \ 102 | /usr/share/graphs1090/git/malarky.conf \ 103 | /usr/share/graphs1090/ \ 104 | && \ 105 | # ref: https://github.com/wiedehopf/graphs1090/blob/151e63a810d6b087518992d4f366d9776c5c826b/install.sh#L148 106 | chmod -v a+x /usr/share/graphs1090/*.sh && \ 107 | # collectd.conf customization done in graphs1090-init 108 | # ref: https://github.com/wiedehopf/graphs1090/blob/151e63a810d6b087518992d4f366d9776c5c826b/install.sh#L179 109 | cp -rv \ 110 | /usr/share/graphs1090/git/html \ 111 | /usr/share/graphs1090/ \ 112 | && \ 113 | # ref: https://github.com/wiedehopf/graphs1090/blob/151e63a810d6b087518992d4f366d9776c5c826b/install.sh#L180 114 | cp -v \ 115 | /usr/share/graphs1090/git/default \ 116 | /etc/default/graphs1090 \ 117 | && \ 118 | # ref: https://github.com/wiedehopf/graphs1090/blob/151e63a810d6b087518992d4f366d9776c5c826b/install.sh#L302 119 | cp -v \ 120 | /usr/share/graphs1090/git/nginx-graphs1090.conf \ 121 | /usr/share/graphs1090/ \ 122 | && \ 123 | # ref: https://github.com/wiedehopf/graphs1090/blob/151e63a810d6b087518992d4f366d9776c5c826b/install.sh#L212 124 | mkdir -p /usr/share/graphs1090/data-symlink && \ 125 | # ref: https://github.com/wiedehopf/graphs1090/blob/151e63a810d6b087518992d4f366d9776c5c826b/install.sh#L217 126 | ln -vsnf /run/readsb /usr/share/graphs1090/data-symlink/data && \ 127 | # set up base telegraf config directories 128 | ##telegraf##mkdir -p /etc/telegraf/telegraf.d && \ 129 | # document telegraf version 130 | ##telegraf##bash -ec "telegraf --version >> /VERSIONS" && \ 131 | # Add Container Version 132 | branch="##BRANCH##" && \ 133 | { [[ "${branch:0:1}" == "#" ]] && branch="main" || true; } && \ 134 | git clone --depth=1 -b $branch https://github.com/sdr-enthusiasts/docker-tar1090.git /tmp/clone && \ 135 | pushd /tmp/clone && \ 136 | bash -ec 'echo "$(TZ=UTC date +%Y%m%d-%H%M%S)_$(git rev-parse --short HEAD)_$(git branch --show-current)" > /.CONTAINER_VERSION' && \ 137 | popd && \ 138 | # Clean-up. 139 | apt-get autoremove -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -y ${TEMP_PACKAGES[@]} && \ 140 | apt-get clean -q -y && \ 141 | rm -rf /src/* /tmp/* /var/lib/apt/lists/* /var/cache/* && \ 142 | # document versions 143 | cat /VERSIONS 144 | 145 | COPY rootfs/ / 146 | 147 | EXPOSE 80/tcp 148 | 149 | # Add healthcheck 150 | HEALTHCHECK --start-period=600s --interval=600s CMD /healthcheck.sh 151 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # sdr-enthusiasts/docker-tar1090 2 | 3 | - [sdr-enthusiasts/docker-tar1090](#sdr-enthusiastsdocker-tar1090) 4 | - [Introduction](#introduction) 5 | - [Note for Users running 32-bit Debian Buster-based OSes on ARM](#note-for-users-running-32-bit-debian-buster-based-oses-on-arm) 6 | - [Supported tags and respective Dockerfiles](#supported-tags-and-respective-dockerfiles) 7 | - [Multi Architecture Support](#multi-architecture-support) 8 | - [Prerequisites](#prerequisites) 9 | - [Up-and-Running with `docker run`](#up-and-running-with-docker-run) 10 | - [Up-and-Running with `docker-compose`](#up-and-running-with-docker-compose) 11 | - [Ports](#ports) 12 | - [Outgoing](#outgoing) 13 | - [Incoming](#incoming) 14 | - [Runtime Environment Variables](#runtime-environment-variables) 15 | - [Container Configuration](#container-configuration) 16 | - [`tar1090` Configuration](#tar1090-configuration) 17 | - [`tar1090` Core Configuration](#tar1090-core-configuration) 18 | - [Using a locally modified tar1090 version](#using-a-locally-modified-tar1090-version) 19 | - [`tar1090` `config.js` Configuration - Title](#tar1090-configjs-configuration---title) 20 | - [`tar1090` `config.js` Configuration - Output](#tar1090-configjs-configuration---output) 21 | - [`tar1090` `config.js` Configuration - Map Settings](#tar1090-configjs-configuration---map-settings) 22 | - [`tar1090` `config.js` Configuration - Range Rings](#tar1090-configjs-configuration---range-rings) 23 | - [`tar1090` `config.js` Configuration - Expert](#tar1090-configjs-configuration---expert) 24 | - [`tar1090` Route Display Configuration](#tar1090-route-display-configuration) 25 | - [`timelapse1090` Configuration](#timelapse1090-configuration) 26 | - [Paths](#paths) 27 | - [`readsb` Network Options](#readsb-network-options) 28 | - [`READSB_NET_CONNECTOR` syntax](#readsb_net_connector-syntax) 29 | - [`readsb` General Options](#readsb-general-options) 30 | - [AutoGain for RTLSDR Devices](#autogain-for-rtlsdr-devices) 31 | - [Message decoding introspection](#message-decoding-introspection) 32 | - [Configuring `graphs1090`](#configuring-graphs1090) 33 | - [`graphs1090` Environment Parameters](#graphs1090-environment-parameters) 34 | - [Enabling UAT data](#enabling-uat-data) 35 | - [Enabling AirSpy graphs](#enabling-airspy-graphs) 36 | - [Enabling Disk IO and IOPS data](#enabling-disk-io-and-iops-data) 37 | - [Configuring the Core Temperature graphs](#configuring-the-core-temperature-graphs) 38 | - [Reducing Disk IO for Graphs1090](#reducing-disk-io-for-graphs1090) 39 | - [Logging](#logging) 40 | - [Getting help](#getting-help) 41 | - [Using tar1090 with an SDR](#using-tar1090-with-an-sdr) 42 | - [globe-history or sometimes ironically called destroy-sd-card](#globe-history-or-sometimes-ironically-called-destroy-sd-card) 43 | - [Metrics](#metrics) 44 | - [Output to InfluxDBv2](#output-to-influxdbv2) 45 | - [Output to InfluxDBv1.8](#output-to-influxdbv18) 46 | - [Output to Prometheus](#output-to-prometheus) 47 | - [Minimalist setup](#minimalist-setup) 48 | 49 | ## Notice about ultrafeeder 50 | - Please use [`ultrafeeder`](https://github.com/sdr-enthusiasts/docker-adsb-ultrafeeder) 51 | - ultrafeeder can do everything this image can do and more 52 | - the readme for ultrafeeder is often more up to date 53 | 54 | ## Introduction 55 | 56 | This container [`tar1090`](https://github.com/wiedehopf/tar1090) runs [`@wiedehopf's readsb fork`](https://github.com/wiedehopf/readsb) ADS-B decoding engine in to feed the graphic tar1090 viewing webinterface, also by [wiedehopf](https://github.com/wiedehopf) (as is the viewadsb text-based output) to provide digital representations of the readsb output. 57 | 58 | At the time of writing this README, it provides: 59 | 60 | - Improved adjustable history 61 | - Show All Tracks much faster than original with many planes 62 | - Multiple Maps available 63 | - Map can be dimmed/darkened 64 | - Multiple aircraft can be selected 65 | - Labels with the callsign can be switched on and off 66 | - Heatmap of aircraft positions 67 | 68 | This image: 69 | 70 | - Receives Beast data from a provider such as `dump1090` or `readsb` 71 | - Optionally, receives MLAT data from a provider such as `mlat-client` 72 | - Provides the `tar1090` web interface 73 | - When using the `:telegraf` tag, it will be able to send data to Prometheus or InfluxDB to use in Grafana 74 | 75 | It builds and runs on `linux/amd64`, `linux/arm/v7` and `linux/arm64` (see below). 76 | 77 | ## Note for Users running 32-bit Debian Buster-based OSes on ARM 78 | 79 | Please see: [Buster-Docker-Fixes](https://github.com/sdr-enthusiasts/Buster-Docker-Fixes)! 80 | 81 | ## Supported tags and respective Dockerfiles 82 | 83 | - `latest` should always contain the latest released versions of `readsb`, `tar1090` and `tar1090-db`. 84 | - `latest_nohealthcheck` is the same as the `latest` version above. However, this version has the docker healthcheck removed. This is done for people running platforms (such as [Nomad](https://www.nomadproject.io)) that don't support manually disabling healthchecks, where healthchecks are not wanted. 85 | - Specific version tags are available if required, however these are not regularly updated. It is generally recommended to run latest. 86 | 87 | ## Multi Architecture Support 88 | 89 | - `linux/amd64`: Built on Linux x86-64 90 | - `linux/arm/v6`: Built on Odroid HC2 running ARMv7 32-bit 91 | - `linux/arm/v7`: Built on Odroid HC2 running ARMv7 32-bit 92 | - `linux/arm64`: Built on a Raspberry Pi 4 Model B running ARMv8 64-bit 93 | 94 | ## Prerequisites 95 | 96 | You will need a source of Beast data. Examples are an RPi running PiAware or [`sdr-enthusiasts/docker-readsb-protobuf`](https://github.com/sdr-enthusiasts/docker-readsb-protobuf). 97 | 98 | Optionally, you will need a source of MLAT data. This could be: 99 | 100 | - [`sdr-enthusiasts/docker-adsbexchange`](https://github.com/sdr-enthusiasts/docker-adsbexchange) image 101 | - [`sdr-enthusiasts/docker-piaware`](https://github.com/sdr-enthusiasts/docker-piaware) image 102 | - Basically anything running `mlat-client` listening for beast connections (ie: `--results beast,listen,30105`) 103 | 104 | ## Up-and-Running with `docker run` 105 | 106 | ```bash 107 | docker run -d \ 108 | --name=tar1090 \ 109 | -p 8078:80 \ 110 | -e TZ= \ 111 | -e BEASTHOST= \ 112 | -e MLATHOST= \ 113 | -e LAT=xx.xxxxx \ 114 | -e LONG=xx.xxxxx \ 115 | -v /opt/adsb/tar1090/graphs1090:/var/lib/collectd \ 116 | --tmpfs=/run:exec,size=64M \ 117 | --tmpfs=/var/log \ 118 | ghcr.io/sdr-enthusiasts/docker-tar1090:latest 119 | ``` 120 | 121 | Replacing `TIMEZONE` with your timezone, `BEASTHOST` with the IP address of a host that can provide Beast data, and `MLATHOST` with the IP address of a host that can provide MLAT data. 122 | 123 | For example: 124 | 125 | ```bash 126 | docker run -d \ 127 | --name=tar1090 \ 128 | -p 8078:80 \ 129 | -e TZ=Australia/Perth \ 130 | -e BEASTHOST=readsb \ 131 | -e MLATHOST=adsbx \ 132 | -e LAT=-33.33333 \ 133 | -e LONG=111.11111 \ 134 | -v /opt/adsb/tar1090/graphs1090:/var/lib/collectd \ 135 | --tmpfs=/run:exec,size=64M \ 136 | --tmpfs=/var/log \ 137 | ghcr.io/sdr-enthusiasts/docker-tar1090:latest 138 | ``` 139 | 140 | You should now be able to browse to: 141 | 142 | - to access the tar1090 web interface 143 | - to see a replay of past data 144 | - to see the heatmap for the past 24 hours. 145 | - to see a different heatmap for the past 24 hours. 146 | - to see performance graphs 147 | 148 | ## Up-and-Running with `docker-compose` 149 | 150 | An example `docker-compose.xml` file is below: 151 | 152 | ```yaml 153 | version: "3.8" 154 | 155 | services: 156 | tar1090: 157 | image: ghcr.io/sdr-enthusiasts/docker-tar1090:latest 158 | container_name: tar1090 159 | restart: always 160 | environment: 161 | - TZ=Australia/Perth 162 | - BEASTHOST=readsb 163 | - MLATHOST=adsbx 164 | - LAT=-33.33333 165 | - LONG=111.11111 166 | volumes: 167 | - /opt/adsb/tar1090/globe_history:/var/globe_history 168 | - /opt/adsb/tar1090/timelapse1090:/var/timelapse1090 169 | - /opt/adsb/tar1090/graphs1090:/var/lib/collectd 170 | - /proc/diskstats:/proc/diskstats:ro 171 | # - /run/airspy_adsb:/run/airspy_adsb 172 | ports: 173 | - 8078:80 174 | tmpfs: 175 | - /run:exec,size=64M 176 | - /var/log 177 | ``` 178 | 179 | You should now be able to browse to: 180 | 181 | - to access the tar1090 web interface. 182 | - to see a replay of past data 183 | - to see the heatmap for the past 24 hours. 184 | - to see a different heatmap for the past 24 hours. 185 | - to see performance graphs 186 | 187 | _Note_: the example above excludes `MLATHOST` as `readsb` alone cannot provide MLAT data. You'll need a feeder container for this. 188 | 189 | ## Ports 190 | 191 | Some common ports are as follows (which may or may not be in use depending on your configuration): 192 | 193 | | Port | Details | 194 | | ----------- | ------------------------------- | 195 | | `30001/tcp` | Raw protocol input | 196 | | `30002/tcp` | Raw protocol output | 197 | | `30003/tcp` | SBS/Basestation protocol output | 198 | | `32006/tcp` | SBS/Basestation protocol input | 199 | | `30004/tcp` | Beast protocol input | 200 | | `30005/tcp` | Beast protocol output | 201 | | `30006/tcp` | Beast reduce protocol output | 202 | | `30047/tcp` | Json position output | 203 | 204 | Json position output: 205 | 206 | - outputs an aircraft object for every new position received for an aircraft. The following parameters (which can be added with `READSB_EXTRA_ARGS`) control this output: 207 | - `--net-json-port-interval` Set minimum interval between outputs per aircraft for TCP json output, default: 0.0 (every position) 208 | - `--net-json-port-include-noposition` TCP json position output: include aircraft without position (state is sent for aircraft for every DF11 with CRC if the aircraft hasn't sent a position in the last 10 seconds and interval allowing) 209 | - each json object will be on a new line 210 | - 211 | 212 | Aircraft.json: 213 | 214 | - 215 | - available on the same port as the web interface, example: `http://192.168.x.yy:8087/data/aircraft.json` 216 | 217 | ### Outgoing 218 | 219 | This container will try to connect to the `BEASTHOST` on TCP port `30005` by default. This can be changed by setting the `BEASTPORT` environment variable. 220 | 221 | If `MLATHOST` is set, this container will try to connect the `MLATHOST` on TCP port `30105` by default. This can be changed to setting the `MLATPORT` environment variable. 222 | 223 | ### Incoming 224 | 225 | This container accepts HTTP connections on TCP port `80` by default. You can change this with the container's port mapping. In the examples above, this has been changed to `8078`. 226 | 227 | ## Runtime Environment Variables 228 | 229 | ### Container Configuration 230 | 231 | | Environment Variable | Purpose | Default | 232 | | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | 233 | | `BEASTHOST` | Required. IP/Hostname of a Mode-S/Beast provider (`dump1090`/`readsb`) | | 234 | | `BEASTPORT` | Optional. TCP port number of Mode-S/Beast provider (`dump1090`/`readsb`) | `30005` | 235 | | `LAT` | Optional. The latitude of your antenna | | 236 | | `LONG` | Optional. The longitude of your antenna | | 237 | | `MLATHOST` | Optional. IP/Hostname of an MLAT provider (`mlat-client`) | | 238 | | `MLATPORT` | Optional. TCP port number of an MLAT provider (`mlat-client`) | 30105 | 239 | | `TZ` | Optional. Your local timezone in [TZ-database-name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) format | | 240 | | `HEYWHATSTHAT_PANORAMA_ID` | Optional. Your `heywhatsthat.com` panorama ID. See . | | 241 | | `HEYWHATSTHAT_ALTS` | Optional. Comma separated altitudes for multiple outlines. Use no units or `ft` for feet, `m` for meters, or `km` for kilometers. Only integer numbers are accepted, no decimals please | `12192m` (=40000 ft) | 242 | | `HTTP_ACCESS_LOG` | Optional. Set to `true` to display HTTP server access logs. | `false` | 243 | | `HTTP_ERROR_LOG` | Optional. Set to `false` to hide HTTP server error logs. | `true` | 244 | | `READSB_MAX_RANGE` | Optional. Maximum range (in nautical miles). | Unset | 245 | | `ENABLE_TIMELAPSE1090` | Optional / Legacy. Set to any value to enable btimelapse1090. Once enabled, can be accessed via . | Unset | 246 | | `READSB_EXTRA_ARGS` | Optional, allows to specify extra parameters for readsb | Unset | 247 | | `READSB_DEBUG` | Optional, used to set debug mode. `n`: network, `P`: CPR, `S`: speed check | Unset | 248 | | `S6_SERVICES_GRACETIME` | Optional, reduce for faster container stop (graceful stop should not depend on this) | `3000` | 249 | | `ENABLE_AIRSPY` | Optional, set to any non-empty value if you want to enable the special AirSpy graphs. See below for additional configuration requirements | Unset | 250 | | `URL_AIRSPY` | Optional, set to the URL where the airspy stats are available, for example `http://airspy_adsb` | Unset | 251 | | `URL_1090_SIGNAL` | Optional. Retrieve gain, % of strong signals and signal graph data from a remote source. Set to an URL where the readsb stats are available, i.e. `http://192.168.2.34/tar1090` | Unset | 252 | 253 | READSB_EXTRA_ARGS just passes arguments to the commandline, you can check this file for more options for wiedehofps readsb fork: 254 | 255 | If you want to save historic data with tar1090, see a modified mode of operation at the end of the readme 256 | 257 | ### `tar1090` Configuration 258 | 259 | All of the variables below are optional. 260 | 261 | #### `tar1090` Core Configuration 262 | 263 | | Environment Variable | Purpose | Default | 264 | | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------- | 265 | | `READSB_JSON_INTERVAL` | Update data update interval for the webinterface in seconds | `1.0` | 266 | | `UPDATE_TAR1090` | At startup update tar1090 and tar1090db to the latest versions | `true` | 267 | | `UPDATE_TAR1090_DAYS` | Every X days update tar1090 and tar1090db to the latest versions | disabled | 268 | | `INTERVAL` | Interval at which the track history is saved | `8` | 269 | | `HISTORY_SIZE` | How many points in time are stored in the track history | `450` | 270 | | `URL_978` | The URL needs to point at where your skyaware978 webinterface is located, this will also enable UAT-specific graphs in graphs1090 | `http://dump978/skyaware978` | 271 | | `ENABLE_978` | Set to `true` to enable deprecated UAT/978 display in `tar1090` fetch data via json (not beast / raw) from `URL_978`. | Unset | 272 | | `GZIP_LVL` | `1`-`9` are valid, lower lvl: less CPU usage, higher level: less network bandwidth used when loading the page | `3` | 273 | | `PTRACKS` | Shows the last `$PTRACKS` hours of traces you have seen at the `?pTracks` URL | `8` | 274 | | `TAR1090_FLIGHTAWARELINKS` | Set to any value to enable FlightAware links in the web interface | `null` | 275 | | `TAR1090_ENABLE_AC_DB` | Set to `true` to enable extra information, such as aircraft type and registration, to be included in in `aircraft.json` output. Will use more memory; use caution on older Pis or similar devices. | Unset | 276 | | `TAR1090_IMAGE_CONFIG_LINK` | An optional URL shown at the top of page, designed to be used for a link back to a configuration page. The token `HOSTNAME` in the link is replaced with the current host that tar1090 is accessed on. | `null` | 277 | | `TAR1090_IMAGE_CONFIG_TEXT` | Text to display for the config link | `null` | 278 | | `TAR1090_DISABLE` | Set to `true` to disable the web server and all websites (including the map, `graphs1090`, `heatmap`, `pTracks`, etc.) | Unset | 279 | | `TAR1090_HISTORY_DISABLE` | Set to `true` to disable the tar1090 track history (pTracks / non globe tracks) | Unset | 280 | | `READSB_ENABLE_HEATMAP` | Set to `true` or leave unset to enable the HeatMap function available at `http://myip/?Heatmap`; set to `false` to disable the HeapMap function | `true` (enabled) | 281 | | `READSB_ENABLE_TRACES` | Save detailed globe history traces (1 gzip compressed json file per day and airframe, use MAX_GLOBE_HISTORY so you don't run out of inodes / diskspace) | `false` | 282 | | `TAR1090_ENABLE_ACTUALRANGE` | Set to `true` or leave unset to enable the outline of the actual range of your station on the map; set to `false` to disable the this outline | `true` (enabled) | 283 | | `TAR1090_AISCATCHER_SERVER` | If you want to show vessels from your AIS-Catcher instance on the map, put the (externally reachable) URL of your AIS-Catcher or ShipFeeder website in this parameter (incl. `https://`). Note - if you are using "barebones" AIS-Catcher you should add `GEOJSON on` after the `-N` parameter on the `AIS-Catcher` command line. If you use [docker-shipfeeder](https://github.com/sdr-enthusiasts/docker-shipfeeder), no change is needed for that container | Empty | 284 | | `TAR1090_AISCATCHER_REFRESH` | Refresh rate (in seconds) of reading vessels from your AIS-Catcher instance. Defaults to 15 (secs) if omitted | `15` | 285 | 286 | - For documentation on the aircraft.json format see this page: 287 | - TAR1090_ENABLE_AC_DB causes readsb to load the tar1090 database as a csv file from this repository: 288 | 289 | #### Using a locally modified tar1090 version 290 | 291 | `/local/custom_version` can be any folder you prefer. 292 | 293 | Clone tar1090 to a local direcotry: `git clone https://github.com/wiedehopf/tar1090 /local/custom_version` 294 | 295 | Make `/local/custom_version` available as `/var/tar1090_git_source` in the container: 296 | 297 | ``` 298 | volumes: 299 | - /local/custom_version:/var/tar1090_git_source 300 | ``` 301 | 302 | Make sure you have UPDATE_TAR1090 env var set to true. 303 | 304 | Changes in `/local/custom_version` won't be visible with a simple page reload, you need to either restart the container or run: 305 | 306 | ``` 307 | docker exec -it ultrafeeder bash /tar1090-install.sh /run/readsb webroot /usr/local/share/tar1090 /var/tar1090_git_source 308 | ``` 309 | 310 | After this has finished a simple reload in the browser should do the trick. 311 | 312 | Another option is to bind / mount a folder to /var/custom_html in the container and set 313 | CUSTOM_HTML=true, be aware no cache busting will be done, nor will any of the tar1090 configuration 314 | settings be applied. The folder will be served as is with aircraft data available as usual at /data. 315 | 316 | #### `tar1090` `config.js` Configuration - Title 317 | 318 | | Environment Variable | Purpose | Default | 319 | | ---------------------------- | ---------------------------------------------------- | --------- | 320 | | `TAR1090_PAGETITLE` | Set the tar1090 web page title | `tar1090` | 321 | | `TAR1090_PLANECOUNTINTITLE` | Show number of aircraft in the page title | `false` | 322 | | `TAR1090_MESSAGERATEINTITLE` | Show number of messages per second in the page title | `false` | 323 | 324 | #### `tar1090` `config.js` Configuration - Output 325 | 326 | | Environment Variable | Purpose | Default | 327 | | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------- | 328 | | `TAR1090_DISPLAYUNITS` | The DisplayUnits setting controls whether nautical (ft, NM, knots), metric (m, km, km/h) or imperial (ft, mi, mph) units are used in the plane table and in the detailed plane info. Valid values are "`nautical`", "`metric`", or "`imperial`". | `nautical` | 329 | 330 | #### `tar1090` `config.js` Configuration - Map Settings 331 | 332 | | Environment Variable | Purpose | Default | 333 | | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | 334 | | `TAR1090_BINGMAPSAPIKEY` | Provide a Bing Maps API key to enable the Bing imagery layer. You can obtain a free key (with usage limits) at (you need a "basic key"). | `null` | 335 | | `TAR1090_DEFAULTCENTERLAT` | Default center (latitude) of the map. This setting is overridden by any position information provided by dump1090/readsb. All positions are in decimal degrees. | `45.0` | 336 | | `TAR1090_DEFAULTCENTERLON` | Default center (longitude) of the map. This setting is overridden by any position information provided by dump1090/readsb. All positions are in decimal degrees. | `9.0` | 337 | | `TAR1090_DEFAULTZOOMLVL` | The google maps zoom level, `0` - `16`, lower is further out. | `7` | 338 | | `TAR1090_SITESHOW` | Center marker. If dump1090 provides a receiver location, that location is used and these settings are ignored. Set to `true` to show a center marker. | `false` | 339 | | `TAR1090_SITELAT` | Center marker. If dump1090 provides a receiver location, that location is used and these settings are ignored. Position of the marker (latitude). | `45.0` | 340 | | `TAR1090_SITELON` | Center marker. If dump1090 provides a receiver location, that location is used and these settings are ignored. Position of the marker (longitude). | `9.0` | 341 | | `TAR1090_SITENAME` | The tooltip of the center marker. | `My Radar Site` | 342 | | `TAR1090_RANGE_OUTLINE_COLOR` | Colour for the range outline. | `#0000DD` | 343 | | `TAR1090_RANGE_OUTLINE_WIDTH` | Width for the range outline. | `1.7` | 344 | | `TAR1090_RANGE_OUTLINE_COLORED_BY_ALTITUDE` | Range outline is coloured by altitude. | `false` | 345 | | `TAR1090_RANGE_OUTLINE_DASH` | Range outline dashing. Syntax `[L, S]` where `L` is the pixel length of the line, and `S` is the pixel length of the space. | Unset | 346 | | `TAR1090_ACTUAL_RANGE_OUTLINE_COLOR` | Colour for the actual range outline | `#00596b` | 347 | | `TAR1090_ACTUAL_RANGE_OUTLINE_WIDTH` | Width of the actual range outline | `1.7` | 348 | | `TAR1090_ACTUAL_RANGE_OUTLINE_DASH` | Dashed style for the actual range outline. Unset for solid line. `[5,5]` for a dashed line with 5 pixel lines and spaces in between | Unset | 349 | | `TAR1090_MAPTYPE_TAR1090` | Which map is displayed to new visitors. Valid values for this setting are `osm`, `esri`, `carto_light_all`, `carto_light_nolabels`, `carto_dark_all`, `carto_dark_nolabels`, `gibs`, `osm_adsbx`, `chartbundle_sec`, `chartbundle_tac`, `chartbundle_hel`, `chartbundle_enrl`, `chartbundle_enra`, `chartbundle_enrh`, and only with bing key `bing_aerial`, `bing_roads`. | `carto_light_all` | 350 | | `TAR1090_MAPDIM` | Default map dim state, true or false. | `true` | 351 | | `TAR1090_MAPDIMPERCENTAGE` | The percentage amount of dimming used if the map is dimmed, `0`-`1` | `0.45` | 352 | | `TAR1090_MAPCONTRASTPERCENTAGE` | The percentage amount of contrast used if the map is dimmed, `0`-`1` | `0` | 353 | | `TAR1090_DWDLAYERS` | Various map layers provided by the DWD geoserver can be added here. [Preview and available layers](https://maps.dwd.de/geoserver/web/wicket/bookmarkable/org.geoserver.web.demo.MapPreviewPage?1&filter=false). Multiple layers are also possible. Syntax: `dwd:layer1,dwd:layer2,dwd:layer3` | `dwd:RX-Produkt` | 354 | | `TAR1090_LABELZOOM` | Displays aircraft labels only until this zoom level, `1`-`15` (values >`15` don't really make sense) | | 355 | | `TAR1090_LABELZOOMGROUND` | Displays ground traffic labels only until this zoom level, `1`-`15` (values >`15` don't really make sense) | | 356 | 357 | #### `tar1090` `config.js` Configuration - Range Rings 358 | 359 | | Environment Variable | Purpose | Default | 360 | | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | 361 | | `TAR1090_RANGERINGS` | `false` to hide range rings | `true` | 362 | | `TAR1090_RANGERINGSDISTANCES` | Distances to display range rings, in miles, nautical miles, or km (depending settings value '`TAR1090_DISPLAYUNITS`'). Accepts a comma separated list of numbers (no spaces, no quotes). | `100,150,200,250` | 363 | | `TAR1090_RANGERINGSCOLORS` | Colours for each of the range rings specified in `TAR1090_RANGERINGSDISTANCES`. Accepts a comma separated list of hex colour values, each enclosed in single quotes (eg `TAR1090_RANGERINGSCOLORS='#FFFFF','#00000'`). No spaces. | Blank | 364 | 365 | #### `tar1090` `config.js` Configuration - Expert 366 | 367 | | Environment Variable | Purpose | Default | 368 | | ---------------------------- | ---------------------------------------------------- | --------- | 369 | | `TAR1090_CONFIGJS_APPEND` | Append arbitrary javascript code to config.js | Unset | 370 | 371 | - In case a setting is available in tar1090 but not exposed via environment variable for this container 372 | - For a list of possible settings, see 373 | - Incorrect syntax or any capitalization errors will cause the map to not load, you have been warned! 374 | - Example: `TAR1090_CONFIGJS_APPEND= MapDim=false; nexradOpacity=0.2;` 375 | - In the environment section of a compose file you can generally use multiple lines like this: 376 | 377 | ```yaml 378 | environment: 379 | ... 380 | - TAR1090_CONFIGJS_APPEND= 381 | MapDim=false; 382 | nexradOpacity=0.2; 383 | ... 384 | ``` 385 | 386 | ### `tar1090` Route Display Configuration 387 | 388 | | Environment Variable | Purpose | Default | 389 | | --------------------- | -------------------------------------------------- | ------------------------------------- | 390 | | `TAR1090_USEROUTEAPI` | Set to `true` to enable route lookup for callsigns | Unset | 391 | | `TAR1090_ROUTEAPIURL` | API URL used | `https://api.adsb.lol/api/0/routeset` | 392 | 393 | ### `timelapse1090` Configuration 394 | 395 | Legacy: we do NOT recommend you enable this feature as it will cause substantial additional writes to disk. On a Pi, this may reduce the lifespan of your SD card. Instead, use which provides the same functionality, but without additional load to the disk. 396 | The feature is included for legacy purposes only, and is disabled by default. 397 | 398 | | Environment Variable | Purpose | Default | 399 | | ------------------------ | ------------------------------------------------------------------------------- | ------- | 400 | | `ENABLE_TIMELAPSE1090` | If set to any non-empty value, the legacy Timelapse1090 feature will be enabled | Unset | 401 | | `TIMELAPSE1090_INTERVAL` | Snapshot interval in seconds | `10` | 402 | | `TIMELAPSE1090_HISTORY` | Time saved in hours | `24` | 403 | 404 | ## Paths 405 | 406 | No paths need to be mapped through to persistent storage. However, if you don't want to lose your range outline and aircraft tracks/history and heatmap / replay data on container restart, you can optionally map these paths: 407 | 408 | | Path | Purpose | 409 | | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 410 | | `/var/globe_history` | Holds range outline data, heatmap / replay data and traces if enabled.
_Note: this data won't be automatically deleted, you will need to delete it eventually if you map this path._ | 411 | | `/var/timelapse1090` | Holds timelapse1090 data if enabled | 412 | | `/var/lib/collectd` | Holds graphs1090 & performance data | 413 | 414 | ### `readsb` Network Options 415 | 416 | This container uses the readsb fork by wiedehopf as a backend to tar1090: 417 | 418 | Where the default value is "Unset", `readsb`'s default will be used. 419 | 420 | | Variable | Description | Controls which `readsb` option | Default | 421 | |----------|-------------|--------------------------------|---------| 422 | | `READSB_NET_CONNECTOR` | See "`READSB_NET_CONNECTOR` syntax" below. | `--net-connector=` | Unset | 423 | | `READSB_ENABLE_API` | Adds nginx proxies api at /re-api. Use with extraargs --write-json-globe-index --tar1090-use-api to get fast map with many planes | various | disabled | 424 | | `READSB_NET_API_PORT` | | `--net-api-port=` | `30152` | 425 | | `READSB_NET_BEAST_REDUCE_INTERVAL` | BeastReduce position update interval, longer means less data (valid range: `0.000` - `14.999`) | `--net-beast-reduce-interval=` | `1.0` | 426 | | `READSB_NET_BEAST_REDUCE_FILTER_DIST` | Restrict beast-reduce output to aircraft in a radius of X nmi | `--net-beast-reduce-filter-dist=` | Unset | 427 | | `READSB_NET_BEAST_REDUCE_FILTER_ALT` | Restrict beast-reduce output to aircraft below X ft | `--net-beast-reduce-filter-alt=` | Unset | 428 | | `READSB_NET_BEAST_REDUCE_OUT_PORT` | TCP BeastReduce output listen ports (comma separated) | `--net-beast-reduce-out-port=` | Unset | 429 | | `READSB_NET_BEAST_INPUT_PORT`| TCP Beast input listen ports | `--net-bi-port=` | `30004,30104` | 430 | | `READSB_NET_BEAST_OUTPUT_PORT` | TCP Beast output listen ports | `--net-bo-port=` | `30005` | 431 | | `READSB_NET_BUFFER` | TCP buffer size 64Kb * (2^n) | `--net-buffer=` | `2` (256Kb) | 432 | | `READSB_NET_RAW_OUTPUT_INTERVAL` | TCP output flush interval in seconds (maximum interval between two network writes of accumulated data). | `--net-ro-interval=` | `0.05` | 433 | | `READSB_NET_RAW_OUTPUT_SIZE` | TCP output flush size (maximum amount of internally buffered data before writing to network). | `--net-ro-size=` | `1200` | 434 | | `READSB_NET_CONNECTOR_DELAY` | Outbound re-connection delay. | `--net-connector-delay=` | `30` | 435 | | `READSB_NET_HEARTBEAT` | TCP heartbeat rate in seconds (0 to disable). | `--net-heartbeat=` | `60` | 436 | | `READSB_NET_RAW_INPUT_PORT` | TCP raw input listen ports. | `--net-ri-port=` | `30001` | 437 | | `READSB_NET_RAW_OUTPUT_PORT` | TCP raw output listen ports. | `--net-ro-port=` | `30002` | 438 | | `READSB_NET_SBS_INPUT_PORT` | TCP BaseStation input listen ports. | `--net-sbs-in-port=` | Unset | 439 | | `READSB_NET_SBS_OUTPUT_PORT` | TCP BaseStation output listen ports. | `--net-sbs-port=` | `30003` | 440 | | `REASSB_NET_VERBATIM` | Set this to any value to forward messages unchanged. | `--net-verbatim` | Unset | 441 | | `READSB_NET_VRS_PORT` | TCP VRS JSON output listen ports. | `--net-vrs-port=` | Unset | 442 | | `READSB_WRITE_STATE_ONLY_ON_EXIT` | if set to anything, it will only write the status range outlines, etc. upon termination of `readsb` | `--write-state-only-on-exit` | Unset | 443 | | `READSB_FORWARD_MLAT_SBS` | If set to anthing, it will include MLAT results in the SBS/BaseStation output. This may be desirable if you feed SBS data to applications like [VRS](https://github.com/sdr-enthusiasts/docker-virtualradarserver) or [PlaneFence](https://github.com/kx1t/docker-planefence) | `--forward-mlat-sbs` | Unset | 444 | | `READSB_FORWARD_MLAT` | If set to anthing, it will include MLAT results in the Beast and SBS/BaseStation output. This may be desirable if you feed SBS data to applications like [VRS](https://github.com/sdr-enthusiasts/docker-virtualradarserver) or [PlaneFence](https://github.com/kx1t/docker-planefence) | `--forward-mlat` | Unset | 445 | 446 | #### `READSB_NET_CONNECTOR` syntax 447 | 448 | Instead of (or in addition to) using `BEASTHOST`, you can also define ADSB data ingests using the `READSB_NET_CONNECTOR` parameter. This is the preferred way if you have multiple sources or destinations for your ADSB data. This variable allows you to configure incoming and outgoing connections. The variable takes a semicolon (`;`) separated list of `host,port,protocol[,uuid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX]`, where: 449 | 450 | - `host` is an IP address. Specify an IP/hostname/containername for incoming or outgoing connections. 451 | - `port` is a TCP port number 452 | - `protocol` can be one of the following: 453 | - `beast_reduce_out`: Beast-format output with lower data throughput (saves bandwidth and CPU) 454 | - `beast_reduce_plus_out`: Beast-format output with extra data (UUID). This is the preferred format when feeding the "new" aggregator services 455 | - `beast_out`: Beast-format output 456 | - `beast_in`: Beast-format input 457 | - `raw_out`: Raw output 458 | - `raw_in`: Raw input 459 | - `sbs_out`: SBS-format output 460 | - `vrs_out`: SBS-format output 461 | - `uuid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX` is an optional parameter that sets the UUID for this specific instance. It will override the global `UUID` parameter. This is only needed when you want to send different UUIDs to different aggregators. 462 | 463 | NOTE: If you have a UAT dongle and use `dump978` to decode this, you should use `READSB_NET_CONNECTOR` to ingest UAT data from `dump978`. See example below 464 | 465 | ```yaml 466 | environment: 467 | ... 468 | - READSB_NET_CONNECTOR=dump978,37981,raw_in;another-data-aggregator.com,30005,beast_reduce_plus_out 469 | ... 470 | ``` 471 | 472 | ### `readsb` General Options 473 | 474 | Where the default value is "Unset", `readsb`'s default will be used. 475 | 476 | | Variable | Description | Controls which `readsb` option | Default | 477 | | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------ | ------- | 478 | | `READSB_ENABLE_BIASTEE` | Set to any value to enable bias tee on supporting interfaces | `--enable-biastee` | Unset | 479 | | `READSB_RX_LOCATION_ACCURACY` | Accuracy of receiver location in metadata: 0=no location, 1=approximate, 2=exact | `--rx-location-accuracy=` | `2` | 480 | | `READSB_JSON_INTERVAL` | Update interval for the webinterface in seconds / interval between aircraft.json writes | `--write-json-every=` | `1.0` | 481 | | `READSB_JSON_TRACE_INTERVAL` | Per plane interval for json position output and trace interval for globe history | `--json-trace-interval=` | `15` | 482 | | `READSB_HEATMAP_INTERVAL` | Per plane interval for heatmap and replay (if you want to lower this, also lower json-trace-interval to this or a lower value) | `--heatmap=` | `15` | 483 | | `READSB_MAX_RANGE` | Absolute maximum range for position decoding (in nm) | `--max-range=` | `300` | 484 | | `READSB_MLAT` | Set this to add timestamps to AVR / RAW output | `--mlat` | Unset | 485 | | `READSB_STATS_EVERY` | Number of seconds between showing and resetting stats. | `--stats-every=` | Unset | 486 | | `READSB_STATS_RANGE` | Set this to any value to collect range statistics for polar plot. | `--stats-range` | Unset | 487 | | `READSB_RANGE_OUTLINE_HOURS` | Change which past timeframe the range outline is based on | `--range-outline-hours` | `24` | 488 | | `MAX_GLOBE_HISTORY` | Maximum number of days that `globe_history` data (heatmap / replay / traces) is retained. Note - this parameter doesn't affect the data used to produce `graphs1090` statistics | | Unset | 489 | 490 | ### Legacy AutoGain for RTLSDR Devices 491 | 492 | If you have set `READSB_GAIN=autogain`, then the system will take signal strength measurements to determine the optimal gain. The AutoGain functionality is based on a (slightly) modified version of [Wiedehopf's AutoGain](https://github.com/wiedehopf/autogain). AutoGain will only work with `rtlsdr` style receivers. 493 | 494 | There are 2 distinct periods in which the container will attempt to figure out the gain: 495 | 496 | - The initial period of 2 hours, in which an adjustment is done every 5 minutes 497 | - The subsequent period, in which an adjustment is done once every day 498 | 499 | Please note that in order for the initial period to complete, the container must run for 90 minutes without restarting. 500 | 501 | When taking measurements, if the percentage of "strong signals" (i.e., ADSB messages with RSSI > 3 dB) is larger than 6%, AutoGain will reduce the receiver's gain by 1 setting. Similarly, if the percentage of strong signals is smaller than 2.5%, AutoGain will increment the receiver's gain by 1 setting. When AutoGain changes the gain value, the `readsb` component of the container will restart. This may show as a disconnect / reconnected in container logs. 502 | 503 | We recommend running the initial period during times when there are a lot of planes overhead, so the system will get a good initial view of what signals look like when traffic is at its peak for your location. If you forgot to do this for any reason, feel free to give the AutoGain reset command (see below) during flights busy hour. 504 | 505 | Although not recommended, you can change the measurement intervals and low/high cutoffs with these parameters: 506 | 507 | | Environment Variable | Purpose | Default | 508 | | ------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ------- | 509 | | `READSB_AUTOGAIN_INITIAL_TIMEPERIOD` | How long the Initial Time Period should last (in seconds) | `7200` | 510 | | `READSB_AUTOGAIN_INITIAL_INTERVAL` | The measurement interval to optimize gain during the initial period of 90 minutes (in seconds) | `300` | 511 | | `READSB_AUTOGAIN_SUBSEQUENT_INTERVAL` | The measurement interval to optimize gain during the subsequent period (in seconds) | `86400` | 512 | | `READSB_AUTOGAIN_LOW_PCT` | If the percentage of "strong signals" (stronger than 3dBFS RSSI) is below this number, gain will be increased | `2.5` | 513 | | `READSB_AUTOGAIN_HIGH_PCT` | If the percentage of "strong signals" (stronger than 3dBFS RSSI) is above this number, gain will be decreased | `6.0` | 514 | | `READSB_AUTOGAIN_INITIAL_GAIN` | The start gain value for the initial period. If not defined, it will use the highest gain available for the SDR. | Unset | 515 | 516 | If you need to reset AutoGain and start over determining the gain, you can do so with this command: 517 | 518 | ```bash 519 | docker exec -it tar1090 /usr/local/bin/autogain1090 reset 520 | ``` 521 | 522 | ## Message decoding introspection 523 | 524 | You can look at individual messages and what information they contain, either for all or for an individual aircraft by hex: 525 | 526 | ```shell 527 | # only for hex 3D3ED0 528 | docker exec -it tar1090 /usr/local/bin/viewadsb --show-only 3D3ED0 529 | 530 | # for all aircraft 531 | docker exec -it tar1090 /usr/local/bin/viewadsb --no-interactive 532 | 533 | # show position / CPR debugging for hex 3D3ED0 534 | docker exec -it tar1090 /usr/local/bin/viewadsb --cpr-focus 3D3ED0 535 | ``` 536 | 537 | ## Configuring `graphs1090` 538 | 539 | ### `graphs1090` Environment Parameters 540 | 541 | | Variable | Description | Default | 542 | | -------------------------------------------- | ------------------------------------------------------------------------------------------------------ | -------------- | 543 | | `GRAPHS1090_DARKMODE` | If set to any value, `graphs1090` will be rendered in "dark mode". | Unset | 544 | | `GRAPHS1090_RRD_STEP` | Interval in seconds to feed data into RRD files. | `60` | 545 | | `GRAPHS1090_SIZE` | Set graph size, possible values: `small`, `default`, `large`, `huge`, `custom`. | `custom` | 546 | | `GRAPHS1090_ALL_LARGE` | Make the small graphs as large as the big ones by setting to `yes`. | `no` | 547 | | `GRAPHS1090_FONT_SIZE` | Font size (relative to graph size). | `10.0` | 548 | | `GRAPHS1090_MAX_MESSAGES_LINE` | Set to any value to draw a reference line at the maximum message rate. | Unset | 549 | | `GRAPHS1090_LARGE_WIDTH` | Defines the width of the larger graphs. (if size is set to custom) | `1096` | 550 | | `GRAPHS1090_LARGE_HEIGHT` | Defines the height of the larger graphs. (if size is set to custom) | `235` | 551 | | `GRAPHS1090_SMALL_WIDTH` | Defines the width of the smaller graphs. (if size is set to custom) | `619` | 552 | | `GRAPHS1090_SMALL_HEIGHT` | Defines the height of the smaller graphs. (if size is set to custom) | `324` | 553 | | `GRAPHS1090_DISK_DEVICE` | Defines which disk device (`mmc0`, `sda`, `sdc`, etc) is shown. Leave empty for default device | Unset | 554 | | `GRAPHS1090_ETHERNET_DEVICE` | Defines which (wired) ethernet device (`eth0`, `enp0s`, etc) is shown. Leave empty for default device | Unset | 555 | | `GRAPHS1090_WIFI_DEVICE` | Defines which (wireless) WiFi device (`wlan0`, `wlp3s0`, etc) is shown. Leave empty for default device | Unset | 556 | | `GRAPHS1090_DISABLE` | Set to `true` to disable the entire GRAPHS1090 web page and associated data collection | Unset | 557 | | `GRAPHS1090_DISABLE_CHART_CPU` | Set to `true` to disable the GRAPHS1090 CPU chart | Unset | 558 | | `GRAPHS1090_DISABLE_CHART_TEMP` | Set to `true` to disable the GRAPHS1090 Temperature chart | Unset | 559 | | `GRAPHS1090_DISABLE_CHART_MEMORY` | Set to `true` to disable the GRAPHS1090 Memory Utilization chart | Unset | 560 | | `GRAPHS1090_DISABLE_CHART_NETWORK_BANDWIDTH` | Set to `true` to disable the GRAPHS1090 Network Bandwidth chart | Unset | 561 | | `GRAPHS1090_DISABLE_CHART_DISK_USAGE` | Set to `true` to disable the GRAPHS1090 Disk Usage chart | Unset | 562 | | `GRAPHS1090_DISABLE_CHART_DISK_IOPS` | Set to `true` to disable the GRAPHS1090 Disk IOPS chart | Unset | 563 | | `GRAPHS1090_DISABLE_CHART_DISK_BANDWIDTH` | Set to `true` to disable the GRAPHS1090 Disk Bandwidth chart | Unset | 564 | | `GRAPHS1090_WWW_TITLE` | Set title for the web page (displayed in the browser title or tab bar) | `graphs1090` | 565 | | `GRAPHS1090_WWW_HEADER` | Set header text for the web page | `Perf. Graphs` | 566 | | `GRAPHS1090_HIDE_SYSTEM` | Hide the system graphs and don't render them, don't collect system data | `no` | 567 | | `GRAPHS1090_DEFAULT_APPEND` | Append to /etc/default/graphs1090, see | Unset | 568 | 569 | ### Enabling UAT data 570 | 571 | ADS-B over UAT data is transmitted in the 978 MHz band, and this is used in the USA only. To display the corresponding graphs, you should: 572 | 573 | 1. Set the following environment parameters: 574 | 575 | ```yaml 576 | - ENABLE_978=yes 577 | - URL_978=http://dump978/skyaware978 578 | ``` 579 | 580 | 2. Install the [`docker-dump978` container](https://github.com/sdr-enthusiasts/docker-dump978). Note - only containers downloaded/deployed on/after Feb 8, 2023 will work. 581 | 582 | Note that you \*_must_- configure `URL_978` to point at a working skyaware978 website with `aircraft.json` data feed. This means that the URL `http://dump978/skyaware978/data/aircraft.json` must return valid JSON data to this `tar1090` container. 583 | 584 | ### Enabling AirSpy graphs 585 | 586 | Users of AirSpy devices can enable extra `graphs1090` graphs by configuring the following: 587 | 588 | 1. Set the following environment parameters: 589 | 590 | ```yaml 591 | - ENABLE_AIRSPY=yes 592 | - URL_AIRSPY=http://airspy_adsb 593 | ``` 594 | 595 | 2. Install the [`airspy_adsb` container](https://github.com/sdr-enthusiasts/airspy_adsb). Note - only containers downloaded/deployed on/after May 9th, 2024 will work with this method. 596 | 597 | ### Enabling Disk IO and IOPS data 598 | 599 | To allow the container access to the Disk IO data, you should map the following volume: 600 | 601 | ```yaml 602 | volumes: 603 | - /proc/diskstats:/proc/diskstats:ro 604 | ... 605 | ``` 606 | 607 | ### Configuring the Core Temperature graphs 608 | 609 | By default, the system will use the temperature available at Thermal Zone 0. This generally works well on Raspberry Pi devices, and no additional changes are needed. 610 | 611 | On different devices, the Core Temperature is mapped to a different Thermal Zone. To ensure the Core Temperature graph works, follow these steps 612 | 613 | First check out which Thermal Zone contains the temperature you want to monitor. On your host system, do this: 614 | 615 | ```bash 616 | for i in /sys/class/thermal/thermal_zone* ; do echo "$i - $(cat ${i}/type) - $(cat ${i}/temp 2>/dev/null)"; done 617 | ``` 618 | 619 | Something similar to this will be show: 620 | 621 | ```bash 622 | /sys/class/thermal/thermal_zone0 - acpitz - 25000 623 | /sys/class/thermal/thermal_zone1 - INT3400 Thermal - 20000 624 | /sys/class/thermal/thermal_zone2 - TSKN - 43050 625 | /sys/class/thermal/thermal_zone3 - NGFF - 32050 626 | /sys/class/thermal/thermal_zone4 - TMEM - 39050 627 | /sys/class/thermal/thermal_zone5 - pch_skylake - 40500 628 | /sys/class/thermal/thermal_zone6 - B0D4 - 54050 629 | /sys/class/thermal/thermal_zone7 - iwlwifi_1 - 630 | /sys/class/thermal/thermal_zone8 - x86_pkg_temp - 57000 631 | ``` 632 | 633 | Repeat this a few times to ensure that the temperature varies and isn't hardcoded to a value. In our case, either Thermal Zone 5 (`pch_skylake` is the Intel Core name) or Thermal Zone 8 (the temp of the entire SOC package) can be used. Once you have determined which Thermal Zone number you want to use, map it to a volume like this. Make sure that the part to the left of the first `:` reflects your Thermal Zone directory; the part to the right of the first `:` should always be `/sys/class/thermal/thermal_zone0:ro`. 634 | 635 | Note that you will have to add `- privileged: true` capabilities to the container. This is less than ideal as it will give the container access to all of your system devices and processes. Make sure you feel comfortable with this before you do this. 636 | 637 | ```yaml 638 | privileged: true 639 | volumes: 640 | - /sys/class/thermal/thermal_zone8:/sys/class/thermal/thermal_zone0:ro 641 | ... 642 | ``` 643 | 644 | Note - on some systems (DietPi comes to mind), `/sys/class/thermal/` may not be available. 645 | 646 | ### Reducing Disk IO for Graphs1090 647 | 648 | Note - _this feature is still somewhat experimental. If you are really attached to your statistics/graphs1090 data, please make sure to back up your mapped drives regularly_ 649 | 650 | If you are using a Raspberry Pi or another type of computer with an SD card, you may already be aware that these SD cards have a limited number of write-cycles that will determine their lifespan. In other words - a common reason for SD card failure is excessive writes to it. 651 | 652 | By the nature of having to log lots of data the `graphs1090` functionality writes a lot to the SD card. To reduce the number of write cycles, there are a few parameters you can set. 653 | 654 | Enabling this functionality will cause `graphs1090` to temporarily write all data to volatile memory (`/run`) instead of persistent disk space (`/var/lib/collectd`). This data is backed up to persistent disk space in regular intervals and upon (graceful) shutdown of the container. 655 | 656 | Note -- there is a chance that the data isn't written back in time (due to power failures, non-graceful container shutdowns, etc), in which case you may lose statistics data that has been generated since the last write-back. 657 | 658 | The feature assumes that you have mapped `/var/lib/collectd` to a volume (to ensure data is persistent across container recreations), and `/run` as a `tmpfs` RAM disk, as shown below and also as per the [`docker-compose.yml` example](docker-compose.yml): 659 | 660 | ```yaml 661 | volumes: 662 | - /opt/adsb/tar1090/globe_history:/var/globe_history 663 | --- 664 | tmpfs: 665 | - /run:exec,size=256M 666 | ``` 667 | 668 | | Environment Variable | Purpose | Default | 669 | | --------------------------------- | ------------------------------------------------------------------------------------------- | ------- | 670 | | `GRAPHS1090_REDUCE_IO=` | Optional Set to `true` to reduce the write cycles for `graphs1090` | Unset | 671 | | `GRAPHS1090_REDUCE_IO_FLUSH_IVAL` | Interval (in secs) over which the `graphs1090` data is written back to non-volatile storage | 1 day | 672 | 673 | ## Logging 674 | 675 | All logs are to the container's stdout and can be viewed with `docker logs -t [-f] container`. 676 | 677 | ## Getting help 678 | 679 | Please feel free to [open an issue on the project's GitHub](https://github.com/sdr-enthusiasts/docker-tar1090/issues). 680 | 681 | We also have a [Discord channel](https://discord.gg/sTf9uYF), feel free to [join](https://discord.gg/sTf9uYF) and converse. 682 | 683 | ## Using tar1090 with an SDR 684 | 685 | | Variable | Description | Controls which `readsb` option | Default | 686 | | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | -------------- | 687 | | `READSB_GAIN` | Set gain (in dB). Set to `auto` to use the quickly adjusting readsb's built-in auto-gain. Use `autogain` to use the slow adjusting legacy autogain script. | `--gain=`| `auto` | 688 | | `READSB_DEVICE_TYPE` | If using an SDR, set this to `rtlsdr`, `modesbeast`, `gnshulc` depending on the model of your SDR. If not using an SDR, leave un-set. | `--device-type=` | Unset | 689 | | `READSB_RTLSDR_DEVICE` | Select device by serial number. | `--device=` | Unset | 690 | | `READSB_RTLSDR_PPM` | Set oscillator frequency correction in PPM. See section [Estimating PPM](https://github.com/docker-readsb/README.MD#estimating-ppm) below | `--ppm=` | Unset | 691 | | `READSB_BEAST_SERIAL` | only when type `modesbeast` or `gnshulc` is used: Path to Beast serial device. | `--beast-serial=` | `/dev/ttyUSB0` | 692 | 693 | Example 694 | 695 | ```yaml 696 | version: "3.8" 697 | 698 | services: 699 | tar1090: 700 | image: ghcr.io/sdr-enthusiasts/docker-tar1090:latest 701 | container_name: tar1090 702 | hostname: tar1090 703 | restart: always 704 | environment: 705 | - TZ=Australia/Perth 706 | - LAT=-33.33333 707 | - LONG=111.11111 708 | - READSB_DEVICE_TYPE=rtlsdr 709 | - READSB_GAIN=auto 710 | - READSB_RTLSDR_DEVICE=0 711 | ports: 712 | - 8078:80 713 | tmpfs: 714 | - /run:exec,size=64M 715 | - /var/log 716 | # USB passthrough 717 | device_cgroup_rules: 718 | - 'c 189:* rwm' 719 | volumes: 720 | - /dev/bus/usb:/dev/bus/usb:ro 721 | ``` 722 | 723 | ## globe-history or sometimes ironically called destroy-sd-card 724 | 725 | See also: 726 | 727 | ```yaml 728 | environment: 729 | ... 730 | - READSB_EXTRA_ARGS=--write-json-globe-index --write-globe-history /var/globe_history 731 | ... 732 | volumes: 733 | - /hostpath/to/your/globe_history:/var/globe_history 734 | ``` 735 | 736 | The first part of the mount before the : is the path on the docker host, don't change the 2nd part. 737 | Using this volume gives you persistence for the history / heatmap / range outline 738 | 739 | Note that this mode will make T not work as before for displaying all tracks as tracks are only loaded when you click them. 740 | 741 | ## Metrics 742 | 743 | When using the `:telegraf` tag, the image contains [Telegraf](https://docs.influxdata.com/telegraf/), which can be used to capture metrics from `readsb` if an output is enabled. 744 | 745 | **NOTE - READ CAREFULLY**: As of 27 April 2023, the `latest` image no longer contains Telegraf. If you want to send metrics to InfluxDB or Prometheus, please use this image: 746 | 747 | ```yaml 748 | services: 749 | tar1090: 750 | image: ghcr.io/sdr-enthusiasts/docker-tar1090:telegraf 751 | ... 752 | ``` 753 | 754 | ### Output to InfluxDBv2 755 | 756 | In order for Telegraf to output metrics to an [InfluxDBv2](https://docs.influxdata.com/influxdb/) time-series database, the following environment variables can be used: 757 | 758 | | Variable | Description | 759 | | ------------------- | ----------------------------------- | 760 | | `INFLUXDBV2_URL` | The URL of the InfluxDB instance | 761 | | `INFLUXDBV2_TOKEN` | The token for authentication | 762 | | `INFLUXDBV2_ORG` | InfluxDB Organization to write into | 763 | | `INFLUXDBV2_BUCKET` | Destination bucket to write into | 764 | 765 | ### Output to InfluxDBv1.8 766 | 767 | In order for Telegraf to output metrics to a legacy[InfluxDBv1](https://docs.influxdata.com/influxdb/v1.8/) time-series database, the following environment variables can be used: 768 | 769 | | Variable | Description | 770 | | ------------------- | --------------------------------------- | 771 | | `INFLUXDB_URL` | The URL of the InfluxDB instance | 772 | | `INFLUXDB_DATABASE` | database in InfluxDB to store data in | 773 | | `INFLUXDB_USERNAME` | username to authenticate to InfluxDB as | 774 | | `INFLUXDB_PASSWORD` | password for InfluxDB User | 775 | 776 | ### Output to Prometheus 777 | 778 | In order for Telegraf to serve a [Prometheus](https://prometheus.io) endpoint, the following environment variables can be used: 779 | 780 | | Variable | Description | 781 | | ------------------- | ------------------------------------------------------------------------ | 782 | | `PROMETHEUS_ENABLE` | Set to `true` for a Prometheus endpoint on `http://0.0.0.0:9273/metrics` | 783 | 784 | ## Minimalist setup 785 | 786 | If you want to configure to run with a minimal CPU and RAM profile, and use it _only_ as a SDR decoder but without any mapping or stats/graph websites, then do the following: 787 | 788 | - Set the parameter `TAR1090_DISABLE=true`. This will prevent the `nginx` webserver and any websites or associated data collection (graphs1090, heatmap, etc.) to be launched 789 | - Make sure not to use the `ghcr.io/sdr-enthusiasts/docker-adsb-ultrafeeder:telegraf` label as Telegraf adds a LOT of resource use to the container 790 | 791 | ## Offline maps 792 | 793 | There is the option to use some basic offline maps limited in zoom: 794 | 795 | - Download the tiles (donn't install tar1090): 796 | - Add a volume mapping so the container can access the tiles: 797 | 798 | ```yaml 799 | volumes: 800 | - /usr/local/share/osm_tiles_offline:/usr/local/share/osm_tiles_offline 801 | ``` 802 | -------------------------------------------------------------------------------- /buildnow.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # shellcheck disable=SC2086,SC2162,SC2153 3 | 4 | ## LOCAL BUILD SCRIPT FOR KX1T -- YOU CAN IGNORE THIS FILE 5 | 6 | 7 | [[ "$1" != "" ]] && BRANCH="$1" || BRANCH="$(git branch --show-current)" 8 | [[ "$BRANCH" == "main" ]] && TAG="latest" || TAG="$BRANCH" 9 | [[ "$ARCHS" == "" ]] && ARCHS="linux/armhf,linux/arm64,linux/amd64" 10 | 11 | BASETARGET1=ghcr.io/sdr-enthusiasts 12 | BASETARGET2=kx1t 13 | 14 | IMAGE1="$BASETARGET1/$(pwd | sed -n 's|.*/\(docker-.*\)|\1|p'):$TAG" 15 | IMAGE2="$BASETARGET2/$(pwd | sed -n 's|.*/docker-\(.*\)|\1|p'):$TAG" 16 | 17 | echo "press enter to start building $IMAGE1 and $IMAGE2 from $BRANCH" 18 | 19 | read 20 | 21 | git checkout $BRANCH 22 | 23 | starttime="$(date +%s)" 24 | # rebuild the container 25 | set -x 26 | 27 | # git pull -a 28 | cp -f Dockerfile Dockerfile.tmp-backup 29 | if [[ "$(uname -s)" == "Darwin" ]] 30 | then 31 | sed -i '' 's/##BRANCH##/'"$BRANCH"'/g' Dockerfile 32 | else 33 | sed -i 's/##BRANCH##/'"$BRANCH"'/g' Dockerfile 34 | fi 35 | 36 | docker buildx build -f Dockerfile --compress --push $2 --platform $ARCHS --tag "$IMAGE1" . 37 | [[ $? ]] && docker buildx build --compress --push $2 --platform $ARCHS --tag $IMAGE2 . 38 | mv -f Dockerfile.tmp-backup Dockerfile 39 | echo "Total build time: $(( $(date +%s) - starttime )) seconds" 40 | -------------------------------------------------------------------------------- /rootfs/etc/nginx.tar1090/nginx.conf: -------------------------------------------------------------------------------- 1 | user www-data; 2 | worker_processes 1; 3 | pid /run/nginx.pid; 4 | include /etc/nginx/modules-enabled/*.conf; 5 | daemon off; 6 | 7 | events { 8 | # worker_connections 768; 9 | # multi_accept on; 10 | } 11 | 12 | http { 13 | 14 | ## 15 | # Basic Settings 16 | ## 17 | 18 | sendfile on; 19 | tcp_nopush on; 20 | tcp_nodelay on; 21 | keepalive_timeout 65; 22 | types_hash_max_size 2048; 23 | server_tokens off; 24 | 25 | # server_names_hash_bucket_size 64; 26 | # server_name_in_redirect off; 27 | 28 | include /etc/nginx/mime.types; 29 | default_type application/octet-stream; 30 | 31 | ## 32 | # Logging Settings 33 | ## 34 | 35 | access_log /dev/stdout; 36 | error_log /dev/stdout notice; 37 | 38 | ## 39 | # Gzip Settings 40 | ## 41 | 42 | gzip on; 43 | 44 | # gzip_vary on; 45 | # gzip_proxied any; 46 | # gzip_comp_level 6; 47 | # gzip_buffers 16 8k; 48 | # gzip_http_version 1.1; 49 | gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; 50 | 51 | ## 52 | # Virtual Host Configs 53 | ## 54 | 55 | include /etc/nginx/conf.d/*.conf; 56 | include /etc/nginx/sites-enabled/*; 57 | } 58 | -------------------------------------------------------------------------------- /rootfs/etc/nginx.tar1090/sites-enabled/tar1090: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | root /var/www/html; 4 | server_name _; 5 | include /etc/nginx/nginx-tar1090-webroot.conf; 6 | 7 | location /timelapse { 8 | alias /opt/timelapse1090/html/; 9 | try_files $uri $uri/ =404; 10 | } 11 | 12 | location /timelapse/data { 13 | alias /run/timelapse1090; 14 | 15 | location ~ chunk_.*\.gz$ { 16 | add_header Access-Control-Allow-Origin "*"; 17 | add_header Cache-Control "must-revalidate"; 18 | add_header Content-Type "application/json"; 19 | add_header Content-Encoding "gzip"; 20 | } 21 | 22 | location ~ .*\.json$ { 23 | add_header Access-Control-Allow-Origin "*"; 24 | add_header Cache-Control "public, max-age=0"; 25 | } 26 | 27 | } 28 | 29 | location /mlat-client-stats { 30 | alias /run/mlat-client; 31 | } 32 | 33 | #ref: https://github.com/wiedehopf/graphs1090/blob/151e63a810d6b087518992d4f366d9776c5c826b/install.sh#L302 34 | include /usr/share/graphs1090/nginx-graphs1090.conf; 35 | 36 | # enable Prometheus: 37 | location /metrics { 38 | types { } default_type "text/plain; charset=utf-8"; 39 | alias /run/readsb/stats.prom; 40 | } 41 | 42 | # placeholder API proxy 43 | #sed_placeholder_API_proxy 44 | 45 | } 46 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/09-rtlsdr-biastee/down: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec /etc/s6-overlay/scripts/09-rtlsdr-biastee-down 3 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/09-rtlsdr-biastee/type: -------------------------------------------------------------------------------- 1 | oneshot 2 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/09-rtlsdr-biastee/up: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec /etc/s6-overlay/scripts/09-rtlsdr-biastee-init 3 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/autogain/dependencies.d/readsb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/autogain/dependencies.d/readsb -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/autogain/dependencies.d/startup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/autogain/dependencies.d/startup -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/autogain/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec /etc/s6-overlay/scripts/autogain 3 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/autogain/type: -------------------------------------------------------------------------------- 1 | longrun 2 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/cleanup_globe_history/dependencies.d/startup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/cleanup_globe_history/dependencies.d/startup -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/cleanup_globe_history/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec /etc/s6-overlay/scripts/cleanup_globe_history 3 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/cleanup_globe_history/type: -------------------------------------------------------------------------------- 1 | longrun 2 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/collectd/dependencies.d/startup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/collectd/dependencies.d/startup -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/collectd/finish: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | rm -rf /run/collectd 3 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/collectd/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec /etc/s6-overlay/scripts/collectd 3 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/collectd/type: -------------------------------------------------------------------------------- 1 | longrun 2 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/graphs1090-writeback/dependencies.d/startup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/graphs1090-writeback/dependencies.d/startup -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/graphs1090-writeback/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec /etc/s6-overlay/scripts/graphs1090-writeback 3 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/graphs1090-writeback/type: -------------------------------------------------------------------------------- 1 | longrun 2 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/graphs1090/dependencies.d/collectd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/graphs1090/dependencies.d/collectd -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/graphs1090/dependencies.d/startup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/graphs1090/dependencies.d/startup -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/graphs1090/finish: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | rm -rf /run/graphs1090 3 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/graphs1090/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec /etc/s6-overlay/scripts/graphs1090 3 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/graphs1090/type: -------------------------------------------------------------------------------- 1 | longrun 2 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/nginx/dependencies.d/startup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/nginx/dependencies.d/startup -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/nginx/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec /etc/s6-overlay/scripts/nginx 3 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/nginx/type: -------------------------------------------------------------------------------- 1 | longrun 2 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/readsb/dependencies.d/09-rtlsdr-biastee: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/readsb/dependencies.d/09-rtlsdr-biastee -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/readsb/dependencies.d/startup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/readsb/dependencies.d/startup -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/readsb/finish: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | rm -rf /run/readsb 3 | rm -f /run/readsb-prometheus.prom 4 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/readsb/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec /etc/s6-overlay/scripts/readsb 3 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/readsb/type: -------------------------------------------------------------------------------- 1 | longrun 2 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/startup/dependencies.d/base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/startup/dependencies.d/base -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/startup/down: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec /etc/s6-overlay/scripts/startup-finish 3 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/startup/type: -------------------------------------------------------------------------------- 1 | oneshot 2 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/startup/up: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec /etc/s6-overlay/scripts/startup 3 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/tar1090-update/dependencies.d/startup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/tar1090-update/dependencies.d/startup -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/tar1090-update/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec /etc/s6-overlay/scripts/tar1090-update 3 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/tar1090-update/type: -------------------------------------------------------------------------------- 1 | longrun 2 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/tar1090/dependencies.d/readsb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/tar1090/dependencies.d/readsb -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/tar1090/dependencies.d/startup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/tar1090/dependencies.d/startup -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/tar1090/finish: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | rm -rf /run/tar1090 3 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/tar1090/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec /etc/s6-overlay/scripts/tar1090 3 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/tar1090/type: -------------------------------------------------------------------------------- 1 | longrun 2 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/telegraf/dependencies.d/startup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/telegraf/dependencies.d/startup -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/telegraf/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec /etc/s6-overlay/scripts/telegraf 3 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/telegraf/type: -------------------------------------------------------------------------------- 1 | longrun 2 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/timelapse1090/dependencies.d/startup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/timelapse1090/dependencies.d/startup -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/timelapse1090/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec /etc/s6-overlay/scripts/timelapse1090 3 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/timelapse1090/type: -------------------------------------------------------------------------------- 1 | longrun 2 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/autogain: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/autogain -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/cleanup_globe_history: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/cleanup_globe_history -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/collectd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/collectd -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/graphs1090: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/graphs1090 -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/graphs1090-writeback: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/graphs1090-writeback -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/nginx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/nginx -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/readsb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/readsb -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/startup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/startup -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/tar1090: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/tar1090 -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/tar1090-update: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/tar1090-update -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/telegraf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/telegraf -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/timelapse1090: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdr-enthusiasts/docker-tar1090/69aa505332beaf24879402c568fcd8df62a39c39/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/timelapse1090 -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/scripts/autogain: -------------------------------------------------------------------------------- 1 | #!/command/with-contenv bash 2 | # shellcheck shell=bash disable=SC1091,SC2076 3 | 4 | source /scripts/common 5 | 6 | trap 'pkill -P $$ || true; exit 0' SIGTERM SIGINT SIGHUP SIGQUIT 7 | 8 | # Autogain routine 9 | # 10 | # Relevant env variables: 11 | # READSB_GAIN: set to "autogain" to enable autogain 12 | # READSB_AUTOGAIN_INITIAL_INTERVAL: time in seconds to run autogain during initial assessment period; 300 if omitted 13 | # READSB_AUTOGAIN_SUBSEQUENT_INTERVAL: time in seconds to run autogain during initial assessment period; 86400 (=1 day) if omitted 14 | # Command to restart autogain: docker exec -it tar1090 /usr/local/bin/autogain1090 reset 15 | 16 | READSB_AUTOGAIN_INITIAL_INTERVAL="${READSB_AUTOGAIN_INITIAL_INTERVAL:-300}" 17 | READSB_AUTOGAIN_SUBSEQUENT_INTERVAL="${READSB_AUTOGAIN_SUBSEQUENT_INTERVAL:-86400}" 18 | READSB_AUTOGAIN_INITIAL_TIMEPERIOD="${READSB_AUTOGAIN_INITIAL_TIMEPERIOD:-7200}" 19 | 20 | if [[ "${READSB_GAIN,,}" != "autogain" ]]; then 21 | # Autogain is not enabled, so let's do nothing forever 22 | stop_service 23 | fi 24 | 25 | if [[ "${READSB_DEVICE_TYPE,,}" != "rtlsdr" ]]; then 26 | s6wrap --quiet --prepend=autogain --timestamps --args echo "ERROR: AUTOGAIN enabled but READSB_DEVICE_TYPE is not \"rtlsdr\". Autogain disabled." 27 | stop_service 28 | fi 29 | 30 | autogain_dir="/var/globe_history/autogain" 31 | 32 | # if autogain is suspended, sleep for an hour, after that this script will check again if still suspended 33 | [[ -f "${autogain_dir}/suspend" ]] && exec sleep 3600 34 | 35 | mkdir -p "${autogain_dir}" 36 | 37 | # wait a bit so stats.json is present 38 | sleep 5 39 | 40 | # Do special things if it's the first time AUTOGAIN is running 41 | if [[ ! -f $autogain_dir/autogain_initialized ]]; then 42 | [[ -f "${autogain_dir}/suspend" ]] && exec sleep 3600 43 | s6wrap --quiet --prepend=autogain --timestamps --args echo "Autogain initialization started. We'll collect data every $READSB_AUTOGAIN_INITIAL_INTERVAL secs for $(( READSB_AUTOGAIN_INITIAL_TIMEPERIOD / 60 )) minutes to do an initial gain assessment." 44 | # run autogain every $READSB_AUTOGAIN_INITIAL_INTERVAL secs (default 5 mins) for $READSB_AUTOGAIN_INITIAL_TIMEPERIOD secs (default 2 hours) 45 | for (( i=0; i<$(( READSB_AUTOGAIN_INITIAL_TIMEPERIOD / READSB_AUTOGAIN_INITIAL_INTERVAL )); i++ )) 46 | do 47 | sleep "$READSB_AUTOGAIN_INITIAL_INTERVAL" & wait $! # sleep first to give readsb the opportunity to collect some initial data 48 | s6wrap --quiet --prepend=autogain --timestamps --args /usr/local/bin/autogain1090 49 | done 50 | touch "${autogain_dir}"/autogain_initialized 51 | fi 52 | 53 | s6wrap --quiet --prepend=autogain --timestamps --args echo "Autogain long-term maintenance started. We'll collect data and assess every $(( READSB_AUTOGAIN_SUBSEQUENT_INTERVAL / 60 )) minutes if gain needs to be adjusted." 54 | while true 55 | do 56 | [[ -f "${autogain_dir}/suspend" ]] && exec sleep 3600 57 | sleep "$READSB_AUTOGAIN_SUBSEQUENT_INTERVAL" & wait $! 58 | s6wrap --quiet --prepend=autogain --timestamps --args /usr/local/bin/autogain1090 59 | done 60 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/scripts/cleanup_globe_history: -------------------------------------------------------------------------------- 1 | #!/command/with-contenv bash 2 | # shellcheck shell=bash disable=SC2015,SC2016,SC1091,SC2001,SC2154 3 | 4 | #--------------------------------------------------------------------------------------------- 5 | # Script to remove Globe_History files older than xxx days - this to ensure that the disk 6 | # doesn't fill up with (unwanted) history files) 7 | 8 | # Copyright (C) 2023-2024, Ramon F. Kolb (kx1t) and contributors 9 | # Core script copyright and provided by Matthias Wirth (wiedehopf), used with permission 10 | # 11 | # This program is free software: you can redistribute it and/or modify it 12 | # under the terms of the GNU General Public License as published by the 13 | # Free Software Foundation, either version 3 of the License, or (at your option) 14 | # any later version. 15 | # 16 | # This program is distributed in the hope that it will be useful, but 17 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 18 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with this program. 21 | # If not, see . 22 | #--------------------------------------------------------------------------------------------- 23 | 24 | source /scripts/common 25 | 26 | if [[ -z "$MAX_GLOBE_HISTORY" ]]; then 27 | "${s6wrap[@]}" echo "MAX_GLOBE_HISTORY not set - we will not expire any globe_history files" 28 | stop_service 29 | fi 30 | 31 | cutoffepoch="$(date -d"-${MAX_GLOBE_HISTORY} days" +%s)" 32 | 33 | "${s6wrap[@]}" echo "Purging globe_history older than $MAX_GLOBE_HISTORY days (before $(date -d"-${MAX_GLOBE_HISTORY} days" +%d-%b-%Y))" 34 | 35 | find /var/globe_history -maxdepth 3 -mindepth 3 -type d | grep -o -E -e '[0-9]{4}/[0-9]{2}/[0-9]{2}$' | \ 36 | while read -r dir; do 37 | if (( $(date -d "$dir" +%s) < cutoffepoch )); then 38 | "${s6wrap[@]}" echo Removing "/var/globe_history/$dir" 39 | rm -rf "/var/globe_history/$dir" 40 | fi 41 | done 42 | 43 | # delete empty year / month directories 44 | # make sure the directories haven't been touched for 3 days so freshly created directories aren't removed 45 | # this will also delay deletion of empty parent directories by 3 days after their contents have been removed but that's fine 46 | find /var/globe_history/ -mindepth 1 -maxdepth 2 -type d -empty -mtime +3 -delete 47 | 48 | "${s6wrap[@]}" echo "Done - next purge will be in 24 hours" 49 | exec sleep 24h 50 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/scripts/collectd: -------------------------------------------------------------------------------- 1 | #!/command/with-contenv bash 2 | # shellcheck shell=bash disable=SC1091 3 | 4 | source /scripts/common 5 | 6 | # make sure /run/collectd exists 7 | mkdir -p /run/collectd 8 | 9 | 10 | if chk_enabled "${GRAPHS1090_DISABLE}" || chk_enabled "${TAR1090_DISABLE}"; then 11 | stop_service 12 | fi 13 | 14 | 15 | PERMFILE=/var/lib/collectd/rrd/localhost.tar.gz 16 | if chk_enabled "${GRAPHS1090_REDUCE_IO}"; then 17 | # readback rrd database from compressed archive 18 | if ! s6wrap --quiet --prepend=graphs1090-readback --timestamps --args bash /usr/share/graphs1090/readback.sh; then 19 | s6wrap --quiet --prepend=graphs1090-readback --timestamps --args echo "FATAL: readback returned an error" 20 | stop_service 21 | fi 22 | elif [[ -f "${PERMFILE}" ]] && ! [[ -d /var/lib/collectd/rrd/localhost ]]; then 23 | # extract rrd database from compressed archive (in case WAS enabled) 24 | if s6wrap --quiet --prepend=graphs1090-extract --timestamps --args bash /usr/share/graphs1090/gunzip.sh /var/lib/collectd/rrd/localhost; then 25 | mv -f "${PERMFILE}" "/var/lib/collectd/rrd/auto-backup-old-localhost-tarfile-$(date +%Y-week_%V).tar.gz" &>/dev/null || true 26 | rm -rf "${PERMFILE}" 27 | fi 28 | fi 29 | 30 | 31 | # test config? 32 | /usr/sbin/collectd -t -T -f -C /etc/collectd/collectd.conf > /dev/null 2>&1 33 | 34 | # wait for necessary input file to exist before starting 35 | 36 | loop_count=0 37 | # shellcheck disable=SC2016 38 | while [[ ! -e /usr/share/graphs1090/data-symlink/data/stats.json ]]; do 39 | if (( loop_count++ > 15 )); then echo "[collectd] Waiting for readsb to start..."; fi 40 | if (( loop_count > 30 )); then echo "[collectd] not waiting for readsb any longer"; break; fi 41 | sleep 1 42 | done 43 | 44 | # pkill -P $$ will only kill children of the script, not the script itself 45 | trap 'pkill -P $$' SIGTERM SIGINT SIGHUP SIGQUIT 46 | # for this scheme to work, the program is started in the background 47 | 48 | #shellcheck disable=SC2016 49 | s6wrap --quiet --prepend=collectd --timestamps --args /usr/sbin/collectd -C /etc/collectd/collectd.conf -f & 50 | 51 | # the first wait exits due to the signal which is trapped, the 2nd wait actually waits for collectd to exit 52 | wait || wait || true 53 | 54 | 55 | 56 | if chk_enabled "${GRAPHS1090_REDUCE_IO}"; then 57 | # writeback 58 | s6wrap --quiet --prepend=graphs1090-writeback --timestamps --args bash /usr/share/graphs1090/writeback.sh 59 | fi 60 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/scripts/graphs1090: -------------------------------------------------------------------------------- 1 | #!/command/with-contenv bash 2 | # shellcheck shell=bash disable=SC1091 3 | 4 | source /scripts/common 5 | 6 | 7 | if chk_enabled "${GRAPHS1090_DISABLE}" || chk_enabled "${TAR1090_DISABLE}"; then 8 | stop_service 9 | fi 10 | 11 | mkdir -p /run/graphs1090 12 | 13 | exec s6wrap --quiet --prepend=graphs1090 --timestamps --args bash /usr/share/graphs1090/service-graphs1090.sh 14 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/scripts/graphs1090-writeback: -------------------------------------------------------------------------------- 1 | #!/command/with-contenv bash 2 | # shellcheck shell=bash disable=SC1091 3 | 4 | source /scripts/common 5 | 6 | trap 'pkill -P $$ || true; exit 0' SIGTERM SIGINT SIGHUP SIGQUIT 7 | 8 | if chk_enabled "${GRAPHS1090_DISABLE}" || ! chk_enabled "${GRAPHS1090_REDUCE_IO}" || chk_enabled "${TAR1090_DISABLE}"; then 9 | stop_service 10 | fi 11 | 12 | sleep "${GRAPHS1090_REDUCE_IO_FLUSH_IVAL:-1d}" & wait $! 13 | 14 | s6wrap --quiet --prepend=graphs1090-writeback --timestamps --args pkill collectd 15 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/scripts/nginx: -------------------------------------------------------------------------------- 1 | #!/command/with-contenv bash 2 | # shellcheck shell=bash disable=SC1091 3 | 4 | source /scripts/common 5 | 6 | if [[ "$(find /etc/nginx/sites-enabled/ -type f | wc -l)" == "0" ]]; then 7 | stop_service 8 | fi 9 | 10 | 11 | mkdir -p /var/log/nginx 12 | 13 | exec s6wrap --quiet --prepend=nginx --timestamps --args /usr/sbin/nginx 14 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/scripts/readsb: -------------------------------------------------------------------------------- 1 | #!/command/with-contenv bash 2 | # shellcheck shell=bash disable=SC1091,SC2076 3 | 4 | source /scripts/common 5 | mkdir -p /run/readsb 6 | 7 | s6wrap=(s6wrap --quiet --prepend="$(basename "$0")" --timestamps --args) 8 | 9 | # Build the readsb command line based on options 10 | READSB_BIN="/usr/local/bin/readsb" 11 | 12 | READSB_CMD=("--net") 13 | READSB_CMD+=("--quiet") 14 | 15 | if [ -n "${READSB_NET_ONLY}" ]; then 16 | READSB_CMD+=("--net-only") 17 | fi 18 | 19 | if [ -n "${LAT}" ]; then 20 | READSB_CMD+=(--lat "${LAT}") 21 | elif [ -n "${READSB_LAT}" ]; then 22 | READSB_CMD+=(--lat "${READSB_LAT}") 23 | fi 24 | 25 | if [ -n "${LONG}" ]; then 26 | READSB_CMD+=(--lon "${LONG}") 27 | elif [ -n "${READSB_LON}" ]; then 28 | READSB_CMD+=(--lon "${READSB_LON}") 29 | fi 30 | 31 | if [ -n "${MLATHOST}" ]; then 32 | READSB_CMD+=("--net-connector=${MLATHOST},${MLATPORT},beast_in") 33 | fi 34 | 35 | if [ -n "${BEASTHOST}" ]; then 36 | READSB_CMD+=("--net-connector=${BEASTHOST},${BEASTPORT},beast_in") 37 | fi 38 | 39 | if [ -n "${UUID}" ]; then 40 | READSB_CMD+=("--uuid-file=/run/uuid") 41 | fi 42 | 43 | READSB_CMD+=("--write-json=/run/readsb") 44 | # no need to write state when tar1090_disable is used for a minimal setup 45 | if ! chk_enabled "${TAR1090_DISABLE}"; then 46 | READSB_CMD+=("--write-state=/var/globe_history") 47 | fi 48 | READSB_CMD+=("--json-reliable=1") 49 | 50 | READSB_CMD+=("--net-ri-port=30001") 51 | READSB_CMD+=("--net-ro-port=30002") 52 | READSB_CMD+=("--net-sbs-port=30003") 53 | READSB_CMD+=("--net-bi-port=30004,30104") 54 | READSB_CMD+=("--net-bo-port=30005") 55 | READSB_CMD+=("--net-beast-reduce-out-port=30006") 56 | READSB_CMD+=("--net-json-port=30047") 57 | 58 | # READSB_CMD+=(--forward-mlat) 59 | READSB_CMD+=(--net-sbs-in-port=32006) 60 | 61 | if ! chk_disabled "${READSB_ENABLE_HEATMAP}"; then 62 | if chk_enabled "${READSB_ENABLE_HEATMAP}" || ! chk_enabled "${TAR1090_DISABLE}"; then 63 | READSB_CMD+=("--heatmap-dir=/var/globe_history") 64 | READSB_CMD+=("--heatmap=${READSB_HEATMAP_INTERVAL:-15}") 65 | fi 66 | fi 67 | 68 | if chk_enabled "${READSB_ENABLE_TRACES}"; then 69 | READSB_CMD+=("--write-globe-history=/var/globe_history") 70 | fi 71 | 72 | 73 | if chk_enabled "${READSB_FORWARD_MLAT}"; then 74 | "${s6wrap[@]}" echo "WARNING -- READSB_FORWARD_MLAT has been set! Do not feed the output of this container to any aggregators!" 75 | READSB_CMD+=("--forward-mlat") 76 | fi 77 | 78 | if chk_enabled "${READSB_FORWARD_MLAT_SBS}"; then 79 | "${s6wrap[@]}" echo "WARNING -- READSB_FORWARD_MLAT_SBS has been set! Do not feed the SBS (BaseStation) output of this container to any aggregators!" 80 | READSB_CMD+=("--forward-mlat-sbs") 81 | elif chk_enabled "${READSB_FORWARD_MLAT}"; then 82 | "${s6wrap[@]}" echo "WARNING -- READSB_FORWARD_MLAT_SBS has been set! Do not feed the SBS (BaseStation) output of this container to any aggregators!" 83 | READSB_CMD+=("--forward-mlat-sbs") 84 | fi 85 | 86 | if [[ -n "$READSB_RX_LOCATION_ACCURACY" ]]; then 87 | READSB_CMD+=("--json-location-accuracy=$READSB_RX_LOCATION_ACCURACY") 88 | fi 89 | 90 | if [[ -n "$READSB_JSON_INTERVAL" ]]; then 91 | READSB_CMD+=("--write-json-every=$READSB_JSON_INTERVAL") 92 | fi 93 | 94 | if [ -n "${READSB_DEBUG}" ]; then 95 | READSB_CMD+=("--debug=$READSB_DEBUG") 96 | fi 97 | 98 | # Handle --write-state-only-on-exit 99 | if chk_enabled "${READSB_WRITE_STATE_ONLY_ON_EXIT}"; then 100 | READSB_CMD+=("--write-state-only-on-exit") 101 | fi 102 | 103 | # Handle "--max-range=" 104 | if [[ -n "$READSB_MAX_RANGE" ]]; then 105 | READSB_CMD+=("--max-range=$READSB_MAX_RANGE") 106 | fi 107 | 108 | # Handle "--mlat" 109 | #shellcheck disable=SC2153 110 | if chk_enabled "$READSB_MLAT"; then 111 | READSB_CMD+=("--mlat") 112 | fi 113 | 114 | # Handle "--modeac" 115 | if chk_enabled "$READSB_MODEAC"; then 116 | READSB_CMD+=("--modeac") 117 | fi 118 | 119 | # Handle "--stats-every=" 120 | if [[ -n "$READSB_STATS_EVERY" ]]; then 121 | READSB_CMD+=("--stats-every=$READSB_STATS_EVERY") 122 | fi 123 | 124 | # Handle "--stats-range" 125 | if chk_enabled "$READSB_STATS_RANGE"; then 126 | READSB_CMD+=("--stats-range") 127 | fi 128 | 129 | if [[ -n "$READSB_RANGE_OUTLINE_HOURS" ]]; then 130 | READSB_CMD+=("--range-outline-hours=$READSB_RANGE_OUTLINE_HOURS") 131 | fi 132 | 133 | 134 | ##### NETWORK OPTIONS ##### 135 | # 136 | if [[ -n "$READSB_NET_API_PORT" ]]; then 137 | READSB_CMD+=("--net-api-port=$READSB_NET_API_PORT") 138 | else 139 | READSB_CMD+=("--net-api-port=30152") 140 | fi 141 | 142 | 143 | if chk_enabled "${READSB_ENABLE_API}"; then 144 | READSB_CMD+=("--net-api-port=unix:/run/readsb/api.sock") 145 | fi 146 | 147 | # Handle "--net-beast-reduce-interval=" 148 | # Set it to 1.0 second if no value is provided 149 | READSB_CMD+=("--net-beast-reduce-interval=${READSB_NET_BEAST_REDUCE_INTERVAL:-1.0}") 150 | 151 | # Handle "--net-beast-reduce-out-port=" 152 | if [[ -n "$READSB_NET_BEAST_REDUCE_OUT_PORT" ]]; then 153 | READSB_CMD+=("--net-beast-reduce-out-port=$READSB_NET_BEAST_REDUCE_OUT_PORT") 154 | fi 155 | 156 | if chk_enabled "$READSB_NET_SBS_REDUCE"; then 157 | READSB_CMD+=("--net-sbs-reduce") 158 | fi 159 | 160 | if [[ -n "$READSB_NET_BEAST_REDUCE_FILTER_DIST" ]]; then 161 | READSB_CMD+=("--net-beast-reduce-filter-dist=$READSB_NET_BEAST_REDUCE_FILTER_DIST") 162 | fi 163 | 164 | READSB_CMD+=("--json-trace-interval=${READSB_JSON_TRACE_INTERVAL:-15}") 165 | 166 | if [[ -n "$READSB_NET_BEAST_REDUCE_FILTER_ALT" ]]; then 167 | READSB_CMD+=("--net-beast-reduce-filter-alt=$READSB_NET_BEAST_REDUCE_FILTER_ALT") 168 | fi 169 | 170 | # Handle "--net-bi-port=" 171 | if [[ -n "$READSB_NET_BEAST_INPUT_PORT" ]]; then 172 | READSB_CMD+=("--net-bi-port=$READSB_NET_BEAST_INPUT_PORT") 173 | fi 174 | 175 | # Handle "--net-bo-port=" 176 | if [[ -n "$READSB_NET_BEAST_OUTPUT_PORT" ]]; then 177 | READSB_CMD+=("--net-bo-port=$READSB_NET_BEAST_OUTPUT_PORT") 178 | fi 179 | 180 | # Handle "--net-buffer=" 181 | if [[ -n "$READSB_NET_BUFFER" ]]; then 182 | READSB_CMD+=("--net-buffer=$READSB_NET_BUFFER") 183 | fi 184 | 185 | # Handle "--net-connector=" 186 | if [[ -n "$READSB_NET_CONNECTOR" ]]; then 187 | IFS=';' read -r -a READSB_NET_CONNECTOR_ARRAY <<< "$READSB_NET_CONNECTOR" 188 | for NET_CONNECTOR_ELEMENT in "${READSB_NET_CONNECTOR_ARRAY[@]}" 189 | do 190 | READSB_CMD+=("--net-connector=${NET_CONNECTOR_ELEMENT// /}") 191 | done 192 | fi 193 | 194 | # Handle "--net-connector-delay=" 195 | if [[ -n "$READSB_NET_CONNECTOR_DELAY" ]]; then 196 | READSB_CMD+=("--net-connector-delay=$READSB_NET_CONNECTOR_DELAY") 197 | fi 198 | 199 | # Handle "--net-heartbeat=" 200 | if [[ -n "$READSB_NET_HEARTBEAT" ]]; then 201 | READSB_CMD+=("--net-heartbeat=$READSB_NET_HEARTBEAT") 202 | fi 203 | 204 | # Handle "--net-ri-port=" 205 | if [[ -n "$READSB_NET_RAW_INPUT_PORT" ]]; then 206 | READSB_CMD+=("--net-ri-port=$READSB_NET_RAW_INPUT_PORT") 207 | fi 208 | 209 | # Handle "--net-ro-interval=" 210 | if [[ -n "$READSB_NET_RAW_OUTPUT_INTERVAL" ]]; then 211 | READSB_CMD+=("--net-ro-interval=$READSB_NET_RAW_OUTPUT_INTERVAL") 212 | fi 213 | 214 | # Handle "--net-ri-port=" 215 | if [[ -n "$READSB_NET_RAW_OUTPUT_PORT" ]]; then 216 | READSB_CMD+=("--net-ro-port=$READSB_NET_RAW_OUTPUT_PORT") 217 | fi 218 | 219 | # Handle "--net-ro-size=" 220 | if [[ -n "$READSB_NET_RAW_OUTPUT_SIZE" ]]; then 221 | READSB_CMD+=("--net-ro-size=$READSB_NET_RAW_OUTPUT_SIZE") 222 | fi 223 | 224 | # Handle "--net-sbs-in-port=" 225 | if [[ -n "$READSB_NET_SBS_INPUT_PORT" ]]; then 226 | READSB_CMD+=("--net-sbs-in-port=$READSB_NET_SBS_INPUT_PORT") 227 | fi 228 | 229 | # Handle "--net-sbs-port=" 230 | if [[ -n "$READSB_NET_SBS_OUTPUT_PORT" ]]; then 231 | READSB_CMD+=("--net-sbs-port=$READSB_NET_SBS_OUTPUT_PORT") 232 | fi 233 | 234 | # Handle "--net-verbatim" 235 | if chk_enabled "$READSB_NET_VERBATIM"; then 236 | READSB_CMD+=("--net-verbatim") 237 | fi 238 | 239 | # Handle "--net-vrs-port=" 240 | if [[ -n "$READSB_NET_VRS_PORT" ]]; then 241 | READSB_CMD+=("--net-vrs-port=$READSB_NET_VRS_PORT") 242 | fi 243 | 244 | if chk_enabled "$TAR1090_ENABLE_AC_DB"; then 245 | READSB_CMD+=("--db-file=$TAR1090_INSTALL_DIR/aircraft.csv.gz") 246 | fi 247 | 248 | # Handle "--device-type" 249 | if [[ -n "$READSB_DEVICE_TYPE" ]]; then 250 | READSB_CMD+=("--device-type=$READSB_DEVICE_TYPE") 251 | fi 252 | 253 | # Handle "--gain" 254 | if [[ -n "$READSB_GAIN" ]]; then 255 | if [[ "${READSB_GAIN,,}" == "autogain" ]] && [[ -f /var/globe_history/autogain/gain ]]; then 256 | read -r gain < /var/globe_history/autogain/gain 257 | READSB_CMD+=("--gain=$gain") 258 | elif [[ -n "$READSB_GAIN" ]]; then 259 | [[ "${READSB_GAIN,,}" == "autogain" ]] && gain="${READSB_AUTOGAIN_INITIAL_GAIN:-49.6}" || gain="${READSB_GAIN}" 260 | READSB_CMD+=("--gain=$gain") 261 | fi 262 | fi 263 | 264 | ##### RTL-SDR OPTIONS ##### 265 | 266 | # Handle "--device=" 267 | if [[ -n "$READSB_RTLSDR_DEVICE" ]]; then 268 | READSB_CMD+=("--device=$READSB_RTLSDR_DEVICE") 269 | fi 270 | 271 | # Handle "--enable-agc" 272 | if chk_enabled "$READSB_RTLSDR_ENABLE_AGC"; then 273 | READSB_CMD+=("--enable-agc") 274 | fi 275 | 276 | # Handle "--ppm=" 277 | if [[ -n "$READSB_RTLSDR_PPM" ]]; then 278 | READSB_CMD+=("--ppm=$READSB_RTLSDR_PPM") 279 | fi 280 | 281 | ##### MODE-S BEAST OPTIONS ##### 282 | 283 | # Handle "--beast-crc-off" 284 | if chk_enabled "$READSB_BEAST_CRC_OFF"; then 285 | READSB_CMD+=("--beast-crc-off") 286 | fi 287 | 288 | # Handle "--beast-df045-on" 289 | if chk_enabled "$READSB_BEAST_DF045_ON"; then 290 | READSB_CMD+=("--beast-df045-on") 291 | fi 292 | 293 | # Handle "--beast-df1117-on" 294 | if chk_enabled "$READSB_BEAST_DF1117_ON"; then 295 | READSB_CMD+=("--beast-df1117-on") 296 | fi 297 | 298 | # Handle "--beast-fec-off" 299 | if chk_enabled "$READSB_BEAST_FEC_OFF"; then 300 | READSB_CMD+=("--beast-fec-off") 301 | fi 302 | 303 | # Handle "--beast-mlat-off" 304 | if chk_enabled "$READSB_BEAST_MLAT_OFF"; then 305 | READSB_CMD+=("--beast-mlat-off") 306 | fi 307 | 308 | # Handle "--beast-modeac" 309 | if chk_enabled "$READSB_BEAST_MODEAC"; then 310 | READSB_CMD+=("--beast-modeac") 311 | fi 312 | 313 | # Handle "--beast-serial=" 314 | if [[ -n "$READSB_BEAST_SERIAL" ]]; then 315 | READSB_CMD+=("--beast-serial=$READSB_BEAST_SERIAL") 316 | fi 317 | 318 | if [[ -n "$READSB_BEAST_BAUDRATE" ]]; then 319 | READSB_CMD+=("--beast-baudrate=$READSB_BEAST_BAUDRATE") 320 | fi 321 | 322 | ##################### 323 | # Handle --write-prom= 324 | 325 | if chk_enabled "$PROMETHEUS_ENABLE"; then 326 | READSB_CMD+=("--write-prom=/run/readsb-prometheus.prom") 327 | fi 328 | 329 | # shellcheck disable=SC2086 330 | exec "${s6wrap[@]}" "${READSB_BIN}" "${READSB_CMD[@]}" $READSB_EXTRA_ARGS 331 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/scripts/startup: -------------------------------------------------------------------------------- 1 | #!/command/with-contenv bash 2 | # shellcheck shell=bash disable=SC1091,SC2076 3 | 4 | source /scripts/common 5 | 6 | SDIR=/etc/s6-overlay/startup.d 7 | 8 | # exit 0 for nonexistent or empty directory 9 | if ! [[ -d "$SDIR" ]] || [[ -z "$(ls "$SDIR")" ]]; then 10 | exit 0 11 | fi 12 | 13 | cd "$SDIR" || exit 1 14 | 15 | for NAME in *; do 16 | if ! s6wrap --quiet --prepend="$NAME" --timestamps --args "$SDIR/$NAME"; then 17 | s6wrap --quiet --prepend=startup --timestamps --args echo Error running "$SDIR/$NAME" 18 | exit 1 19 | fi 20 | done 21 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/scripts/startup-finish: -------------------------------------------------------------------------------- 1 | #!/command/with-contenv bash 2 | # shellcheck shell=bash disable=SC1091,SC2076 3 | 4 | source /scripts/common 5 | 6 | SDIR=/etc/s6-overlay/finish.d 7 | 8 | # exit 0 for nonexistent or empty directory 9 | if ! [[ -d "$SDIR" ]] || [[ -z "$(ls "$SDIR")" ]]; then 10 | exit 0 11 | fi 12 | 13 | cd "$SDIR" || exit 1 14 | 15 | for NAME in *; do 16 | if ! s6wrap --quiet --prepend="$NAME" --timestamps --args "$SDIR/$NAME"; then 17 | s6wrap --quiet --prepend=startup --timestamps --args echo Error running "$SDIR/$NAME" 18 | exit 1 19 | fi 20 | done 21 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/scripts/tar1090: -------------------------------------------------------------------------------- 1 | #!/command/with-contenv bash 2 | # shellcheck shell=bash disable=SC1091 3 | 4 | source /scripts/common 5 | 6 | if chk_enabled "${TAR1090_DISABLE}" || chk_enabled "${TAR1090_HISTORY_DISABLE}"; then 7 | stop_service 8 | fi 9 | 10 | rundir="/run/tar1090" 11 | mkdir -p "$rundir" 12 | sleep 5 13 | 14 | # shellcheck source=/dev/null 15 | #source "${TAR1090_INSTALL_DIR}/default" 16 | 17 | srcdir=/run/readsb 18 | 19 | exec s6wrap --quiet --prepend=tar1090 --timestamps --args bash /usr/local/share/tar1090/tar1090.sh \ 20 | "$rundir" \ 21 | "$srcdir" 22 | 23 | # "$INTERVAL" \ 24 | # "$HISTORY_SIZE" \ 25 | # "$CHUNK_SIZE" \ 26 | # "$ENABLE_978" \ 27 | # "$URL_978" \ 28 | # "$INT_978" \ 29 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/scripts/tar1090-update: -------------------------------------------------------------------------------- 1 | #!/command/with-contenv bash 2 | # shellcheck shell=bash disable=SC1091,SC2154 3 | 4 | source /scripts/common 5 | 6 | if ! chk_enabled "${UPDATE_TAR1090}" || chk_enabled "${TAR1090_DISABLE}"; then 7 | stop_service 8 | fi 9 | 10 | # aircraft-db 11 | 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 12 | if ! diff -q "${TAR1090_UPDATE_DIR}/aircraft.csv.gz.version" "/run/aircraft.csv.gz.version.new" &>/dev/null; then 13 | "${s6wrap[@]}" echo "Downloading https://raw.githubusercontent.com/wiedehopf/tar1090-db/csv/aircraft.csv.gz" 14 | if "${s6wrap[@]}" curl --connect-timeout 10 --silent --show-error -o "${TAR1090_UPDATE_DIR}/aircraft.csv.gz.tmp" \ 15 | "https://raw.githubusercontent.com/wiedehopf/tar1090-db/csv/aircraft.csv.gz"; then 16 | "${s6wrap[@]}" mv -f "${TAR1090_UPDATE_DIR}/aircraft.csv.gz.tmp" "${TAR1090_UPDATE_DIR}/aircraft.csv.gz" 17 | "${s6wrap[@]}" mv -f "/run/aircraft.csv.gz.version.new" "${TAR1090_UPDATE_DIR}/aircraft.csv.gz.version" 18 | fi 19 | fi 20 | fi 21 | if [[ -f "${TAR1090_UPDATE_DIR}/aircraft.csv.gz" ]]; then 22 | ln -sf "${TAR1090_UPDATE_DIR}/aircraft.csv.gz" "$TAR1090_INSTALL_DIR/aircraft.csv.gz" 23 | fi 24 | 25 | if ! chk_enabled "${CUSTOM_HTML}"; then 26 | OVERRIDE_GIT_SOURCE="/var/tar1090_git_source" 27 | 28 | if [[ -d "${OVERRIDE_GIT_SOURCE}/html" ]]; then 29 | "${s6wrap[@]}" echo "USING LOCALLY MODIFIED TAR1090 from ${OVERRIDE_GIT_SOURCE}" 30 | "${s6wrap[@]}" bash /tar1090-install.sh /run/readsb webroot "${TAR1090_INSTALL_DIR}" "${OVERRIDE_GIT_SOURCE}" 31 | TAR1090_VERSION="$(cat "${OVERRIDE_GIT_SOURCE}/version") LOCALLY MODIFIED" 32 | else 33 | "${s6wrap[@]}" bash /tar1090-install.sh /run/readsb webroot "${TAR1090_INSTALL_DIR}" 34 | TAR1090_VERSION=$(cat "${TAR1090_UPDATE_DIR}/git/version") 35 | fi 36 | 37 | # Print tar1090 version 38 | TAR1090_DB_VERSION=$(cat "${TAR1090_UPDATE_DIR}/git-db/version") 39 | "${s6wrap[@]}" echo "tar1090 version: ${TAR1090_VERSION} tar1090-db version: ${TAR1090_DB_VERSION}" 40 | export TAR1090_VERSION 41 | 42 | # call the necessary scripts to configure the newly created tar1090 html folder 43 | # they were already run on container startup but there is no harm in running them again 44 | "${s6wrap[@]}" bash /etc/s6-overlay/startup.d/04-tar1090-configure 45 | "${s6wrap[@]}" bash /etc/s6-overlay/startup.d/06-range-outline 46 | fi 47 | 48 | if (( UPDATE_TAR1090_DAYS == 0 )); then 49 | stop_service 50 | fi 51 | 52 | exec sleep $(( UPDATE_TAR1090_DAYS * 86400 )) 53 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/scripts/telegraf: -------------------------------------------------------------------------------- 1 | #!/command/with-contenv bash 2 | # shellcheck shell=bash disable=SC1091 3 | 4 | source /scripts/common 5 | 6 | trap 'pkill -P $$ || true; exit 0' SIGTERM SIGINT SIGHUP SIGQUIT 7 | 8 | # Start telegraf if required 9 | if [[ -n "$INFLUXDBV2_URL" ]] || chk_enabled "${PROMETHEUS_ENABLE}"; then 10 | if [[ ! -f /usr/bin/telegraf ]]; then 11 | s6wrap --quiet --prepend=telegraf --timestamps --args echo "WARNING: InfluxDB/Prometheus parameters are set but Telegraf not included in this container" 12 | stop_service 13 | fi 14 | # give other services time to stabilise 15 | sleep 5 & wait $! 16 | # make sure that at least /run/readsb/stats.json is available before we start: 17 | while [[ ! -f /run/readsb/stats.json ]]; do 18 | sleep 5 & wait $! 19 | done 20 | # start telegraf 21 | # ATTN: next line is temporary until @ngen15 resolves issues with the "ground" parameter in telegraf. 22 | # once resolved, we can revert to the original line, which was: 23 | # s6wrap --quiet --prepend=telegraf --timestamps --args telegraf --config-directory /etc/telegraf/telegraf.d 24 | s6wrap --quiet --prepend=telegraf --timestamps --args telegraf --config-directory /etc/telegraf/telegraf.d | grep -v "error converting to float" 25 | else 26 | # if telegraf not needed, sleep forever 27 | stop_service 28 | fi 29 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/scripts/timelapse1090: -------------------------------------------------------------------------------- 1 | #!/command/with-contenv bash 2 | # shellcheck shell=bash disable=SC1091 3 | 4 | source /scripts/common 5 | 6 | trap 'pkill -P $$ || true; exit 0' SIGTERM SIGINT SIGHUP SIGQUIT 7 | 8 | if chk_enabled "$ENABLE_TIMELAPSE1090" && ! chk_enabled "${TAR1090_DISABLE}"; then 9 | # Move timelapse1090 out of /run, and symlink back to /run 10 | mkdir -p /var/timelapse1090 11 | ln -s /var/timelapse1090 /run/timelapse1090 >/dev/null 2>&1 || true 12 | 13 | { 14 | echo "SOURCE=${TIMELAPSE1090_SOURCE}" 15 | echo "INTERVAL=${TIMELAPSE1090_INTERVAL}" 16 | echo "HISTORY=${TIMELAPSE1090_HISTORY}" 17 | echo "CHUNK_SIZE=${TIMELAPSE1090_CHUNK_SIZE}" 18 | } > /etc/default/timelapse1090 19 | 20 | pushd /opt/timelapse1090 >/dev/null || exit 1 21 | while [[ ! -e /run/readsb/receiver.json ]]; do 22 | sleep 10 & wait $! 23 | done 24 | 25 | s6wrap --quiet --prepend=timelapse1090 --timestamps --args /opt/timelapse1090/timelapse1090.sh & 26 | wait $! 27 | popd || exit 1 28 | 29 | sleep 30 & wait $! 30 | else 31 | stop_service 32 | fi 33 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/startup.d/01-sanity-check: -------------------------------------------------------------------------------- 1 | #!/command/with-contenv bash 2 | # shellcheck shell=bash disable=SC1091 3 | 4 | source /scripts/common 5 | 6 | # Define colours 7 | YELLOW='\033[1;33m' 8 | #LIGHTRED='\033[1;31m' 9 | NOCOLOR='\033[0m' 10 | 11 | # Check to make sure the correct command line arguments have been set 12 | EXITCODE=0 13 | if [ -z "${BEASTHOST}" ] && [ -z "${MLATHOST}" ] && [ -z "${READSB_DEVICE_TYPE}" ] && [ -z "${READSB_NET_CONNECTOR}" ] \ 14 | && ! grep -qs -e 'adsb[^;]*_in' <<< "${ULTRAFEEDER_CONFIG}${ULTRAFEEDER_NET_CONNECTOR}"; then 15 | echo -e "${YELLOW}WARNING: No obvious data input configured: BEASTHOST / MLATHOST / READSB_NET_CONNECTOR / READSB_DEVICE_TYPE environment variables not set${NOCOLOR}" 16 | fi 17 | if [ -z "${LAT}" ] && [ -z "${READSB_LAT}" ]; then 18 | echo -e "${YELLOW}WARNING: LAT / READSB_LAT environment variable not set, Home location will not be accurate${NOCOLOR}" 19 | fi 20 | if [ -z "${LONG}" ] && [ -z "${READSB_LON}" ]; then 21 | echo -e "${YELLOW}WARNING: LONG / READSB_LON environment variable not set, Home location will not be accurate${NOCOLOR}" 22 | fi 23 | if [ $EXITCODE -ne 0 ]; then 24 | exit 1 25 | fi 26 | 27 | # Set up timezone 28 | if [ -z "${TZ}" ]; then 29 | echo -e "${YELLOW}WARNING: TZ environment variable not set${NOCOLOR}" 30 | else 31 | ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime && echo "$TZ" >/etc/timezone 32 | fi 33 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/startup.d/04-tar1090-configure: -------------------------------------------------------------------------------- 1 | #!/command/with-contenv bash 2 | # shellcheck shell=bash disable=SC1091 3 | 4 | source /scripts/common 5 | 6 | 7 | if chk_enabled "${TAR1090_DISABLE}"; then 8 | exit 0 9 | fi 10 | 11 | if ! chk_enabled "${GRAPHS1090_DISABLE}"; then 12 | # add a link to graphs1090 to the tar1090 web page: 13 | TAR1090_INDEX_HTML="/usr/local/share/tar1090/html-webroot/index.html" 14 | if ! grep -qs -e 'Stats available History: n/a positions\)|\1\2\n\1\n\1Stats available here|g' "$TAR1090_INDEX_HTML" 16 | fi 17 | fi 18 | 19 | 20 | # Wipe and configure tar1090 config.js. 21 | 22 | rm -f "${TAR1090_INSTALL_DIR}/html-webroot/config.js" 23 | cp "${TAR1090_INSTALL_DIR}/example_config.js" "${TAR1090_INSTALL_DIR}/html-webroot/config.js" 24 | 25 | { 26 | 27 | echo "" 28 | echo "" 29 | echo "// The following configuration directives produced via '$0':" 30 | echo "" 31 | 32 | if [[ -n "$TAR1090_PLANECOUNTINTITLE" ]]; then 33 | echo "PlaneCountInTitle = ${TAR1090_PLANECOUNTINTITLE};" 34 | fi 35 | 36 | if [[ -n "$TAR1090_MESSAGERATEINTITLE" ]]; then 37 | echo "MessageRateInTitle = ${TAR1090_MESSAGERATEINTITLE};" 38 | fi 39 | 40 | if [[ -n "$TAR1090_DISPLAYUNITS" ]]; then 41 | echo "DisplayUnits = \"${TAR1090_DISPLAYUNITS}\";" 42 | fi 43 | 44 | if [[ -n "$TAR1090_DEFAULTCENTERLAT" ]]; then 45 | echo "DefaultCenterLat = ${TAR1090_DEFAULTCENTERLAT};" 46 | fi 47 | 48 | if [[ -n "$TAR1090_DEFAULTCENTERLON" ]]; then 49 | echo "DefaultCenterLon = ${TAR1090_DEFAULTCENTERLON};" 50 | fi 51 | 52 | if [[ -n "$TAR1090_DEFAULTZOOMLVL" ]]; then 53 | echo "DefaultZoomLvl = ${TAR1090_DEFAULTZOOMLVL};" 54 | fi 55 | 56 | if [[ -n "$TAR1090_SITESHOW" ]]; then 57 | echo "SiteShow = ${TAR1090_SITESHOW};" 58 | fi 59 | 60 | if [[ -n "$TAR1090_SITELAT" ]]; then 61 | echo "SiteLat = ${TAR1090_SITELAT};" 62 | fi 63 | 64 | if [[ -n "$TAR1090_SITELON" ]]; then 65 | echo "SiteLon = ${TAR1090_SITELON};" 66 | fi 67 | 68 | if [[ -n "$TAR1090_SITENAME" ]]; then 69 | echo "SiteName = \"${TAR1090_SITENAME}\";" 70 | fi 71 | 72 | if chk_disabled "${TAR1090_ENABLE_ACTUALRANGE}"; then 73 | echo "actual_range_show = false;" 74 | fi 75 | 76 | if [[ -n "$TAR1090_RANGE_OUTLINE_COLOR" ]]; then 77 | echo "range_outline_color = '${TAR1090_RANGE_OUTLINE_COLOR}';" 78 | fi 79 | 80 | if [[ -n "$TAR1090_RANGE_OUTLINE_WIDTH" ]]; then 81 | echo "range_outline_width = ${TAR1090_RANGE_OUTLINE_WIDTH};" 82 | fi 83 | 84 | if [[ -n "$TAR1090_RANGE_OUTLINE_COLORED_BY_ALTITUDE" ]]; then 85 | echo "range_outline_colored_by_altitude = ${TAR1090_RANGE_OUTLINE_COLORED_BY_ALTITUDE};" 86 | fi 87 | 88 | if [[ -n "$TAR1090_RANGE_OUTLINE_DASH" ]]; then 89 | echo "range_outline_dash = ${TAR1090_RANGE_OUTLINE_DASH};" 90 | fi 91 | 92 | if [[ -n "$TAR1090_ACTUAL_RANGE_OUTLINE_COLOR" ]]; then 93 | echo "actual_range_outline_color = '${TAR1090_ACTUAL_RANGE_OUTLINE_COLOR}';" 94 | fi 95 | 96 | if [[ -n "$TAR1090_ACTUAL_RANGE_OUTLINE_WIDTH" ]]; then 97 | echo "actual_range_outline_width = ${TAR1090_ACTUAL_RANGE_OUTLINE_WIDTH};" 98 | fi 99 | 100 | if [[ -n "$TAR1090_ACTUAL_RANGE_OUTLINE_DASH" ]]; then 101 | echo "actual_range_outline_dash = ${TAR1090_ACTUAL_RANGE_OUTLINE_DASH};" 102 | fi 103 | 104 | if [[ -n "$TAR1090_MAPTYPE_TAR1090" ]]; then 105 | echo "MapType_tar1090 = \"${TAR1090_MAPTYPE_TAR1090}\";" 106 | fi 107 | 108 | if [[ -n "$TAR1090_MAPDIM" ]]; then 109 | echo "MapDim = ${TAR1090_MAPDIM};" 110 | fi 111 | 112 | if [[ -n "$TAR1090_MAPDIMPERCENTAGE" ]]; then 113 | echo "mapDimPercentage = ${TAR1090_MAPDIMPERCENTAGE};" 114 | fi 115 | 116 | if [[ -n "$TAR1090_MAPCONTRASTPERCENTAGE" ]]; then 117 | echo "mapContrastPercentage = ${TAR1090_MAPCONTRASTPERCENTAGE};" 118 | fi 119 | 120 | if [[ -n "$TAR1090_RANGERINGS" ]]; then 121 | echo "SiteCircles = ${TAR1090_RANGERINGS};" 122 | fi 123 | 124 | if [[ -n "$TAR1090_RANGERINGSDISTANCES" ]]; then 125 | echo "SiteCirclesDistances = new Array($TAR1090_RANGERINGSDISTANCES);" 126 | fi 127 | 128 | if [[ -n "$TAR1090_BINGMAPSAPIKEY" ]]; then 129 | echo "BingMapsAPIKey = \"$TAR1090_BINGMAPSAPIKEY\";" 130 | fi 131 | 132 | if chk_enabled "$TAR1090_FLIGHTAWARELINKS"; then 133 | echo "flightawareLinks = true;" 134 | fi 135 | 136 | if [[ -n "$TAR1090_IMAGE_CONFIG_LINK" ]]; then 137 | echo "imageConfigLink = ${TAR1090_IMAGE_CONFIG_LINK};" 138 | fi 139 | 140 | if [[ -n "$TAR1090_IMAGE_CONFIG_TEXT" ]]; then 141 | echo "imageConfigText = ${TAR1090_IMAGE_CONFIG_TEXT};" 142 | fi 143 | 144 | if [[ -n "$TAR1090_RANGERINGSCOLORS" ]]; then 145 | echo "SiteCirclesColors = new Array($TAR1090_RANGERINGSCOLORS);" 146 | fi 147 | 148 | if [[ -n "$TAR1090_PAGETITLE" ]]; then 149 | echo "PageName = \"$TAR1090_PAGETITLE\";" 150 | fi 151 | 152 | if [[ -n "$TAR1090_DWDLAYERS" ]]; then 153 | echo "dwdLayers = \"$TAR1090_DWDLAYERS\";" 154 | fi 155 | 156 | if [[ -n "$TAR1090_LABELZOOM" ]]; then 157 | echo "labelZoom = \"$TAR1090_LABELZOOM\";" 158 | fi 159 | 160 | if [[ -n "$TAR1090_LABELZOOMGROUND" ]]; then 161 | echo "labelZoomGround = \"$TAR1090_LABELZOOMGROUND\";" 162 | fi 163 | 164 | if chk_enabled "$TAR1090_USEROUTEAPI"; then 165 | echo "useRouteAPI = true;" 166 | fi 167 | 168 | if [[ -n "$TAR1090_ROUTEAPIURL" ]]; then 169 | echo "routeApiUrl = ${TAR1090_ROUTEAPIURL};" 170 | fi 171 | 172 | if [[ -n "$TAR1090_AISCATCHER_SERVER" ]]; then 173 | # remove /geojson suffix if present 174 | echo "aiscatcher_server = \" ${TAR1090_AISCATCHER_SERVER//\/geojson/}\";" 175 | echo "aiscatcher_refresh = ${TAR1090_AISCATCHER_REFRESH:-15};" 176 | fi 177 | 178 | if [[ -n "$TAR1090_CONFIGJS_APPEND" ]]; then 179 | echo "$TAR1090_CONFIGJS_APPEND" 180 | fi 181 | 182 | } >> "${TAR1090_INSTALL_DIR}/html-webroot/config.js" 183 | 184 | # https://github.com/wiedehopf/adsb-wiki/wiki/offline-map-tiles-tar1090 185 | # volumes: 186 | # - /usr/local/share/osm_tiles_offline:/usr/local/share/osm_tiles_offline 187 | # in case offlinemaps is used, configure via config.js 188 | MAX_OFFLINE="" 189 | for i in {0..15}; do 190 | if [[ -d /usr/local/share/osm_tiles_offline/$i ]]; then 191 | MAX_OFFLINE=$i 192 | fi 193 | done 194 | if [[ -n "$MAX_OFFLINE" ]]; then 195 | echo "offlineMapDetail=$MAX_OFFLINE;" >> "${TAR1090_INSTALL_DIR}/html-webroot/config.js" 196 | fi 197 | 198 | if chk_enabled "$TAR1090_LABEL_GROUND_SHOWALL"; then 199 | sed -i 's/this.speed > 5/this.speed >= 0/' "${TAR1090_INSTALL_DIR}/html-webroot/planeObject_*.js" >/dev/null 2>&1 || true 200 | fi 201 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/startup.d/06-range-outline: -------------------------------------------------------------------------------- 1 | #!/command/with-contenv bash 2 | # shellcheck shell=bash disable=SC1091 3 | 4 | source /scripts/common 5 | 6 | if chk_enabled "${TAR1090_DISABLE}"; then 7 | exit 0 8 | fi 9 | 10 | # https://github.com/wiedehopf/tar1090#heywhatsthatcom-range-outline 11 | 12 | if [ -n "${HEYWHATSTHAT_PANORAMA_ID}" ]; then 13 | 14 | HEYWHATSTHAT_ALTS="${HEYWHATSTHAT_ALTS:-12192m}" 15 | 16 | if grep -e "[^0-9kmft,]" <<< "${HEYWHATSTHAT_ALTS}" >/dev/null 2>&1; then 17 | echo "FATAL: Illegal character in HEYWHATSTHAT_ALTS=${HEYWHATSTHAT_ALTS}" 18 | exit 1 19 | fi 20 | 21 | # convert all elements to meters 22 | readarray -td, alts_array <<< "${HEYWHATSTHAT_ALTS:-12192m}" 23 | for i in "${!alts_array[@]}" 24 | do 25 | alts_array[i]="${alts_array[i]//$'\n'/}" 26 | if [[ ${alts_array[i]: -2} == "km" ]]; then 27 | alts_array[i]="${alts_array[i]:0:-2}000" 28 | elif [[ ${alts_array[i]: -1} == "m" ]]; then 29 | alts_array[i]="${alts_array[i]:0:-1}" 30 | elif [[ ${alts_array[i]: -2} == "ft" ]]; then 31 | alts_array[i]="$(bc -l <<< "scale=0; ${alts_array[i]:0:-2}/3.281")" 32 | else 33 | alts_array[i]="$(bc -l <<< "scale=0; ${alts_array[i]}/3.281")" 34 | fi 35 | done 36 | 37 | # write the results back to $HEYWHATSTHAT_ALTS: 38 | printf -v HEYWHATSTHAT_ALTS -- "%s," "${alts_array[@]}" 39 | HEYWHATSTHAT_ALTS="${HEYWHATSTHAT_ALTS:0:-1}" 40 | 41 | HEY_URL="http://www.heywhatsthat.com/api/upintheair.json?id=${HEYWHATSTHAT_PANORAMA_ID}&refraction=0.25&alts=${HEYWHATSTHAT_ALTS:-12192}" 42 | OFILE="${TAR1090_INSTALL_DIR}/html-webroot/upintheair.json" 43 | 44 | # in many configurations TAR1090_UPDATE_DIR will persist compose down / up 45 | mkdir -p "${TAR1090_UPDATE_DIR}" 46 | URL_FILE="${TAR1090_UPDATE_DIR}/upintheair.json.url" 47 | PFILE="${TAR1090_UPDATE_DIR}/upintheair.json" 48 | 49 | if [[ -f "${PFILE}" ]] && diff -q "$URL_FILE" <(cat <<<"${HEY_URL}") &>/dev/null; then 50 | # url identical, use old file 51 | echo "Using cached HeyWhatsThat Range Outlines for these altitudes (in meters): ${HEYWHATSTHAT_ALTS}" 52 | cp -f "${PFILE}" "${OFILE}" 53 | else 54 | echo "Getting HeyWhatsThat Range Outlines for these altitudes (in meters): ${HEYWHATSTHAT_ALTS}" 55 | if curl --connect-timeout 2 --silent --show-error --output "${OFILE}" "${HEY_URL}"; then 56 | cp -f "${OFILE}" "${PFILE}" 57 | cat <<<"${HEY_URL}" >"${URL_FILE}" 58 | else 59 | echo "WARNING: Unable to download panorama. Outline will not be available." 60 | exit 0 61 | fi 62 | fi 63 | else 64 | # we need to remove the JSON file if it exists (use case: user removes previously set HEYWHATSTHAT_PANORAMA_ID) 65 | rm -f "${TAR1090_INSTALL_DIR}/html-webroot/upintheair.json" 66 | fi 67 | 68 | exit 0 69 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/startup.d/07-nginx-configure: -------------------------------------------------------------------------------- 1 | #!/command/with-contenv bash 2 | # shellcheck shell=bash disable=SC1091 3 | 4 | source /scripts/common 5 | 6 | if ! chk_enabled "${HTTP_ACCESS_LOG}"; then 7 | # shellcheck disable=SC1003 8 | sed -i 's\access_log .*\access_log off;\' /etc/nginx/nginx.conf 9 | else 10 | # shellcheck disable=SC1003 11 | sed -i 's\access_log .*\access_log /dev/stdout;\' /etc/nginx/nginx.conf 12 | fi 13 | 14 | if ! chk_enabled "${HTTP_ERROR_LOG}"; then 15 | # shellcheck disable=SC1003 16 | sed -i 's\error_log .*\error_log /dev/null crit;\' /etc/nginx/nginx.conf 17 | else 18 | # shellcheck disable=SC1003 19 | sed -i 's\error_log .*\error_log /dev/stdout notice;\' /etc/nginx/nginx.conf 20 | fi 21 | 22 | if chk_enabled "${TAR1090_DISABLE}"; then 23 | rm -f /etc/nginx/sites-enabled/tar1090 24 | exit 0 25 | fi 26 | 27 | # Add in CORS header for tar1090 data/aircraft.json file 28 | # adjust the tar1090 runtime directory to /run/tar1090 29 | 30 | sed -i \ 31 | -e 's/location ~ aircraft\\.json$ {/location ~ aircraft\.json$ {\n add_header Access-Control-Allow-Origin "\*";/g' \ 32 | -e 's#/run/tar1090-webroot/#/run/tar1090/#' \ 33 | "/etc/nginx/nginx-tar1090-webroot.conf" 34 | 35 | if chk_enabled "${READSB_ENABLE_API}"; then 36 | # shellcheck disable=SC2016 37 | sed -i -e 's|#sed_placeholder_API_proxy|location /re-api/ {\ 38 | gzip on;\ 39 | proxy_http_version 1.1;\ 40 | proxy_max_temp_file_size 0;\ 41 | proxy_set_header Connection $http_connection;\ 42 | proxy_set_header Host $http_host;\ 43 | proxy_pass http://unix:/run/readsb/api.sock:/$is_args$args;\ 44 | }|' /etc/nginx/sites-enabled/tar1090 45 | else 46 | cp -Tf /etc/nginx.tar1090/sites-enabled/tar1090 /etc/nginx/sites-enabled/tar1090 47 | fi 48 | 49 | if chk_enabled "${CUSTOM_HTML}"; then 50 | sed -i \ 51 | -e 's#/usr/local/share/tar1090/html-webroot/.*#/var/custom_html/;\nadd_header Cache-Control "no-cache";#' \ 52 | -e 's#add_header Cache-Control.*;$#add_header Cache-Control "no-cache";#' \ 53 | /etc/nginx/nginx-tar1090-webroot.conf 54 | fi 55 | -------------------------------------------------------------------------------- /rootfs/etc/s6-overlay/startup.d/08-graphs1090-init: -------------------------------------------------------------------------------- 1 | #!/command/with-contenv bash 2 | # shellcheck shell=bash disable=SC1091 3 | 4 | source /scripts/common 5 | 6 | mkdir -p /run/graphs1090 7 | 8 | # If ${GRAPHS1090_DISABLE} is set, remove access to the graphs1090 website. We don't need to worry about putting this file back 9 | # after graphs1090 is re-enabled, because when changing env params, the container MUST be recreated. 10 | if chk_enabled "${GRAPHS1090_DISABLE}"; then 11 | mv -f /usr/share/graphs1090/nginx-graphs1090.conf /usr/share/graphs1090/nginx-graphs1090.conf.backup 12 | touch /usr/share/graphs1090/nginx-graphs1090.conf 13 | exit 0 14 | fi 15 | 16 | # create symlink so /var/cache/fontconfig is in tmpfs 17 | # as per Wiedehopf - https://discord.com/channels/734090820684349521/1102603003376177172/1203826726023729162 18 | # shellcheck disable=SC2174 19 | mkdir -p -m 777 /run/cache/fontconfig 20 | rm -rf /var/cache/fontconfig 21 | ln -sf /run/cache/fontconfig /var/cache/fontconfig 22 | 23 | if chk_enabled "${GRAPHS1090_HIDE_SYSTEM}" ; then 24 | sed -i "s|HIDE_SYSTEM=.*|HIDE_SYSTEM=yes|g" /etc/default/graphs1090 25 | cp /usr/share/graphs1090/git/hide_system-collectd.conf /etc/collectd/collectd.conf 26 | else 27 | cp /usr/share/graphs1090/git/collectd.conf /etc/collectd/collectd.conf 28 | fi 29 | 30 | # ref: https://github.com/wiedehopf/graphs1090/blob/151e63a810d6b087518992d4f366d9776c5c826b/install.sh#L171 31 | sed -i '//a\ \ \ \ Interface "eth0"' /etc/collectd/collectd.conf 32 | # ref: https://github.com/wiedehopf/graphs1090/blob/151e63a810d6b087518992d4f366d9776c5c826b/install.sh#L218 33 | sed -i -e 's?URL .*?URL "file:///usr/share/graphs1090/data-symlink"?' /etc/collectd/collectd.conf 34 | ## Lines below merge the tar1090 collectd config with the graphs1090 collectd config 35 | # remove the default syslog config in collectd.conf 36 | sed -i '//,/<\/Plugin>/d' /etc/collectd/collectd.conf 37 | # replace syslog plugin with logfile plugin in collectd.conf 38 | sed -i 's/LoadPlugin\ syslog/LoadPlugin logfile/' /etc/collectd/collectd.conf 39 | # add configuration to log to STDOUT in collectd.conf ("/a" == append lines after match) 40 | sed -i '/LoadPlugin\ logfile/a\\n\n<\/Plugin>' /etc/collectd/collectd.conf 41 | sed -i '//a\ \ \ \ PrintSeverity\ true' /etc/collectd/collectd.conf 42 | sed -i '//a\ \ \ \ Timestamp\ false' /etc/collectd/collectd.conf 43 | sed -i '//a\ \ \ \ File\ STDOUT' /etc/collectd/collectd.conf 44 | sed -i '//a\ \ \ \ LogLevel\ "notice"' /etc/collectd/collectd.conf 45 | # add tar1090 specific stuff 46 | # shellcheck disable=SC2016 47 | sed -i '$a\\n' /etc/collectd/collectd.conf 48 | # shellcheck disable=SC2016 49 | sed -i '$aFQDNLookup\ true' /etc/collectd/collectd.conf 50 | 51 | # Disable a few graphs based on parameter settings: 52 | if chk_enabled "${GRAPHS1090_DISABLE_CHART_CPU}"; then 53 | sed -i '/^\s*
$/{$!{N;s/\(
\n\s*