From 7c8d6b10a0c5f3f5fb599156dd80234d734bf985 Mon Sep 17 00:00:00 2001 From: Fred Clausen <43556888+fredclausen@users.noreply.github.com> Date: Thu, 12 Oct 2023 10:16:57 -0600 Subject: [PATCH] linting / precommit --- .dictionary.txt | 1 + .github/workflows/cancel_dupes.yml | 9 +- .github/workflows/check_versions.yml | 2 - .github/workflows/hadolint.yml | 3 +- .github/workflows/markdownlint.yml | 4 +- .github/workflows/on_pr.yml | 15 +- .github/workflows/pre-commit-updates.yaml | 23 +++ .github/workflows/yamllint.yml | 2 +- .pre-commit-config.yaml | 66 ++++++ Dockerfile | 1 + README.DockerHub.md | 4 +- README.md | 240 +++++++++++----------- rootfs/etc/s6-overlay/scripts/01-piaware | 2 +- rootfs/scripts/fa_services.tcl | 4 +- 14 files changed, 231 insertions(+), 145 deletions(-) create mode 100644 .dictionary.txt create mode 100644 .github/workflows/pre-commit-updates.yaml create mode 100644 .pre-commit-config.yaml diff --git a/.dictionary.txt b/.dictionary.txt new file mode 100644 index 0000000..9ac17d5 --- /dev/null +++ b/.dictionary.txt @@ -0,0 +1 @@ +crate diff --git a/.github/workflows/cancel_dupes.yml b/.github/workflows/cancel_dupes.yml index d5e6462..23cd838 100644 --- a/.github/workflows/cancel_dupes.yml +++ b/.github/workflows/cancel_dupes.yml @@ -1,15 +1,14 @@ --- - # Cancels duplicate github actions when superseded name: Cancelling Duplicates on: workflow_run: workflows: - - 'Pull Request' - - 'Deploy' - - 'Linting (Non-Image)' - types: ['requested'] + - "Pull Request" + - "Deploy" + - "Linting (Non-Image)" + types: ["requested"] jobs: cancel-duplicate-workflow-runs: diff --git a/.github/workflows/check_versions.yml b/.github/workflows/check_versions.yml index a02f094..9578c32 100644 --- a/.github/workflows/check_versions.yml +++ b/.github/workflows/check_versions.yml @@ -1,5 +1,4 @@ --- - name: Check upstream versions on: @@ -8,7 +7,6 @@ on: - cron: "0 12 * * *" jobs: - version_in_container: name: Check version in 'latest' image runs-on: ubuntu-latest diff --git a/.github/workflows/hadolint.yml b/.github/workflows/hadolint.yml index 5f437f3..e6c83ad 100644 --- a/.github/workflows/hadolint.yml +++ b/.github/workflows/hadolint.yml @@ -7,10 +7,9 @@ on: branches: - main paths: - - 'Dockerfile' + - "Dockerfile" jobs: - hadolint: name: Run hadolint against docker files runs-on: ubuntu-latest diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml index 8a616ba..9e70283 100644 --- a/.github/workflows/markdownlint.yml +++ b/.github/workflows/markdownlint.yml @@ -7,8 +7,8 @@ on: - main # only run these if markdown files are updated paths: - - '**.md' - - '**.MD' + - "**.md" + - "**.MD" jobs: markdownlint: diff --git a/.github/workflows/on_pr.yml b/.github/workflows/on_pr.yml index f592f67..35f2bb7 100644 --- a/.github/workflows/on_pr.yml +++ b/.github/workflows/on_pr.yml @@ -11,16 +11,15 @@ on: - main # Don't trigger if it's just a documentation update paths-ignore: - - '**.md' - - '**.MD' - - '**.yml' - - 'LICENSE' - - '.gitattributes' - - '.gitignore' - - '.dockerignore' + - "**.md" + - "**.MD" + - "**.yml" + - "LICENSE" + - ".gitattributes" + - ".gitignore" + - ".dockerignore" jobs: - test-build: name: Test uses: sdr-enthusiasts/common-github-workflows/.github/workflows/build_and_push_image.yml@main diff --git a/.github/workflows/pre-commit-updates.yaml b/.github/workflows/pre-commit-updates.yaml new file mode 100644 index 0000000..f075972 --- /dev/null +++ b/.github/workflows/pre-commit-updates.yaml @@ -0,0 +1,23 @@ +name: Update pre-commit hooks + +on: + workflow_dispatch: + schedule: + - cron: 0 0 * * * + +jobs: + update: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.0 + with: + fetch-depth: 0 + - uses: vrslev/pre-commit-autoupdate@v1.0.0 + - uses: peter-evans/create-pull-request@v5 + with: + branch: pre-commit-autoupdate + title: "chore(deps): Update pre-commit hooks" + commit-message: "chore(deps): Update pre-commit hooks" + body: Update pre-commit hooks + labels: dependencies + delete-branch: True diff --git a/.github/workflows/yamllint.yml b/.github/workflows/yamllint.yml index 2fff033..d3b07f9 100644 --- a/.github/workflows/yamllint.yml +++ b/.github/workflows/yamllint.yml @@ -7,7 +7,7 @@ on: - main # only run when yaml files are updated paths: - - '**.yml' + - "**.yml" jobs: yamllint: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..0957836 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,66 @@ +repos: + # lint yaml, line and whitespace + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - id: requirements-txt-fixer + - id: mixed-line-ending + - id: check-executables-have-shebangs + exclude: fa_services.tcl + - id: check-shebang-scripts-are-executable + + # lint the dockerfiles + - repo: https://github.com/hadolint/hadolint + rev: v2.12.1-beta + hooks: + - id: hadolint + + # prettier + - repo: https://github.com/pre-commit/mirrors-prettier + rev: "v3.0.3" # Use the sha / tag you want to point at + hooks: + - id: prettier + types_or: [file, bash, sh, javascript, jsx, ts, tsx] + additional_dependencies: + - prettier@2.5.1 + exclude: ^(Dockerfile*) + + - repo: https://github.com/codespell-project/codespell.git + rev: "v2.2.5" # Use the sha / tag you want to point at + hooks: + - id: codespell + types: [text] + args: [--ignore-words=.dictionary.txt] + exclude: ^(Dockerfile*) + + - repo: https://github.com/shellcheck-py/shellcheck-py + rev: v0.9.0.6 + hooks: + - id: shellcheck + + - repo: https://github.com/sirosen/check-jsonschema + rev: 0.27.0 + hooks: + - id: check-github-actions + - id: check-github-workflows + + - repo: https://github.com/doublify/pre-commit-rust + rev: v1.0 + hooks: + - id: fmt + - id: cargo-check + + # lint python formatting + - repo: https://github.com/psf/black + rev: 23.9.1 + hooks: + - id: black + + - repo: https://github.com/pycqa/flake8 + rev: "6.1.0" # pick a git hash / tag to point to + hooks: + - id: flake8 + args: ["--extend-ignore=W503,W504,E501"] diff --git a/Dockerfile b/Dockerfile index 9b66ba6..2f3edf5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,7 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"] COPY rootfs/ / +# hadolint ignore=DL3008,SC2086,SC2039,SC2068 RUN set -x && \ TEMP_PACKAGES=() && \ KEPT_PACKAGES=() && \ diff --git a/README.DockerHub.md b/README.DockerHub.md index 0b7483f..4f994af 100644 --- a/README.DockerHub.md +++ b/README.DockerHub.md @@ -11,8 +11,8 @@ For more information on what PiAware is, see here: [FlightAware - PiAware](https This container can operate in "net only" mode and pull ADS-B Mode-S & UAT data from another host/container. **This is the recommended way of deploying the container**, and I'd humbly suggest [`sdr-enthusiasts/docker-readsb-protobuf`](https://github.com/sdr-enthusiasts/docker-readsb-protobuf) and [`sdr-enthusiasts/docker-dump978`](https://github.com/sdr-enthusiasts/docker-dump978) (if you live in an area that uses UAT). -*Note:* `bladerf`/`hackrf`/`limesdr`/`radarcape` - Support for these is compiled in, but I need to complete the wrapper/helper scripts. I don't have access to these devices. If you do, and would be willing to test, please get in touch with me! +_Note:_ `bladerf`/`hackrf`/`limesdr`/`radarcape` - Support for these is compiled in, but I need to complete the wrapper/helper scripts. I don't have access to these devices. If you do, and would be willing to test, please get in touch with me! ## Documentation -Please [read this container's detailed and thorough documentation in the GitHub repository.](https://github.com/sdr-enthusiasts/docker-piaware/blob/main/README.md) \ No newline at end of file +Please [read this container's detailed and thorough documentation in the GitHub repository.](https://github.com/sdr-enthusiasts/docker-piaware/blob/main/README.md) diff --git a/README.md b/README.md index 65c1e8b..d927c7e 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ For more information on what PiAware is, see here: [FlightAware - PiAware](https This container can operate in "net only" mode and pull ADS-B Mode-S & UAT data from another host/container. **This is the recommended way of deploying the container**, and I'd humbly suggest [`sdr-enthusiasts/docker-readsb-protobuf`](https://github.com/sdr-enthusiasts/docker-readsb-protobuf) and [`sdr-enthusiasts/docker-dump978`](https://github.com/sdr-enthusiasts/docker-dump978) (if you live in an area that uses UAT). -*Note:* `bladerf`/`hackrf`/`limesdr`/`radarcape` - Support for these is compiled in, but I need to complete the wrapper/helper scripts. I don't have access to these devices. If you do, and would be willing to test, please get in touch with me! +_Note:_ `bladerf`/`hackrf`/`limesdr`/`radarcape` - Support for these is compiled in, but I need to complete the wrapper/helper scripts. I don't have access to these devices. If you do, and would be willing to test, please get in touch with me! ## Note for Users running 32-bit Debian Buster-based OSes on ARM @@ -19,54 +19,54 @@ Please see: [Buster-Docker-Fixes](https://github.com/sdr-enthusiasts/Buster-Dock ## Table of Contents -* [sdr-enthusiasts/docker-piaware](#sdr-enthusiastsdocker-piaware) - * [Note for Users running 32-bit Debian Buster-based OSes on ARM](#note-for-users-running-32-bit-debian-buster-based-oses-on-arm) - * [Table of Contents](#table-of-contents) - * [Supported tags and respective Dockerfiles](#supported-tags-and-respective-dockerfiles) - * [Multi Architecture Support](#multi-architecture-support) - * [Prerequisites](#prerequisites) - * [Determining your Feeder ID](#determining-your-feeder-id) - * [Already running PiAware](#already-running-piaware) - * [New to PiAware](#new-to-piaware) - * [Deployment Examples](#deployment-examples) - * [Example `docker run` command with RTL-SDR USB for reception of 1090MHz](#example-docker-run-command-with-rtl-sdr-usb-for-reception-of-1090mhz) - * [Example `docker-compose.yml` with RTL-SDR USB for reception of 1090MHz](#example-docker-composeyml-with-rtl-sdr-usb-for-reception-of-1090mhz) - * [Example `docker run` command with 2x RTL-SDR USB for reception of 1090MHz and 978MHz](#example-docker-run-command-with-2x-rtl-sdr-usb-for-reception-of-1090mhz-and-978mhz) - * [Example `docker-compose.yml` with 2x RTL-SDR USB for reception of 1090MHz and 978MHz](#example-docker-composeyml-with-2x-rtl-sdr-usb-for-reception-of-1090mhz-and-978mhz) - * [Example `docker run` with external Mode-S/BEAST provider](#example-docker-run-with-external-mode-sbeast-provider) - * [Example `docker-compose.yml` with external Mode-S/BEAST provider](#example-docker-composeyml-with-external-mode-sbeast-provider) - * [Example `docker run` with external Mode-S/BEAST provider and external UAT provider](#example-docker-run-with-external-mode-sbeast-provider-and-external-uat-provider) - * [Example `docker-compose.yml` with external Mode-S/BEAST provider and external UAT provider](#example-docker-composeyml-with-external-mode-sbeast-provider-and-external-uat-provider) - * [Environment Variables](#environment-variables) - * [General](#general) - * [Multilateration](#multilateration) - * [Receiver Configuration (1090MHz)](#receiver-configuration-1090mhz) - * [RTL-SDR Configuration (1090MHz)](#rtl-sdr-configuration-1090mhz) - * [Adaptive Gain Configuration (1090MHz)](#adaptive-gain-configuration-1090mhz) - * [Relay Configuration (1090MHz)](#relay-configuration-1090mhz) - * [Receiver Configuration (978MHz)](#receiver-configuration-978mhz) - * [RTL-SDR Configuration (978MHz)](#rtl-sdr-configuration-978mhz) - * [Relay Configuration (978MHz)](#relay-configuration-978mhz) - * [Ports](#ports) - * [Claiming Your Receiver](#claiming-your-receiver) - * [Logging](#logging) - * [Other services to feed](#other-services-to-feed) - * [Getting help](#getting-help) +- [sdr-enthusiasts/docker-piaware](#sdr-enthusiastsdocker-piaware) + - [Note for Users running 32-bit Debian Buster-based OSes on ARM](#note-for-users-running-32-bit-debian-buster-based-oses-on-arm) + - [Table of Contents](#table-of-contents) + - [Supported tags and respective Dockerfiles](#supported-tags-and-respective-dockerfiles) + - [Multi Architecture Support](#multi-architecture-support) + - [Prerequisites](#prerequisites) + - [Determining your Feeder ID](#determining-your-feeder-id) + - [Already running PiAware](#already-running-piaware) + - [New to PiAware](#new-to-piaware) + - [Deployment Examples](#deployment-examples) + - [Example `docker run` command with RTL-SDR USB for reception of 1090MHz](#example-docker-run-command-with-rtl-sdr-usb-for-reception-of-1090mhz) + - [Example `docker-compose.yml` with RTL-SDR USB for reception of 1090MHz](#example-docker-composeyml-with-rtl-sdr-usb-for-reception-of-1090mhz) + - [Example `docker run` command with 2x RTL-SDR USB for reception of 1090MHz and 978MHz](#example-docker-run-command-with-2x-rtl-sdr-usb-for-reception-of-1090mhz-and-978mhz) + - [Example `docker-compose.yml` with 2x RTL-SDR USB for reception of 1090MHz and 978MHz](#example-docker-composeyml-with-2x-rtl-sdr-usb-for-reception-of-1090mhz-and-978mhz) + - [Example `docker run` with external Mode-S/BEAST provider](#example-docker-run-with-external-mode-sbeast-provider) + - [Example `docker-compose.yml` with external Mode-S/BEAST provider](#example-docker-composeyml-with-external-mode-sbeast-provider) + - [Example `docker run` with external Mode-S/BEAST provider and external UAT provider](#example-docker-run-with-external-mode-sbeast-provider-and-external-uat-provider) + - [Example `docker-compose.yml` with external Mode-S/BEAST provider and external UAT provider](#example-docker-composeyml-with-external-mode-sbeast-provider-and-external-uat-provider) + - [Environment Variables](#environment-variables) + - [General](#general) + - [Multilateration](#multilateration) + - [Receiver Configuration (1090MHz)](#receiver-configuration-1090mhz) + - [RTL-SDR Configuration (1090MHz)](#rtl-sdr-configuration-1090mhz) + - [Adaptive Gain Configuration (1090MHz)](#adaptive-gain-configuration-1090mhz) + - [Relay Configuration (1090MHz)](#relay-configuration-1090mhz) + - [Receiver Configuration (978MHz)](#receiver-configuration-978mhz) + - [RTL-SDR Configuration (978MHz)](#rtl-sdr-configuration-978mhz) + - [Relay Configuration (978MHz)](#relay-configuration-978mhz) + - [Ports](#ports) + - [Claiming Your Receiver](#claiming-your-receiver) + - [Logging](#logging) + - [Other services to feed](#other-services-to-feed) + - [Getting help](#getting-help) ## Supported tags and respective Dockerfiles -* `latest` should always contain the latest released version of piaware and support tools, for all supported architectures. -* Specific version and architecture tags are available if required, however these are not regularly updated. It is generally recommended to run `latest`. -* There are also `latest` and version-specific tags appended with `_nohealthcheck` where the container healthchecks have been excluded from the image build. See [issue #43](https://github.com/sdr-enthusiasts/docker-piaware/issues/43). +- `latest` should always contain the latest released version of piaware and support tools, for all supported architectures. +- Specific version and architecture tags are available if required, however these are not regularly updated. It is generally recommended to run `latest`. +- There are also `latest` and version-specific tags appended with `_nohealthcheck` where the container healthchecks have been excluded from the image build. See [issue #43](https://github.com/sdr-enthusiasts/docker-piaware/issues/43). ## Multi Architecture Support Currently, this image should pull and run on the following architectures: -* `linux/i386` -* `linux/amd64` -* `linux/arm/v7` -* `linux/arm64` +- `linux/i386` +- `linux/amd64` +- `linux/arm/v7` +- `linux/arm64` In order to ensure `dump1090` is optimised for the hardware running it, the `dump1090` binary is built on first-run of the container. @@ -112,9 +112,9 @@ You need to specify a feeder-id for the container, as this is used by FlightAwar ### Already running PiAware -You'll need your *feeder-id* from your existing feeder. +You'll need your _feeder-id_ from your existing feeder. -To get your *feeder-id*, log onto your feeder and issue the command: +To get your _feeder-id_, log onto your feeder and issue the command: ```shell piaware-config -show feeder-id @@ -122,7 +122,7 @@ piaware-config -show feeder-id ### New to PiAware -You'll need a *feeder-id*. To get one, you can temporarily run the container, to allow it to communicate with the FlightAware servers and get a new feeder ID. +You'll need a _feeder-id_. To get one, you can temporarily run the container, to allow it to communicate with the FlightAware servers and get a new feeder ID. Run the commands: @@ -179,7 +179,7 @@ docker run \ ### Example `docker-compose.yml` with RTL-SDR USB for reception of 1090MHz ```yaml -version: '2.0' +version: "2.0" services: piaware: @@ -208,8 +208,8 @@ This will currently only work in the United States of America, as they are the o This example assumes that: -* Your 1090MHz RTL-SDR has its serial set to `00001090` -* Your 978MHz RTL-SDR has its serial set to `00000978` +- Your 1090MHz RTL-SDR has its serial set to `00001090` +- Your 978MHz RTL-SDR has its serial set to `00000978` ```shell docker run \ @@ -234,7 +234,7 @@ docker run \ This will currently only work in the United States of America, as they are the only country that uses ADS-B UAT on 978MHz. ```yaml -version: '2.0' +version: "2.0" services: piaware: @@ -264,8 +264,8 @@ services: An example of an external Mode-S/BEAST provider would be: -* [`sdr-enthusiasts/docker-readsb-protobuf`](https://github.com/sdr-enthusiasts/docker-readsb-protobuf) container -* Another hardware feeder that provides BEAST output data on port 30005 +- [`sdr-enthusiasts/docker-readsb-protobuf`](https://github.com/sdr-enthusiasts/docker-readsb-protobuf) container +- Another hardware feeder that provides BEAST output data on port 30005 In the example below, it is assumed that the external BEAST provider resolves to `beasthost` and is listening for connections on TCP port `30005`. @@ -288,13 +288,13 @@ docker run \ An example of an external Mode-S/BEAST provider would be: -* [`sdr-enthusiasts/docker-readsb-protobuf`](https://github.com/sdr-enthusiasts/docker-readsb-protobuf) container -* Another hardware feeder that provides BEAST output data on port 30005 +- [`sdr-enthusiasts/docker-readsb-protobuf`](https://github.com/sdr-enthusiasts/docker-readsb-protobuf) container +- Another hardware feeder that provides BEAST output data on port 30005 In the example below, it is assumed that the external BEAST provider resolves to `beasthost` and is listening for connections on TCP port `30005`. ```yaml -version: '2.0' +version: "2.0" services: piaware: @@ -319,14 +319,14 @@ This will currently only work in the United States of America, as they are the o An example of an external Mode-S/BEAST provider would be: -* [`sdr-enthusiasts/docker-readsb-protobuf`](https://github.com/sdr-enthusiasts/docker-readsb-protobuf) container -* Another hardware feeder that provides BEAST output data on port 30005 +- [`sdr-enthusiasts/docker-readsb-protobuf`](https://github.com/sdr-enthusiasts/docker-readsb-protobuf) container +- Another hardware feeder that provides BEAST output data on port 30005 In the example below, it is assumed that the external BEAST provider resolves to `beasthost` and is listening for connections on TCP port `30005`. An example of an external UAT provider would be: -* [`sdr-enthusiasts/docker-dump978`](https://github.com/sdr-enthusiasts/docker-dump978) container +- [`sdr-enthusiasts/docker-dump978`](https://github.com/sdr-enthusiasts/docker-dump978) container In the example below, it is assumed that the external UAT provider resolves to `uathost` and is listening for connections on TCP port `30978`. @@ -354,19 +354,19 @@ This will currently only work in the United States of America, as they are the o An example of an external Mode-S/BEAST provider would be: -* [`sdr-enthusiasts/docker-readsb-protobuf`](https://github.com/sdr-enthusiasts/docker-readsb-protobuf) container -* Another hardware feeder that provides BEAST output data on port 30005 +- [`sdr-enthusiasts/docker-readsb-protobuf`](https://github.com/sdr-enthusiasts/docker-readsb-protobuf) container +- Another hardware feeder that provides BEAST output data on port 30005 In the example below, it is assumed that the external BEAST provider resolves to `beasthost` and is listening for connections on TCP port `30005`. An example of an external UAT provider would be: -* [`sdr-enthusiasts/docker-dump978`](https://github.com/sdr-enthusiasts/docker-dump978) container +- [`sdr-enthusiasts/docker-dump978`](https://github.com/sdr-enthusiasts/docker-dump978) container In the example below, it is assumed that the external UAT provider resolves to `uathost` and is listening for connections on TCP port `30978`. ```yaml -version: '2.0' +version: "2.0" services: piaware: @@ -394,109 +394,109 @@ For an explanation of `piaware-config` variables, see [FlightAware PiAware Advan ### General -| Environment Variable | Purpose | Default | -| -------------------- | ------------------------------- | ------- | -| `TZ` | Local timezone in ["TZ database name" format](). | `UTC` | -| `FEEDER_ID` | Your FlightAware feeder ID (required) | | -| `BINGMAPSAPIKEY` | Optional. Bing Maps API Key. If set, it is configured in `dump1090`'s `config.js`. | | -| `VERBOSE_LOGGING` | Optional. Set to `true` for more verbose logs. | | +| Environment Variable | Purpose | Default | +| -------------------- | ------------------------------------------------------------------------------------------------------------ | ------- | +| `TZ` | Local timezone in ["TZ database name" format](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | `UTC` | +| `FEEDER_ID` | Your FlightAware feeder ID (required) | | +| `BINGMAPSAPIKEY` | Optional. Bing Maps API Key. If set, it is configured in `dump1090`'s `config.js`. | | +| `VERBOSE_LOGGING` | Optional. Set to `true` for more verbose logs. | | ### Multilateration -| Environment Variable | Possible Values | Description | Default | -| -------------------- | --------------- | ------- | ------- | -| `ALLOW_MLAT` | `yes` or `no` | If `yes`, multilateration is enabled (also requires that receiver location is set on the FlightAware My ADS-B stats page) | `yes` | -| `MLAT_RESULTS` | `yes` or `no` | If `yes`, multilateration results are returned to PiAware from FlightAware | `yes` | +| Environment Variable | Possible Values | Description | Default | +| -------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------- | ------- | +| `ALLOW_MLAT` | `yes` or `no` | If `yes`, multilateration is enabled (also requires that receiver location is set on the FlightAware My ADS-B stats page) | `yes` | +| `MLAT_RESULTS` | `yes` or `no` | If `yes`, multilateration results are returned to PiAware from FlightAware | `yes` | ### Receiver Configuration (1090MHz) -| Environment Variable | Possible Values | Description | Default | -| -------------------- | --------------- | ------- | ------- | -| `ALLOW_MODEAC` | `yes` or `no` | If `yes`, piaware and dump1090-fa will enable Mode A/C decoding if a client requests it. -Mode A/C decoding requires additional CPU when enabled. | `yes` | -| `RECEIVER_TYPE` | `rtlsdr`, `relay` | Configures how PiAware attempts to talk to the ADS-B receiver | `rtlsdr` | +| Environment Variable | Possible Values | Description | Default | +| ------------------------------------------------------- | ----------------- | ---------------------------------------------------------------------------------------- | -------- | +| `ALLOW_MODEAC` | `yes` or `no` | If `yes`, piaware and dump1090-fa will enable Mode A/C decoding if a client requests it. | +| Mode A/C decoding requires additional CPU when enabled. | `yes` | +| `RECEIVER_TYPE` | `rtlsdr`, `relay` | Configures how PiAware attempts to talk to the ADS-B receiver | `rtlsdr` | Receiver types: -* `rtlsdr` - For FlightAware dongles and any other RTL-SDR -* `relay` - For use with an external BEAST protocol provider running on another host (dump1090/readsb/etc) -* `bladerf`/`hackrf`/`limesdr`/`radarcape` - Support for these is compiled in, but I need to complete the wrapperr scripts. I don't have access to these devices. If you do, and would be willing to test, please get in touch with me! +- `rtlsdr` - For FlightAware dongles and any other RTL-SDR +- `relay` - For use with an external BEAST protocol provider running on another host (dump1090/readsb/etc) +- `bladerf`/`hackrf`/`limesdr`/`radarcape` - Support for these is compiled in, but I need to complete the wrapperr scripts. I don't have access to these devices. If you do, and would be willing to test, please get in touch with me! ### RTL-SDR Configuration (1090MHz) Use only with `RECEIVER_TYPE=rtlsdr`. -| Environment Variable | Possible Values | Description | Default | -| -------------------- | --------------- | ------- | ------- | -| `RTLSDR_PPM` | a frequency correction in PPM | Configures the dongle PPM correction | `0` | -| `RTLSDR_GAIN` | `max` or a numeric gain level | Optimizing gain (optional) -- See [FlightAware -- Optimizing Gain](https://discussions.flightaware.com/t/thoughts-on-optimizing-gain/44482/2) | `max` | -| `DUMP1090_DEVICE` | rtlsdr device serial number | Configures which dongle to use for 1090MHz reception if there is more than one connected | first available device | +| Environment Variable | Possible Values | Description | Default | +| -------------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- | +| `RTLSDR_PPM` | a frequency correction in PPM | Configures the dongle PPM correction | `0` | +| `RTLSDR_GAIN` | `max` or a numeric gain level | Optimizing gain (optional) -- See [FlightAware -- Optimizing Gain](https://discussions.flightaware.com/t/thoughts-on-optimizing-gain/44482/2) | `max` | +| `DUMP1090_DEVICE` | rtlsdr device serial number | Configures which dongle to use for 1090MHz reception if there is more than one connected | first available device | #### Adaptive Gain Configuration (1090MHz) The following settings control the [adaptive gain configuration](https://github.com/flightaware/dump1090/blob/master/README.adaptive-gain.md) of `dump1090` when using `RECEIVER_TYPE=rtlsdr`. -| Environment Variable | Possible Values | Description | Default | -| -------------------- | --------------- | ------- | ------- | -| `DUMP1090_ADAPTIVE_RANGE` | `true` or unset | Set to any value to adjust gain for target dynamic range. | | -| `DUMP1090_ADAPTIVE_RANGE_TARGET` | A value in dB | Set target dynamic range in dB. | | -| `DUMP1090_ADAPTIVE_BURST` | `true` or unset | Set to any value to adjust gain for too-loud message bursts. | | -| `DUMP1090_ADAPTIVE_MIN_GAIN` | A value in dB | Set gain adjustment range lower limit (dB). | | -| `DUMP1090_ADAPTIVE_MAX_GAIN` | A value in dB | Set gain adjustment range upper limit (dB). | | -| `DUMP1090_ADAPTIVE_DUTY_CYCLE` | A percentage | Set adaptive gain duty cycle % (1..100)
See [Reducing the CPU cost of adaptive gain](https://github.com/flightaware/dump1090/blob/master/README.adaptive-gain.md#reducing-the-cpu-cost-of-adaptive-gain) | | +| Environment Variable | Possible Values | Description | Default | +| -------------------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +| `DUMP1090_ADAPTIVE_RANGE` | `true` or unset | Set to any value to adjust gain for target dynamic range. | | +| `DUMP1090_ADAPTIVE_RANGE_TARGET` | A value in dB | Set target dynamic range in dB. | | +| `DUMP1090_ADAPTIVE_BURST` | `true` or unset | Set to any value to adjust gain for too-loud message bursts. | | +| `DUMP1090_ADAPTIVE_MIN_GAIN` | A value in dB | Set gain adjustment range lower limit (dB). | | +| `DUMP1090_ADAPTIVE_MAX_GAIN` | A value in dB | Set gain adjustment range upper limit (dB). | | +| `DUMP1090_ADAPTIVE_DUTY_CYCLE` | A percentage | Set adaptive gain duty cycle % (1..100)
See [Reducing the CPU cost of adaptive gain](https://github.com/flightaware/dump1090/blob/master/README.adaptive-gain.md#reducing-the-cpu-cost-of-adaptive-gain) | | ### Relay Configuration (1090MHz) Use only with `RECEIVER_TYPE=relay`. -| Environment Variable | Possible Values | Description | Default | -| -------------------- | --------------- | ------- | ------- | -| `BEASTHOST` | a hostname or IP | Specify an external BEAST protocol provider (dump1090/readsb/etc). | | -| `BEASTPORT` | a port number | Specify the TCP port number of the external BEAST protocol provider. | `30005` | -| `MLAT_RESULTS_BEASTHOST` | a hostname or IP | Specify an external host where MLAT results should be sent. | | -| `MLAT_RESULTS_BEASTPORT` | a port number | Specify the TCP port number where MLAT results should be sent. | `30104` | +| Environment Variable | Possible Values | Description | Default | +| ------------------------ | ---------------- | -------------------------------------------------------------------- | ------- | +| `BEASTHOST` | a hostname or IP | Specify an external BEAST protocol provider (dump1090/readsb/etc). | | +| `BEASTPORT` | a port number | Specify the TCP port number of the external BEAST protocol provider. | `30005` | +| `MLAT_RESULTS_BEASTHOST` | a hostname or IP | Specify an external host where MLAT results should be sent. | | +| `MLAT_RESULTS_BEASTPORT` | a port number | Specify the TCP port number where MLAT results should be sent. | `30104` | ### Receiver Configuration (978MHz) -| Environment Variable | Possible Values | Description | Default | -| -------------------- | --------------- | ------- | ------- | -| `UAT_RECEIVER_TYPE` | `none`, `rtlsdr`, `relay` | Configures how PiAware attempts to talk to the ADS-B receiver | `none` | +| Environment Variable | Possible Values | Description | Default | +| -------------------- | ------------------------- | ------------------------------------------------------------- | ------- | +| `UAT_RECEIVER_TYPE` | `none`, `rtlsdr`, `relay` | Configures how PiAware attempts to talk to the ADS-B receiver | `none` | Receiver types: -* `rtlsdr` - For FlightAware dongles and any other RTL-SDR -* `relay` - For use with an external BEAST protocol provider running on another host (dump1090/readsb/etc) -* `bladerf`/`hackrf`/`limesdr`/`radarcape` - Support for these is compiled in, but I need to complete the wrapperr scripts. I don't have access to these devices. If you do, and would be willing to test, please get in touch with me! +- `rtlsdr` - For FlightAware dongles and any other RTL-SDR +- `relay` - For use with an external BEAST protocol provider running on another host (dump1090/readsb/etc) +- `bladerf`/`hackrf`/`limesdr`/`radarcape` - Support for these is compiled in, but I need to complete the wrapperr scripts. I don't have access to these devices. If you do, and would be willing to test, please get in touch with me! ### RTL-SDR Configuration (978MHz) Use only with `UAT_RECEIVER_TYPE=rtlsdr`. -| Environment Variable | Possible Values | Description | Default | -| -------------------- | --------------- | ------- | ------- | -| `DUMP978_DEVICE` | rtlsdr device serial number | Configures which dongle to use for 978MHz reception if there is more than one connected | first available device | -| `UAT_SDR_GAIN` | `max` or a numeric gain level | Optimizing gain (optional) -- See [FlightAware -- Optimizing Gain](https://discussions.flightaware.com/t/thoughts-on-optimizing-gain/44482/2) | `max` | -| `UAT_SDR_PPM` | a frequency correction in PPM | Configures the dongle PPM correction | `0` | +| Environment Variable | Possible Values | Description | Default | +| -------------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- | +| `DUMP978_DEVICE` | rtlsdr device serial number | Configures which dongle to use for 978MHz reception if there is more than one connected | first available device | +| `UAT_SDR_GAIN` | `max` or a numeric gain level | Optimizing gain (optional) -- See [FlightAware -- Optimizing Gain](https://discussions.flightaware.com/t/thoughts-on-optimizing-gain/44482/2) | `max` | +| `UAT_SDR_PPM` | a frequency correction in PPM | Configures the dongle PPM correction | `0` | ### Relay Configuration (978MHz) Use only with `UAT_RECEIVER_TYPE=relay`. -| Environment Variable | Possible Values | Description | Default | -| -------------------- | --------------- | ------- | ------- | -| `UAT_RECEIVER_HOST` | a hostname or IP | Specify an external UAT raw data provider (dump978-fa). | | -| `UAT_RECEIVER_PORT` | a port number | Specify the TCP port number of the external UAT raw data provider. | `30978` | +| Environment Variable | Possible Values | Description | Default | +| -------------------- | ---------------- | ------------------------------------------------------------------ | ------- | +| `UAT_RECEIVER_HOST` | a hostname or IP | Specify an external UAT raw data provider (dump978-fa). | | +| `UAT_RECEIVER_PORT` | a port number | Specify the TCP port number of the external UAT raw data provider. | `30978` | ## Ports The following ports are used by this container: -* `80` - PiAware Status page and dump1090 web interface (Skyaware) - optional but recommended so you can check status and and watch the planes fly around. -* `30003` - dump1090 TCP BaseStation output listen port - optional, recommended to leave unmapped unless explicitly needed -* `30005` - dump1090 TCP Beast output listen port - optional, recommended to leave unmapped unless explicitly needed -* `30105` - If MLAT is enabled, `mlat-client` results published on this port in Beast format - optional, recommended to leave unmapped unless explicitly needed -* `30978` - If UAT decoding is enabled, UAT raw data published on this port - optional, recommended to leave unmapped unless explicitly needed -* `30979` - If UAT decoding is enabled, UAT decoded JSON published on this port - optional, recommended to leave unmapped unless explicitly needed +- `80` - PiAware Status page and dump1090 web interface (Skyaware) - optional but recommended so you can check status and and watch the planes fly around. +- `30003` - dump1090 TCP BaseStation output listen port - optional, recommended to leave unmapped unless explicitly needed +- `30005` - dump1090 TCP Beast output listen port - optional, recommended to leave unmapped unless explicitly needed +- `30105` - If MLAT is enabled, `mlat-client` results published on this port in Beast format - optional, recommended to leave unmapped unless explicitly needed +- `30978` - If UAT decoding is enabled, UAT raw data published on this port - optional, recommended to leave unmapped unless explicitly needed +- `30979` - If UAT decoding is enabled, UAT decoded JSON published on this port - optional, recommended to leave unmapped unless explicitly needed ## Claiming Your Receiver @@ -506,8 +506,8 @@ Since version 3.8.0 the `flightaware-user` and `flightaware-password` configurat ## Logging -* All processes are logged to the container's stdout, and can be viewed with `docker logs [-f] container`. -* `lighttpd` (which provides SkyAware & SkyAware978) is configured to not log (except for a startup message on container start) +- All processes are logged to the container's stdout, and can be viewed with `docker logs [-f] container`. +- `lighttpd` (which provides SkyAware & SkyAware978) is configured to not log (except for a startup message on container start) ## Other services to feed diff --git a/rootfs/etc/s6-overlay/scripts/01-piaware b/rootfs/etc/s6-overlay/scripts/01-piaware index 1f92586..f96995f 100755 --- a/rootfs/etc/s6-overlay/scripts/01-piaware +++ b/rootfs/etc/s6-overlay/scripts/01-piaware @@ -26,7 +26,7 @@ fi # If BINGMAPSAPIKEY is set, modify dump1090's config.js to include it if [ -n "${BINGMAPSAPIKEY}" ]; then echo "INFO: setting BINGMAPSAPIKEY in /usr/share/dump1090-fa/html/config.js" - + sed \ -i \ "/^BingMapsAPIKey = /c\BingMapsAPIKey = "'"'"${BINGMAPSAPIKEY}"'"'";" \ diff --git a/rootfs/scripts/fa_services.tcl b/rootfs/scripts/fa_services.tcl index e60123e..70fdf5f 100755 --- a/rootfs/scripts/fa_services.tcl +++ b/rootfs/scripts/fa_services.tcl @@ -22,9 +22,9 @@ namespace eval ::fa_services { # return 1 if we have invoke-rc.d proc has_invoke_rcd {} { # Check if we are running on docker because no runlevel exists to use invoke-rc.d and return immediately 0 - if {[is_docker]} { + if {[is_docker]} { logger "has_invoke_rcd: Running on docker ignoring invoke-rc.d" - return 0 + return 0 } if {![info exists ::invoke_rcd_path]} {