From 22437ed8d849cafff298ff7118a91b4822575187 Mon Sep 17 00:00:00 2001 From: actions-user Date: Fri, 8 Mar 2024 14:09:47 -0500 Subject: [PATCH 01/20] prep for container move, add addtl config options --- .github/workflows/deploy.yml | 16 +- .markdownlint.yaml | 4 + README.md | 344 ++++++++++++----------- rootfs/etc/s6-overlay/scripts/aiscatcher | 127 ++++++++- 4 files changed, 328 insertions(+), 163 deletions(-) create mode 100644 .markdownlint.yaml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 81e3fc1..580c4d6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -30,6 +30,7 @@ env: # DOCKERHUB_REPO: sdr-enthusiasts # DOCKERHUB_IMAGE: shipxplorer GHCR_IMAGE: sdr-enthusiasts/shipxplorer + GHCR_IMAGE2: sdr-enthusiasts/docker-shipfeeder GHCR_REGISTRY: ghcr.io jobs: @@ -97,8 +98,8 @@ jobs: with: driver-opts: image=moby/buildkit:v0.10.6 - # Build "latest" - - name: Build & Push - latest + # Build "latest" for org and new package + - name: Build & Push - latest - org package uses: docker/build-push-action@v3 with: context: . @@ -108,3 +109,14 @@ jobs: push: true tags: ghcr.io/${{ env.GHCR_IMAGE }}:latest labels: ${{ steps.meta.outputs.labels }} + + - name: Build & Push - latest - new package + uses: docker/build-push-action@v3 + with: + context: . + file: ./Dockerfile + no-cache: true + platforms: linux/amd64,linux/arm/v7,linux/arm64 + push: true + tags: ghcr.io/${{ env.GHCR_IMAGE2 }}:latest + labels: ${{ steps.meta.outputs.labels }} diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..151ee39 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,4 @@ +{ + "MD013": false, + "MD033": false +} \ No newline at end of file diff --git a/README.md b/README.md index 6582ca4..7c871b6 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,34 @@ -# sdr-enthusiasts/docker-shipxplorer +# sdr-enthusiasts/docker-shipfeeder [![Discord](https://img.shields.io/discord/734090820684349521)](https://discord.gg/sTf9uYF) -- [sdr-enthusiasts/docker-shipxplorer](#sdr-enthusiastsdocker-shipxplorer) +- [sdr-enthusiasts/docker-shipfeeder](#sdr-enthusiastsdocker-shipfeeder) - [Prerequisites](#prerequisites) - [Multi Architecture Support](#multi-architecture-support) - - [Obtaining a ShipXplorer Sharing Key](#obtaining-a-shipxplorer-sharing-key) - [Up-and-Running with Docker Compose](#up-and-running-with-docker-compose) - - [Claiming Your ShipXplorer Receiver](#claiming-your-shipxplorer-receiver) - [Runtime Environment Variables](#runtime-environment-variables) - - [Feeding Other Service](#feeding-other-service) + - [SDR and Receiver Related Variables](#sdr-and-receiver-related-variables) + - [Website Related Parameters](#website-related-parameters) + - [Feeding AIS Aggregator Services](#feeding-ais-aggregator-services) + - [Easy sharing with other services](#easy-sharing-with-other-services) - [Exchanging data with `aiscatcher.org`](#exchanging-data-with-aiscatcherorg) - - [Feeding Services Using UDP](#feeding-services-using-udp) - - [Feeding Service Using HTTP](#feeding-service-using-http) - - [Feeding `aprs.fi`](#feeding-aprsfi) - - [Feeding `airframes.io`](#feeding-airframesio) + - [Configuring feeding to ShipXplorer](#configuring-feeding-to-shipxplorer) + - [Obtaining a ShipXplorer Sharing Key](#obtaining-a-shipxplorer-sharing-key) + - [Claiming Your ShipXplorer Receiver](#claiming-your-shipxplorer-receiver) + - [Adding Additional Command-line Parameters to `sxfeeder`](#adding-additional-command-line-parameters-to-sxfeeder) + - [Workaround for CPU Serial (only needed when feeding ShipXplorer with non-Raspberry Pi systems)](#workaround-for-cpu-serial-only-needed-when-feeding-shipxplorer-with-non-raspberry-pi-systems) + - [Feeding Additional Services Using UDP](#feeding-additional-services-using-udp) + - [Feeding Additional Services Using HTTP](#feeding-additional-services-using-http) - [Adding an `About` Page to the AIS-Catcher Website](#adding-an-about-page-to-the-ais-catcher-website) - [Logging](#logging) - - [Workaround for CPU Serial (only needed with non-Raspberry Pi systems)](#workaround-for-cpu-serial-only-needed-with-non-raspberry-pi-systems) - - [Feeding other services](#feeding-other-services) - [AIS-Catcher Web Plugin Support and AIS-Catcher Persistency](#ais-catcher-web-plugin-support-and-ais-catcher-persistency) - [Additional Statistics Dashboard with Prometheus and Grafana](#additional-statistics-dashboard-with-prometheus-and-grafana) + - [Configuring 2 SDRs for Reception on Channels AB and CD](#configuring-2-sdrs-for-reception-on-channels-ab-and-cd) - [Aggregating multiple instances of the container](#aggregating-multiple-instances-of-the-container) - [Hardware requirements](#hardware-requirements) - [Getting Help](#getting-help) -Docker container running [AirNav ShipXplorer](https://www.shipxplorer.com)'s `sxfeeder` and `AIS-catcher`. Builds and runs on `arm64`, `armv7/armhf`, and `amd64/x86`. - -`AIS-catcher` pulls AIS information from a RTL-SDR dongle. -`sxfeeder` sends this data to RadarBox. - -You can also use this container to feed other AIS services that take NMEA-formatted AIS data over either UDP or HTTP. See below for details. +Docker container for feeding many AIS aggregators, showing a local map with ships heard, etc. The container uses [AIS-Catcher](https://aiscatcher.org) and also includes [AirNav ShipXplorer](https://www.shipxplorer.com)'s `sxfeeder`. Builds and runs on `arm64`, `armv7/armhf`, and `amd64/x86`. ## Prerequisites @@ -52,44 +50,6 @@ Currently, this image should pull and run on the following architectures: Other architectures (Windows, Mac) are not currently supported, but feel free to see if the container builds and runs for these. In theory, it should work, but I don't have the time nor inclination to test it. -## Obtaining a ShipXplorer Sharing Key - -First-time users should obtain a ShipXplorer sharing key. - -In order to obtain a ShipXplorer sharing key, on the first run of the container, it will generate a sharing key and print this to the container log. If you can't find it, you can also copy and paste this command: - -```bash -timeout 180s docker run \ - --rm \ - -it \ - --entrypoint /usr/bin/get-creds \ - ghcr.io/sdr-enthusiasts/shipxplorer:latest -``` - -This will run the container for 3 minutes, allowing a sharing key to be generated. -Shortly after, you will see something like this: - -```text -WARNING: SHARING_KEY or SERIAL_NUMBER environment variable was not set! -Please make sure you note down the keys generated and update your docker-compose.yml with these values. -Set environment var SHARING_KEY to the new key displayed below - this is the long hex number -Set environment var SERIAL_NUMBER to the Serial Number displayed below - this is the SXTRPIxxxxxx string -They must be set for this container to run. -Please set it and restart the container. - -[2022-11-01 19:48:19] Your new key is f1xxxxxxxxxxxxxxxxxxxxxxxx57 and Serial Number (SN) is SXTRPIxxxxxx. -Please save this key for future use. You will have to know this key to link this receiver to your account -in https://www.shipxplorer.com/. This key is also saved in configuration file (/etc/sxfeeder.ini) -``` - -You can wait for the 3 minutes to pass, or you can press CTRL-C now to finish. -Take a note of the Sharing Key (`f1...57` - yours will be a different number) and the Serial Number (`SXTRPIxxxxxx`), and add these to the `SHARING_KEY` and `SERIAL_NUMBER` parameters of your `docker-compose.yml` file. - -If you're not a first time user and are migrating from another installation, you can retrieve your sharing key by doing this: - -- SSH onto your existing receiver and run the command `cat /etc/sxfeeder.ini` -The `key` and `sn` lines show your current credentials - ## Up-and-Running with Docker Compose Example `docker-compose.yml` extract @@ -97,10 +57,10 @@ Example `docker-compose.yml` extract ```yaml version: '3.8' services: - shipxplorer: - image: ghcr.io/sdr-enthusiasts/shipxplorer - container_name: shipxplorer - hostname: shipxplorer + shipfeeder: + image: ghcr.io/sdr-enthusiasts/docker-shipfeeder + container_name: shipfeeder + hostname: shipfeeder restart: always environment: - VERBOSE_LOGGING= @@ -126,7 +86,7 @@ services: volumes: - "/etc/localtime:/etc/localtime:ro" - "/etc/timezone:/etc/timezone:ro" - - "/opt/ais/shipxplorer/data:/data" + - "/opt/ais/shipfeeder/data:/data" labels: - "com.centurylinklabs.watchtower.scope=ais" ``` @@ -148,140 +108,200 @@ SX_STATION_NAME=My_station_name_single_string_no_spaces_but_html_char_encoding_i Replace the `SHARING_KEY`, `SERIAL_NUMBER`, and `RTLSDR_DEVICE_SERIAL` with the appropriate values. You can use `rtl_test` to see which devices and device serials are connected to your machine, or `rtl_eeprom` to rename the device's serial number. -In `SX_EXTRA_OPTIONS`, the `-p` directive indicates the PPM value of your SDR. Adapt it to your needs. - -## Claiming Your ShipXplorer Receiver - -Once your container is up and running, you should claim your receiver. - -1. Go to -2. Create an account or sign in -3. Claim your receiver by visiting and following the instructions - -Note - you will need your `SHARING_KEY` and the location of your feeder (coordinates or pick on map). As of now, it appears that you don't need your SN or Public IP address. +In `SX_EXTRA_OPTIONS`, the `-p` directive indicates the PPM value of your SDR. Adapt it to your needs. ## Runtime Environment Variables -There are a series of available environment variables: - -| Environment Variable | Purpose | -| ---------------------- | ------------------------------- | -| `SHARING_KEY` | Sharing Key generated by `sxfeeder`. See instructions above. If unset, then no data will be sent to ShipXplorer but the container can still be used to feed other services without feeding ShipXplorer | -| `SERIAL_NUMBER` | Required. Serial Number generated by `sxfeeder`. See instructions above | -| `RTLSDR_DEVICE_SERIAL` | Required. Serial Number of your RTL-SDR dongle. See instructions above | -| `UDP_FEEDS` | Optional. Defines target UDP feeds in addition to ShipExplorer. Format: `UDP_FEEDS=domain1.com:port1[:params],domain2,com:port2[:params],...` | -| `VERBOSE_LOGGING` | Optional. If empty, a summary is displayed every 60 seconds. If set to a number (`0`-`5`), it's set to the `AIS-Catcher -o` [log level](https://github.com/jvde-github/AIS-catcher#usage). Any other non-empty string corresponds to `-o 2`. To silence `AIS-Catcher` logs, set this parameter to `0` | -| `RTLSDR_DEVICE_GAIN` | Optional. SDR device gain. If omitted, default value is 33.3 is used. Can also be set to `auto` | -| `AISCATCHER_EXTRA_OPTIONS` | Optional. Any additional command line parameters you wish to pass to `AIS-catcher`. Default: empty | -| `SXFEEDER_EXTRA_OPTIONS` | Optional. Any additional command line parameters you wish to pass to `sxfeeder`. Default: empty | -| `PLUGINS_FILE` | Optional. Load a file with custom javascript to override parts of the WebUI or add functionality. Map the container `/data` to any volume, place your file inside the volume and put the file name here (for example `plugins.js`) | -| `STYLES_FILE` | Optional. Load a file with custom css to override parts of the WebUI or add functionality. Map the container `/data` to any volume, place your file inside the volume and put the file name here (for example `styles.css`) | -| `STATION_NAME` | Optional. Station name displayed on stat web page. If omitted, it will should your ShipXplorer Serial Number | -| `STATION_LINK` | Optional. URL displayed on stat web page. If omitted, it will show your ShipXplorer URL | -| `STATION_HISTORY` | Optional. The number of seconds of history that will be shown in plots on the website. Default if omitted: `3600` (1 hour) | -| `BACKUP_INTERVAL` | Optional. How often a file with data statistics (`aiscatcher.bin`) will be written to disk, in minutes. In order to make this backup persistent, make sure to map the `/data` directory to a volume. See example in [docker-compose.yml](docker-compose.yml). Default: 2880 minutes (=2 days) | -| `BACKUP_RETENTION_TIME` | Time (in days) to keep backups of `aiscatcher.bin` and plugins. Note - this only affects the backups of these files and not the active `aiscatcher.bin` or active plugins. Default value is `30` (days) | -| `SITESHOW` | Optional. If set to anything non-empty, it will show the station location as a dot on the map | -| `SXFEEDER_LAT` | Optional. Used for calculating ship distances on web page | -| `SXFEEDER_LON` | Optional. Used for calculating ship distances on web page | -| `PROMETHEUS_ENABLE` | Optional. Enables Prometheus data at `/metrics` on the webserver. Empty (disabled) by default | -| `DISABLE_SHOWLASTMSG` | Optional. If set to `true`, the last NMEA0182 message option won't be shown on the website. Default empty (`false`, i.e., last message option is available on website) | -| `DISABLE_WEBSITE` | Optional. If set to `true`, the AIS-Catcher website will not be available. Default empty (`false`, i.e., the website is available) | -| `PLUGIN_UPDATE_INTERVAL` | Optional. Set this to the interval (for example, `30` (secs) or `5m` or `6h` or `3d`) to check the AIS-Catcher github repository for updates to the JavaScript web plugins. Set to `0` or `off` to disable checking. Default value: `6h` | -| `REFRESHRATE` | Refresh rate of the vessel data on the web page, in msec. Larger numbers reduce web page traffic, which can become an issue if there are a large number of vessels. Default value: `2500` (msec) | -| `AISCATCHER_SHAREDATA` | Optional but highly recommended. If set to `true`, share your NMEA AIS data with aiscatcher.org and receive other ship data in return. Only raw NMEA data is shared, no personal information is transmitted. See [here](https://github.com/jvde-github/AIS-catcher#update-join-our-mission-to-enhance-ais-catcher) for more information | - -## Feeding Other Service +### SDR and Receiver Related Variables + +| Environment Variable | Purpose | Default value if omitted | +| ---------------------- | ------------------------------- | --- | +| `RTLSDR_DEVICE_SERIAL` | Serial Number of your RTL-SDR dongle | Empty | +| `RTLSDR_DEVICE_GAIN` | SDR device gain. Can also be set to `auto` | `33` | +| `RTLSDR_DEVICE_PPM`| PPM deviation of your RTLSDR device | Empty | +| `RTLSDR_DEVICE_BANDWIDTH` | Channel bandwitdh of the receiver | `192K` | +| `AISCATCHER_CHANNELS` | Channels flag for `ais-catcher`. Set to `AB`, `CD`, or `AB CD` | Empty | +| `AISCATCHER_DECODER_MODEL` | Decoder model number for `ais-catcher` | `2` | +| `AISCATCHER_DECODER_AFC_WIDE` | `-go AFC_WIDE` flag for `ais-catcher`. Recommended to set to `on` | `on` | +| `AISCATCHER_DECODER_FP_DS` | `-go PF_DS` flag for `ais-catcher` | Empty | +| `AISCATCHER_DECODER_PS_EMA` | `-go PS_EMA` flag for `ais-catcher` | Empty | +| `AISCATCHER_DECODER_SOXR` | `-go SOXR` flag for `ais-catcher` | Empty | +| `AISCATCHER_DECODER_SRC` | `-go SRC` flag for `ais-catcher` | Empty | +| `AISCATCHER_DECODER_DROOP` | `-go DROOP` flag for `ais-catcher` | Empty | +| `AISCATCHER_EXTRA_OPTIONS` | Any additional command line parameters you wish to pass to `AIS-catcher` | Empty | +| `VERBOSE_LOGGING` | If set to a number (`0`-`5`), it's set to the `AIS-Catcher -o` [log level](https://github.com/jvde-github/AIS-catcher#usage). Any other non-empty string corresponds to `-o 2`. To silence `AIS-Catcher` logs, set this parameter to `0` | `2` (a summary is displayed every 60 seconds) | + +If the `AISCATCHER_CHANNELS` and `AISCATCHER_DECODER_XXXX` parameters listed above are set, they will overwrite/remove any equivalent parameters added to the `AISCATCHER_EXTRA_OPTIONS` parameter. + +### Website Related Parameters + +| Environment Variable | Purpose | Default value if omitted | +| `DISABLE_WEBSITE` | If set to `true`, the AIS-Catcher website will not be available | `false` | +| `PLUGINS_FILE` | Load a file with custom javascript to override parts of the WebUI or add functionality. Map the container `/data` to any volume, place your file inside the volume and put the file name here (for example `plugins.js`) | Empty | +| `STYLES_FILE` | Load a file with custom css to override parts of the WebUI or add functionality. Map the container `/data` to any volume, place your file inside the volume and put the file name here (for example `styles.css`) | Empty | +| `STATION_NAME` | Station name displayed on stat web page | Empty | +| `STATION_LINK` | URL displayed on stat web page | Empty | +| `STATION_HISTORY` | The number of seconds of history that will be shown in plots on the website | `3600` | +| `BACKUP_INTERVAL` | How often a file with data statistics (`aiscatcher.bin`) will be written to disk, in minutes. In order to make this backup persistent, make sure to map the `/data` directory to a volume. See example in [docker-compose.yml](docker-compose.yml). | `2880` (=2 days) | +| `BACKUP_RETENTION_TIME` | Time (in days) to keep backups of `aiscatcher.bin` and plugins. Note - this only affects the backups of these files and not the active `aiscatcher.bin` or active plugins. | `30` (days) | +| `SITESHOW` | If set to anything non-empty, it will show the station location as a dot on the map | Empty | +| `SXFEEDER_LAT` or `FEEDER_LAT` | Used for calculating ship distances on web page | Empty | +| `SXFEEDER_LON` or `FEEDER_LONG` | Used for calculating ship distances on web page | Empty | +| `DISABLE_SHOWLASTMSG` | If set to `true`, the last NMEA0182 message option won't be shown on the website. | Empty, i.e., last message option is available on website | +| `PLUGIN_UPDATE_INTERVAL` | Optional. Set this to the interval (for example, `30` (secs) or `5m` or `6h` or `3d`) to check the AIS-Catcher github repository for updates to the JavaScript web plugins. Set to `0` or `off` to disable checking. | `6h` | +| `REFRESHRATE` | Refresh rate of the vessel data on the web page, in msec. Larger numbers reduce web page traffic, which can become an issue if there are a large number of vessels | `2500` (msec) | + +## Feeding AIS Aggregator Services + +### Easy sharing with other services + +This table shows which parameters to set and how to obtain credentials for a number of well-known AIS aggregators: + + | Name | Parameter | Default IP/DNS/URL | Feeding protocol:
UDP/TCP/HTTP/Other | How to register for a key or ID | + | ---- | --------- | ------------------ | --------------------------------------- | ------------------------------- | + | ADSB-Network (RadarVirtuel) | `RADARVIRTUEL_FEEDER_KEY`
`RADARVIRTUEL_STATION_ID` | [https://ais.adsbnetwork.com/ingester/insert/$RADARVIRTUEL_FEEDER_KEY](https://ais.adsbnetwork.com/ingester/insert/$RADARVIRTUEL_FEEDER_KEY) | HTTP | Email with your request to join | + | Airframes | `AIRFRAMES_STATION_ID` | [http://feed.airframes.io:5599](http://feed.airframes.io:5599) | HTTP | No signup needed. `AIRFRAMES_STATION_ID` is a self-chosen ID that has the form of `II-STATIONNAME-AIS`, where `II` are the initials of the owner's name, and `STATIONNAME` is a self-chosen station name (A-Z, 0-9 only please) | + | AIS-Catcher | `AISCATCHER_SHAREDATA=true`
`AISCATCHER_FEEDER_KEY` | | Other | See [Exchanging data with `aiscatcher.org`](#exchanging-data-with-aiscatcherorg) [https://aiscatcher.org/#join](https://aiscatcher.org/#join). In the future, AISCatcher may provide you with an optional UUID that you can set in `AISCATCHER_FEEDER_KEY` | + | AISHub | `AISHUB_UDP_PORT` | [data.aishub.net](http://data.aishub.net) | UDP | [https://www.aishub.net/join-us](https://www.aishub.net/join-us) | + | [APRS.fi](http://APRS.fi) | `APRSFI_FEEDER_KEY`
`APRSFI_STATION_ID` | [http://aprs.fi/jsonais/post/$APRS_FEEDER_KEY](http://aprs.fi/jsonais/post/$APRS_FEEDER_KEY) | HTTP | Get AIS Password (`APRSFI_FEEDER_KEY`) at [https://aprs.fi/?c=account](https://aprs.fi/?c=account). Use your Ham Radio callsign for `APRSFI_STATION_ID`. Both fields are mandatory. | + | BoatBeacon | `BOATBEACON_SHAREDATA=true` | [boatbeaconapp.com:5322](http://boatbeaconapp.com:5322) | UDP | [https://pocketmariner.com/ais-ship-tracking/cover-your-area/set-up-and-ais-shore-station/](https://pocketmariner.com/ais-ship-tracking/cover-your-area/set-up-and-ais-shore-station/) - no keys or IDs are required | + | HPRadar | `HPRADAR_UDP_PORT` | [aisfeed.hpradar.com](http://aisfeed.hpradar.com) | UDP | | + | MarineTraffic | `MARINETRAFFIC_UDP_PORT` | 5.9.207.224 | UDP | [https://www.marinetraffic.com/en/join-us/cover-your-area](https://www.marinetraffic.com/en/join-us/cover-your-area) | + | MyShipTracking | `MYSHIPTRACKING_UDP_PORT` | 178.162.215.175 | UDP | [https://www.myshiptracking.com/help-center/contributors/add-your-station](https://www.myshiptracking.com/help-center/contributors/add-your-station) | + | ShipFinder | `SHIPFINDER_SHAREDATA=true` | [ais.shipfinder.co.uk:4001](http://ais.shipfinder.co.uk:4001/) | UDP | [https://shipfinder.co/about/coverage/](https://shipfinder.co/about/coverage/) | + | ShippingExplorer | `SHIPPINGEXPLORER_UDP_PORT` | 144.76.54.111 | UDP | Request UDP port at [https://www.shippingexplorer.net/en/contact](https://www.shippingexplorer.net/en/contact) | + | ShipXplorer | `SHIPXPLORER_FEEDER_KEY` or `FEEDER_KEY` (legacy)
`SHIPXPLORER_SERIAL_NUMBER` or `SERIAL_NUMBER` (legacy) | | Other | See [Obtaining a ShipXplorer Sharing Key](#obtaining-a-shipxplorer-sharing-key) | + | VesselFinder | `VESSELFINDER_UDP_PORT` | [ais.vesselfinder.com](http://ais.vesselfinder.com) | UDP | [https://stations.vesselfinder.com/become-partner](https://stations.vesselfinder.com/become-partner) | + | VesselTracker | `VESSELTRACKER_UDP_PORT` | 83.220.137.136 | UDP | [https://www.vesseltracker.com/en/static/antenna-partner.html](https://www.vesseltracker.com/en/static/antenna-partner.html) | + +Note: for all parameters `SERVICE_UDP_PORT`, you may use one of the following formats: + +- `- SERVICE_UDP_PORT=1234` --> use UDP port 1234 +- `- SERVICE_UDP_PORT=hostname:1234` or `- SERVICE_UDP_PORT=ip_addr:1234` --> use the hostname or ip address instead of the one indicated in the table, and UDP port 1234 + +For services that do no need any UDP ports or credentials, you can simply set `- SERVICE_SHAREDATA=true`. However, if you want to use a non-default port and/or hostname/ip, you can set also `SERVICE_UDP_PORT` (as shown above) for that service ### Exchanging data with `aiscatcher.org` -[aiscatcher.org](https://aiscatcher.org) is an exchange of AIS NMEA data. If you share your data with this server, you automatically receive data about other ships in return. We recommend to switch this on for an optimal viewing experience. -You can enable it by simply adding this to the environment section of your `shipxplorer` service section in `docker-compose.yml`: +[aiscatcher.org](https://aiscatcher.org) is an exchange of AIS NMEA data. If you share your data with this server, you automatically receive data about other ships in return. **We recommend to switch this on for an optimal viewing experience.** +You can enable it by simply adding the following to the environment section of your `shipfeeder` service section in `docker-compose.yml`. Note that the `AISCATCHER_SHAREKEY` parameter is optional and will be ignored for now, pending implementation of this feature by AIS-Catcher. ```yaml - AISCATCHER_SHAREDATA=true +- AISCATCHER_SHAREKEY=xxxxxxxx ``` -### Feeding Services Using UDP +### Configuring feeding to ShipXplorer -Simply add a comma separated list of hostnames/ip addresses and UDP ports to the `SX_UDP_FEEDS` parameter. For example: +#### Obtaining a ShipXplorer Sharing Key + +First-time users should obtain a ShipXplorer sharing key. + +In order to obtain a ShipXplorer sharing key, on the first run of the container, it will generate a sharing key and print this to the container log. If you can't find it, you can also copy and paste this command: ```bash -SX_UDP_FEEDS=1.2.3.4:9999,ais.aggregator.org:1234 +timeout 180s docker run \ + --rm \ + -it \ + --entrypoint /usr/bin/get-creds \ + ghcr.io/sdr-enthusiasts/shipxplorer:latest ``` -### Feeding Service Using HTTP - -#### Feeding `aprs.fi` +This will run the container for 3 minutes, allowing a sharing key to be generated. +Shortly after, you will see something like this: -To feed `aprs.fi` using HTTP, you firwst need to create an AIS feeder account at that service. Note that creating accounts is limited to licensed amateur radio operators. With this account, you can create a personalized feeder URL, for example `http://aprs.fi/jsonais/post/aBcDeFgHiJkL`. -To initiate feeding, add the following to the `AISCATCHER_EXTRA_OPTIONS` parameter (replace the URL with your personalized link, and `MY0CALL` with your registered amateur radio callsign): +```text +WARNING: SHARING_KEY or SERIAL_NUMBER environment variable was not set! +Please make sure you note down the keys generated and update your docker-compose.yml with these values. +Set environment var SHARING_KEY to the new key displayed below - this is the long hex number +Set environment var SERIAL_NUMBER to the Serial Number displayed below - this is the SXTRPIxxxxxx string +They must be set for this container to run. +Please set it and restart the container. -```bash -AISCATCHER_EXTRA_OPTIONS=-H http://aprs.fi/jsonais/post/aBcDeFgHiJkL ID MY0CALL PROTOCOL aprs INTERVAL 30 RESPONSE off +[2022-11-01 19:48:19] Your new key is f1xxxxxxxxxxxxxxxxxxxxxxxx57 and Serial Number (SN) is SXTRPIxxxxxx. +Please save this key for future use. You will have to know this key to link this receiver to your account +in https://www.shipxplorer.com/. This key is also saved in configuration file (/etc/sxfeeder.ini) ``` -#### Feeding `airframes.io` +You can wait for the 3 minutes to pass, or you can press CTRL-C now to finish. +Take a note of the Sharing Key (`f1...57` - yours will be a different number) and the Serial Number (`SXTRPIxxxxxx`), and add these to the `SHARING_KEY` and `SERIAL_NUMBER` parameters of your `docker-compose.yml` file. -Since feeding `airframes.io` is still in a private alpha phase, you need to contact them to obtain a URL and be granted access to their private ZeroTier network. Once you have this all squared, you should add the following to the `AISCATCHER_EXTRA_OPTIONS` parameter: +If you're not a first time user and are migrating from another installation, you can retrieve your sharing key by doing this: -```bash -AISCATCHER_EXTRA_OPTIONS=-H http://1.2.3.4/test ID my_station_name INTERVAL 30 RESPONSE off -``` +- SSH onto your existing receiver and run the command `cat /etc/sxfeeder.ini` +The `key` and `sn` lines show your current credentials -Note: if you want to feed multiple HTTP aggregators, you can simply append each feeder string to the `AISCATCHER_EXTRA_OPTIONS` variable. For example: +#### Claiming Your ShipXplorer Receiver -```bash -AISCATCHER_EXTRA_OPTIONS=-H http://aprs.fi/jsonais/post/aBcDeFgHiJkL ID MY0CALL PROTOCOL aprs INTERVAL 30 RESPONSE off -H http://1.2.3.4/test ID my_station_name INTERVAL 30 RESPONSE off -``` +Once your container is up and running, you should claim your receiver. -## Adding an `About` Page to the AIS-Catcher Website +1. Go to +2. Create an account or sign in +3. Claim your receiver by visiting and following the instructions -You can add an About page to the AIS-Catcher Website by placing a file called `about.md` in the `/data` directory of the container. If you mapped this directory to a volume as shown in the example, the file as seen from the host system would be `/opt/ais/shipxplorer/about.md`. -You can format the text in this file using [Markdown](https://www.markdownguide.org/cheat-sheet/). +Note - you will need your `SHARING_KEY` and the location of your feeder (coordinates or pick on map). As of now, it appears that you don't need your SN or Public IP address. -## Logging +#### Adding Additional Command-line Parameters to `sxfeeder` -- All processes are logged to the container's stdout, and can be viewed with `docker logs [-f] container`. +`sxfeeder` is the binary component that is used to feed data to ShipXplorer. Normally, you don't have to interact with it, but exceptional circumstances may arise where you would like to add additional command line parameters to this program. You can do so, by adding them as follows: + +| Environment Variable | Purpose | Default value if omitted | +| --- | --- | --- | +| `SXFEEDER_EXTRA_OPTIONS` | Any additional command line parameters you wish to pass to `sxfeeder` | Empty | -## Workaround for CPU Serial (only needed with non-Raspberry Pi systems) +#### Workaround for CPU Serial (only needed when feeding ShipXplorer with non-Raspberry Pi systems) The `sxfeeder` binary effectively greps for `serial\t\t:` in your `/proc/cpuinfo` file, to determine the RPi's serial number. For systems that don't have a CPU serial number in `/proc/cpuinfo`, we can "fudge" this by generating a replacement `cpuinfo` file with a random serial number. To do this, copy and paste the following on your host machine: ```bash -sudo mkdir -m777 -p /opt/shipxplorer/cpuinfo -sudo install -m 666 /proc/cpuinfo /opt/shipxplorer/cpuinfo/ -echo -e "serial\t\t: $(hexdump -n 8 -e '4/4 "%08X" 1 "\n"' /dev/urandom | tr '[:upper:]' '[:lower:]')" >> /opt/shipxplorer/cpuinfo/cpuinfo +sudo mkdir -m777 -p /opt/shipfeeder/cpuinfo +sudo install -m 666 /proc/cpuinfo /opt/shipfeeder/cpuinfo/ +echo -e "serial\t\t: $(hexdump -n 8 -e '4/4 "%08X" 1 "\n"' /dev/urandom | tr '[:upper:]' '[:lower:]')" >> /opt/shipfeeder/cpuinfo/cpuinfo ``` You can now map this file into your container: -- If using docker run, simply add `-v /opt/shipxplorer/cpuinfo/cpuinfo:/proc/cpuinfo` to your command. -- If using docker-compose, add the following to the `volumes:` section of your shipxplorer container definition: +- If using docker run, simply add `-v /opt/shipfeeder/cpuinfo/cpuinfo:/proc/cpuinfo` to your command. +- If using docker-compose, add the following to the `volumes:` section of your shipfeeder container definition: ```yaml - - /opt/shipxplorer/cpuinfo/cpuinfo:/proc/cpuinfo + - /opt/shipfeeder/cpuinfo/cpuinfo:/proc/cpuinfo ``` -## Feeding other services +### Feeding Additional Services Using UDP -You can use the `UDP_FEEDS` parameter to feed additional services, as long as they can accept the UDP data format. for example to feed MarineTraffic: +If you want to feed and additional AIS aggregator that uses a hostname/UDP port and that is not listed above, then simply add a comma separated list of hostnames/ip addresses and UDP ports to the `UDP_FEEDS` parameter. Format: `UDP_FEEDS=domain1.com:port1[:params],domain2,com:port2[:params],...` + +For example: ```yaml - - UDP_FEEDS=5.9.207.224:5321 +- UDP_FEEDS=1.2.3.4:9999,ais.aggregator.org:1234 ``` -If you signed up and configured a station at their website, please replace the IP:port by the one allocated to your station. You can add multiple comma-separated UDP feeds here. +### Feeding Additional Services Using HTTP -If you have a Ham Radio license, you can also feed to `aprs.fi` via HTTP. In this case, configure `AISCATCHER_EXTRA_OPTIONS` like this: +To feed additional AIS aggregators that are not listed above using HTTP, you first need to create an AIS feeder account at that service. They will provide you with a URL and any additional parameters you need to configure AIS-Catcher. For example: ```yaml - - AISCATCHER_EXTRA_OPTIONS=-H http://aprs.fi/jsonais/post/abcdefghijklmn ID C9LLSIGN PROTOCOL aprs INTERVAL 30 RESPONSE off +- AISCATCHER_EXTRA_OPTIONS=-H http://1.2.3.4/test ID my_station_name INTERVAL 30 RESPONSE off ``` -where you replace `abcdefghijklmn` with the key you get when you sign up at aprs.fi, and `C9LLSIGN` with your Ham Radio callsign. +Note: if you want to feed multiple HTTP aggregators, you can simply append each feeder string to the `AISCATCHER_EXTRA_OPTIONS` variable with a space in between them. For example: + +```yaml +- AISCATCHER_EXTRA_OPTIONS=-H http://5.6.7.8/test/post/aBcDeFgHiJkL ID MYSTATION PROTOCOL aprs INTERVAL 30 RESPONSE off -H http://1.2.3.4/test ID my_station_name INTERVAL 30 RESPONSE off JSON on +``` + +## Adding an `About` Page to the AIS-Catcher Website + +You can add an About page to the AIS-Catcher Website by placing a file called `about.md` in the `/data` directory of the container. If you mapped this directory to a volume as shown in the example, the file as seen from the host system would be `/opt/ais/shipfeeder/about.md`. +You can format the text in this file using [Markdown](https://www.markdownguide.org/cheat-sheet/). + +## Logging + +- All processes are logged to the container's stdout, and can be viewed with `docker logs [-f] container`. ## AIS-Catcher Web Plugin Support and AIS-Catcher Persistency @@ -291,43 +311,51 @@ Web Plugins for AIS-Catcher can be placed in the `/data/plugins` directory. ## Additional Statistics Dashboard with Prometheus and Grafana -See [this readme](README-grafana.md) for information on how to set up and configure a Grafana stats dashboard for use with ShipXplorer. +See [this readme](README-grafana.md) for information on how to set up and configure a Grafana stats dashboard for use with shipfeeder. +Make sure to set this parameter to enable Prometheus data for the container: -## Aggregating multiple instances of the container +| Environment Variable | Purpose | Default value if omitted | +| --- | --- | --- | +| `PROMETHEUS_ENABLE` | If set to `true`, enables Prometheus data at `/metrics` on the webserver. | Empty (disabled) | -Sometimes it's convenient to aggregate the data of multiple instances of the container into a single one, and then feed the AIS aggregators from this "central" instance. An example of this is when you have a SDR receiving from channels AB in one instance, and a SDR receiving from channels CD in a separate instance. In this case, you'd want to send the data from channels CD to the instance that (also) receives channels AB, and then use the Channel AB instance to disperse the data to the various services. +## Configuring 2 SDRs for Reception on Channels AB and CD -In this case, do the following. We are assuming that the hostname/container name for the instance receiving channels AB is `shipxplorer_ab` and the hostname/container name for the instance receiving channels CD is `shipxplorer_cd`. Your names may vary. +If you want `shipfeeder` to use 2 SDRs to listen to AIS Channels AB and CD at the same time, you can do the following -Situation 1: both instances are in the same container stack, on the same machine: - -- In the section of the `docker-compose.yml` file for `shipxplorer_ab`, make sure to add the following to the `UDP_FEEDS` parameter: +- Configure your first SDR (for use with channels AB) via the "normal" [`RTLSDR_DEVICE_XXXX` parameters](#sdr-and-receiver-related-variables) +- Configure the second SDR using the `AISCATCHER_EXTRA_OPTIONS` parameter as follows (replace `SDR2-SERIAL` with the Serial Number of your second SDR): ```yaml - - UDP_FEEDS=.....;shipxplorer_cd:9988 JSON on +- AISCATCHER_EXTRA_OPTIONS=-d SDR2-SERIAL -p 2 -a 192K -c CD -gr tuner auto rtlagc ON -v 60 ``` -- In the section of the `docker-compose.yml` file for `shipxplorer_cd`, make sure to add the following to the `UDP_FEEDS` parameter. Make sure that the name after `-x` matches your container name: +- Subsequently, you can also add separate web pages for each SDR individually. The "normal" web interface on port `80` will show the combined receivers, while the following adds new web interfaces on ports `81` for your Channels AB receiver, and on port `82` for your Channels CD receiver. You can add this to the end of the `AISCATCHER_EXTRA_OPTIONS` parameter, replacing `SDR1_SERIAL` and `SDR2_SERIAL` with the two serial IDs of the SDRs, and adjusting the other parameters as appropriate: ```yaml - - AISCATCHER_EXTRA_OPTIONS=...... -x shipxplorer_cd 9988 -c AB CD +- AISCATCHER_EXTRA_OPTIONS=... -N 81 GROUPS_IN 1 STATION SDR1-SERIAL FILE /data/aiscatcher-ab.bin PLUGIN_DIR /data/plugins BACKUP 5 HISTORY 3600 STATION_LINK https://my.ais-station.com LAT xx.xxxx LON yy.yyyy SHARE_LOC on MESSAGE on REALTIME on -N 82 GROUPS_IN 2 STATION SDR2_SERIAL FILE /data/aiscatcher-cd.bin PLUGIN_DIR /data/plugins BACKUP 5 HISTORY 3600 STATION_LINK https://my.ais-station.com LAT xx.xxxx LON yy.yyyy SHARE_LOC on MESSAGE on REALTIME on ``` -Situation 2: both instances are on different machines or in different stacks on the same machine: +## Aggregating multiple instances of the container + +Sometimes it's convenient to aggregate the data of multiple instances of the container into a single one, and then feed the AIS aggregators from this "central" instance. An example of this is when you have a SDR receiving from channels AB in one instance, and a SDR receiving from channels CD in a separate instance on another machine. (If you have both SDRs on the same machine, you can use a single container instance for both of them as described above). In our case, you'd want to send the data from channels CD to the instance that (also) receives channels AB, and then use the Channel AB instance to disperse the data to the various services. + +Do the following. We are assuming that the hostname/container name for the instance receiving channels AB is `shipfeeder_ab` and the hostname/container name for the instance receiving channels CD is `shipfeeder_cd`. Your names may vary. + +Situation 1: both instances are in the same container stack, on the same machine: -- In the section of the `docker-compose.yml` file for `shipxplorer_ab`, make sure to add the following to the `UDP_FEEDS` parameter. Make sure that you replace `target_machine` with the IP or hostname of the target machine: +- In the section of the `docker-compose.yml` file for `shipfeeder_ab`, make sure to add the following to the `UDP_FEEDS` parameter. Make sure that you replace `target_machine` with the IP or hostname of the target machine: ```yaml - UDP_FEEDS=.....;target_machine:9988 ``` -- In the section of the `docker-compose.yml` file for `shipxplorer_cd`, make sure to add the following to the `UDP_FEEDS` parameter. Make sure that the name after `-x` matches your container name. (DO NOT USE `localhost` or `127.0.0.1` - that won't work): +- In the section of the `docker-compose.yml` file for `shipfeeder_cd`, make sure to add the following to the `UDP_FEEDS` parameter. Make sure that the name after `-x` matches your container name. (DO NOT USE `localhost` or `127.0.0.1` - that won't work): ```yaml - - AISCATCHER_EXTRA_OPTIONS=...... -x shipxplorer_cd 9988 -c AB CD + - AISCATCHER_EXTRA_OPTIONS=...... -x shipfeeder_cd 9988 -c AB CD ``` -- In addition, to the same section of the `docker-compose.yml` file for `shipxplorer_cd`, make sure to forward the UPD port to the container: +- In addition, to the same section of the `docker-compose.yml` file for `shipfeeder_cd`, make sure to forward the UPD port to the container: ```yaml ports: @@ -335,7 +363,7 @@ Situation 2: both instances are on different machines or in different stacks on - 9988:9988/udp ``` -Once you have done this, and after you recreate the containers, the `shipxplorer_cd` instance will now forward its data to `shipxplorer_ab`, and `shipxplorer_ab` will aggregate this data, display it on the AIS-Catcher map and tables, and forward it to any service you may have configured for it. +Once you have done this, and after you recreate the containers, the `shipfeeder_cd` instance will now forward its data to `shipfeeder_ab`, and `shipfeeder_ab` will aggregate this data, display it on the AIS-Catcher map and tables, and forward it to any service you may have configured for it. ## Hardware requirements @@ -345,6 +373,6 @@ Last - the software will run on a Raspberry Pi 3B+ or 4, with Raspberry Pi OS, U ## Getting Help -You can [log an issue](https://github.com/sdr-enthusiasts/docker-shipxplorer/issues) on the project's GitHub. +You can [log an issue](https://github.com/sdr-enthusiasts/docker-shipfeeder/issues) on the project's GitHub. I also have a [Discord channel](https://discord.gg/sTf9uYF), feel free to [join](https://discord.gg/sTf9uYF) and converse. diff --git a/rootfs/etc/s6-overlay/scripts/aiscatcher b/rootfs/etc/s6-overlay/scripts/aiscatcher index b605945..49f1ef1 100755 --- a/rootfs/etc/s6-overlay/scripts/aiscatcher +++ b/rootfs/etc/s6-overlay/scripts/aiscatcher @@ -91,13 +91,134 @@ if ! chk_enabled "${DISABLE_WEBSITE}"; then chk_enabled "${DISABLE_SHOWLASTMSG}" && true || aiscatcher_command+=("MESSAGE on") chk_enabled "${REALTIME}" && aiscatcher_command+=("REALTIME on") || true fi -chk_enabled "$AISCATCHER_SHAREDATA" && aiscatcher_command+=("-X") || true + +# Add a number of well-known feeders: +# ADSBNetwork / RadarVirtuel: +if [[ -n "${RADARVIRTUEL_FEEDER_KEY:+$RADARVIRTUEL_STATION_ID}" ]]; then + aiscatcher_command+=("-H https://ais.adsbnetwork.com/ingester/insert/$RADARVIRTUEL_FEEDER_KEY ID $RADARVIRTUEL_STATION_ID INTERVAL 15 RESPONSE off") +fi + +# AirFrames: +if [[ -n "$AIRFRAMES_STATION_ID" ]]; then + aiscatcher_command+=("-H http://feed.airframes.io:5599 ID $AIRFRAMES_STATION_ID INTERVAL 30 RESPONSE off") +fi + +# AIS-Catcher: +if chk_enabled "$AISCATCHER_SHAREDATA" && [[ -z "$AISCATCHER_FEEDER_KEY" ]]; then + aiscatcher_command+=("-X") + AISCATCHER_EXTRA_OPTIONS="$(sed -E 's/-X\s+[0-9]*\s*//g'<<< "$AISCATCHER_EXTRA_OPTIONS")" # Remove any -X from param to avoid duplication +elif [[ -n "$AISCATCHER_FEEDER_KEY" ]]; then + aiscatcher_command+=("-X $AISCATCHER_FEEDER_KEY") + AISCATCHER_EXTRA_OPTIONS="$(sed -E 's/-X\s+[0-9]*\s*//g'<<< "$AISCATCHER_EXTRA_OPTIONS")" # Remove any -X from param to avoid duplication +fi + +# AISHub: +if [[ -n "$AISHUB_UDP_PORT" ]]; then + if ! grep -q ":" $AISHUB_UDP_PORT; then AISHUB_UDP_PORT="data.aishub.net:$AISHUB_UDP_PORT"; fi + aiscatcher_command+=("-u ${AISHUB_UDP_PORT%%:*} ${AISHUB_UDP_PORT##*:}") +fi + +# aprs.fi: +if [[ -n "${APRSFI_FEEDER_KEY:+$APRSFI_STATION_ID}" ]]; then + aiscatcher_command+=("-H http://aprs.fi/jsonais/post/$APRSFI_FEEDER_KEY ID $APRSFI_STATION_ID PROTOCOL aprs INTERVAL 30 RESPONSE off") +fi + +# BoatBeacon: +if chk_enabled "$BOATBEACON_SHAREDATA"; then + aiscatcher_command+=("-u boatbeaconapp.com 5322") +elif [[ -n "$BOATBEACON_UDP_PORT" ]]; then + if ! grep -q ":" $BOATBEACON_UDP_PORT; then BOATBEACON_UDP_PORT="boatbeaconapp.com:$BOATBEACON_UDP_PORT"; fi + aiscatcher_command+=("-u ${BOATBEACON_UDP_PORT%%:*} ${BOATBEACON_UDP_PORT##*:}") +fi + +# HPRadar: +if [[ -n "$HPRADAR_UDP_PORT" ]]; then + if ! grep -q ":" $HPRADAR_UDP_PORT; then HPRADAR_UDP_PORT="aisfeed.hpradar.com:$HPRADAR_UDP_PORT"; fi + aiscatcher_command+=("-u ${HPRADAR_UDP_PORT%%:*} ${HPRADAR_UDP_PORT##*:} JSON on") +fi + +# MarineTraffic: +if [[ -n "$MARINETRAFFIC_UDP_PORT" ]]; then + if ! grep -q ":" $MARINETRAFFIC_UDP_PORT; then MARINETRAFFIC_UDP_PORT="5.9.207.224:$MARINETRAFFIC_UDP_PORT"; fi + aiscatcher_command+=("-u ${MARINETRAFFIC_UDP_PORT%%:*} ${MARINETRAFFIC_UDP_PORT##*:}") +fi + +# MyShipTracker: +if [[ -n "$MYSHIPTRACKER_UDP_PORT" ]]; then + if ! grep -q ":" $MYSHIPTRACKER_UDP_PORT; then MYSHIPTRACKER_UDP_PORT="178.162.215.175:$MYSHIPTRACKER_UDP_PORT"; fi + aiscatcher_command+=("-u ${MYSHIPTRACKER_UDP_PORT%%:*} ${MYSHIPTRACKER_UDP_PORT##*:}") +fi + +# ShippingExplorer: +if [[ -n "$SHIPPINGEXPLORER_UDP_PORT" ]]; then + if ! grep -q ":" $SHIPPINGEXPLORER_UDP_PORT; then SHIPPINGEXPLORER_UDP_PORT="144.76.54.111:$SHIPPINGEXPLORER_UDP_PORT"; fi + aiscatcher_command+=("-u ${SHIPPINGEXPLORER_UDP_PORT%%:*} ${SHIPPINGEXPLORER_UDP_PORT##*:}") +fi + +# ShipFinder: +if chk_enabled "$SHIPFINDER_SHAREDATA"; then + aiscatcher_command+=("-u ais.shipfinder.co.uk 4001") +elif [[ -n "$SHIPFINDER_UDP_PORT" ]]; then + if ! grep -q ":" $SHIPFINDER_UDP_PORT; then SHIPFINDER_UDP_PORT="ais.shipfinder.co.uk:$SHIPFINDER_UDP_PORT"; fi + aiscatcher_command+=("-u ${SHIPFINDER_UDP_PORT%%:*} ${SHIPFINDER_UDP_PORT##*:}") +fi + +# VesselFinder: +if [[ -n "$VESSELFINDER_UDP_PORT" ]]; then + if ! grep -q ":" $VESSELFINDER_UDP_PORT; then VESSELFINDER_UDP_PORT="ais.vesselfinder.com:$VESSELFINDER_UDP_PORT"; fi + aiscatcher_command+=("-u ${VESSELFINDER_UDP_PORT%%:*} ${VESSELFINDER_UDP_PORT##*:}") +fi + +# VesselTracker: +if [[ -n "$VESSELTRACKER_UDP_PORT" ]]; then + if ! grep -q ":" $VESSELFINDER_UDP_PORT; then VESSELTRACKER_UDP_PORT="83.220.137.136:$VESSELTRACKER_UDP_PORT"; fi + aiscatcher_command+=("-u ${VESSELTRACKER_UDP_PORT%%:*} ${VESSELTRACKER_UDP_PORT##*:}") +fi + aiscatcher_command+=("-u 127.0.0.1 34994") aiscatcher_command+=("-u 127.0.0.1 34995") aiscatcher_command+=("${FEEDSTRING[*]}") aiscatcher_command+=("$SHOWLOGS") -[[ -n "${RTLSDR_DEVICE_SERIAL}" ]] && aiscatcher_command+=("-d ${RTLSDR_DEVICE_SERIAL}") || true -[[ -n "${RTLSDR_DEVICE_SERIAL}" ]] && aiscatcher_command+=("-gr tuner ${RTLSDR_DEVICE_GAIN} rtlagc ON") +if [[ -n "${RTLSDR_DEVICE_SERIAL}" ]]; then + AISCATCHER_CHANNELS="${AISCATCHER_CHANNELS^^}"; aiscatcher_command+=("-c ${AISCATCHER_CHANNELS:-AB}") + #AISCATCHER_EXTRA_OPTIONS="$(sed -E 's/-c\s+[a-dA-D ]+//g' <<< "$AISCATCHER_EXTRA_OPTIONS")" # remove any -c items from param to avoid duplication + aiscatcher_command+=("-d ${RTLSDR_DEVICE_SERIAL}") + aiscatcher_command+=("-gr tuner ${RTLSDR_DEVICE_GAIN} rtlagc ON") + if [[ -n "${RTLSDR_DEVICE_PPM}" ]]; then + aiscatcher_command+=("-p ${RTLSDR_DEVICE_PPM}") + #AISCATCHER_EXTRA_OPTIONS="$(sed -E 's/-p\s+[0-9]+\s*//g'<<< "$AISCATCHER_EXTRA_OPTIONS")" # remove any -p items from param to avoid duplication + fi + if [[ -n "${RTLSDR_DEVICE_BANDWIDTH}" ]]; then + aiscatcher_command+=("-a ${RTLSDR_DEVICE_BANDWIDTH}") + #AISCATCHER_EXTRA_OPTIONS="$(sed -E 's/-a\s+[0-9]+[A-Za-z]{1}\s*//g'<<< "$AISCATCHER_EXTRA_OPTIONS")" # remove any -a items from param to avoid duplication + elif ! grep -qoE '\-a\s+[0-9]+[A-Za-z]{1}' <<< "$AISCATCHER_EXTRA_OPTIONS"; then + aiscatcher_command+=("-a 192K") + fi + if [[ -n "${AISCATCHER_DECODER_MODEL}" ]]; then + aiscatcher_command+=("-m ${AISCATCHER_DECODER_MODEL}") + fi + if [[ -n "$AISCATCHER_DECODER_AFC_WIDE$AISCATCHER_DECODER_FP_DS$AISCATCHER_DECODER_PS_EMA$AISCATCHER_DECODER_SOXR$AISCATCHER_DECODER_SRC$AISCATCHER_DECODER_DROOP" ]]; then + aiscatcher_command+=("-go") + if chk_enabled "$AISCATCHER_DECODER_AFC_WIDE" || \ + { [[ -z "$AISCATCHER_DECODER_AFC_WIDE" ]] && ! grep -qi 'AFC_WIDE' <<< "$AISCATCHER_EXTRA_OPTIONS"; }; then + aiscatcher_command+=("AFC_WIDE on") + fi + chk_disabled "$AISCATCHER_DECODER_AFC_WIDE" && aiscatcher_command+=("AFC_WIDE off") || true + chk_enabled "$AISCATCHER_DECODER_FP_DS" && aiscatcher_command+=("FP_DS on") || true + chk_disabled "$AISCATCHER_DECODER_FP_DS" && aiscatcher_command+=("FP_DS off") || true + chk_enabled "$AISCATCHER_DECODER_PS_EMA" && aiscatcher_command+=("PS_EMA on") || true + chk_disabled "$AISCATCHER_DECODER_PS_EMA" && aiscatcher_command+=("PS_EMA off") || true + chk_enabled "$AISCATCHER_DECODER_SOXR" && aiscatcher_command+=("SOXR on") || true + chk_disabled "$AISCATCHER_DECODER_SOXR" && aiscatcher_command+=("SOXR off") || true + chk_enabled "$AISCATCHER_DECODER_SRC" && aiscatcher_command+=("SRC on") || true + chk_disabled "$AISCATCHER_DECODER_SRC" && aiscatcher_command+=("SRC off") || true + chk_enabled "$AISCATCHER_DECODER_DROOP" && aiscatcher_command+=("DROOP on") || true + chk_disabled "$AISCATCHER_DECODER_DROOP" && aiscatcher_command+=("DROOP off") || true + elif [[ -z "$AISCATCHER_DECODER_AFC_WIDE" ]] && ! grep -qi 'AFC_WIDE' <<< "$AISCATCHER_EXTRA_OPTIONS"; then + aiscatcher_command+=("-go AFC_WIDE on") + fi +fi + aiscatcher_command+=("$AISCATCHER_EXTRA_OPTIONS") aiscommand="$(echo ${aiscatcher_command[@]} | xargs)" From 1104b1127766216de031e043aaebe9c2ae1a9058 Mon Sep 17 00:00:00 2001 From: actions-user Date: Fri, 15 Mar 2024 10:44:49 -0400 Subject: [PATCH 02/20] update manual builder --- buildnow.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/buildnow.sh b/buildnow.sh index 2814271..526e2fd 100755 --- a/buildnow.sh +++ b/buildnow.sh @@ -7,11 +7,10 @@ [[ "$ARCHS" == "" ]] && ARCHS="linux/armhf,linux/arm64,linux/amd64" BASETARGET1=ghcr.io/sdr-enthusiasts -BASETARGET2=kx1t - -IMAGE1="$BASETARGET1/$(pwd | sed -n 's|.*/docker-\(.*\)|\1|p'):$TAG" -IMAGE2="$BASETARGET2/$(pwd | sed -n 's|.*/docker-\(.*\)|\1|p'):$TAG" +BASETARGET2=ghcr.io/sdr-enthusiasts +IMAGE1="$BASETARGET1/shipxplorer:$TAG" +IMAGE2="$BASETARGET2/docker-shipfeeder:$TAG" echo "press enter to start building $IMAGE1 and $IMAGE2 from $BRANCH" @@ -32,6 +31,6 @@ else fi docker buildx build -f Dockerfile --compress --push $2 --platform $ARCHS --tag "$IMAGE1" . -# [[ $? ]] && docker buildx build --compress --push $2 --platform $ARCHS --tag $IMAGE2 . +[[ $? ]] && docker buildx build --compress --push $2 --platform $ARCHS --tag $IMAGE2 . mv -f /tmp/Dockerfile . echo "Total build time: $(( $(date +%s) - starttime )) seconds" From b68da8c66889b6d231c925924d4bd69cee79df0a Mon Sep 17 00:00:00 2001 From: actions-user Date: Fri, 15 Mar 2024 10:53:32 -0400 Subject: [PATCH 03/20] update build script --- buildnow.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/buildnow.sh b/buildnow.sh index 526e2fd..56f1a9b 100755 --- a/buildnow.sh +++ b/buildnow.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # shellcheck disable=SC2086 @@ -30,7 +30,6 @@ else sed -i 's/##BRANCH##/'"$BRANCH"'/g' Dockerfile fi -docker buildx build -f Dockerfile --compress --push $2 --platform $ARCHS --tag "$IMAGE1" . -[[ $? ]] && docker buildx build --compress --push $2 --platform $ARCHS --tag $IMAGE2 . +docker buildx build -f Dockerfile --compress --push $2 --platform $ARCHS --tag "$IMAGE1" "${IMAGE2:+-tag $IMAGE2}" . mv -f /tmp/Dockerfile . echo "Total build time: $(( $(date +%s) - starttime )) seconds" From 381657611b4f3dba6af5ec5a4f3b93331a99525c Mon Sep 17 00:00:00 2001 From: actions-user Date: Fri, 15 Mar 2024 11:49:03 -0400 Subject: [PATCH 04/20] updates --- README.md | 3 ++- buildnow.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7c871b6..53e4bd3 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,7 @@ If the `AISCATCHER_CHANNELS` and `AISCATCHER_DECODER_XXXX` parameters listed abo ### Website Related Parameters | Environment Variable | Purpose | Default value if omitted | +| ---------------------- | ------------------------------- | --- | | `DISABLE_WEBSITE` | If set to `true`, the AIS-Catcher website will not be available | `false` | | `PLUGINS_FILE` | Load a file with custom javascript to override parts of the WebUI or add functionality. Map the container `/data` to any volume, place your file inside the volume and put the file name here (for example `plugins.js`) | Empty | | `STYLES_FILE` | Load a file with custom css to override parts of the WebUI or add functionality. Map the container `/data` to any volume, place your file inside the volume and put the file name here (for example `styles.css`) | Empty | @@ -170,7 +171,7 @@ This table shows which parameters to set and how to obtain credentials for a num | MyShipTracking | `MYSHIPTRACKING_UDP_PORT` | 178.162.215.175 | UDP | [https://www.myshiptracking.com/help-center/contributors/add-your-station](https://www.myshiptracking.com/help-center/contributors/add-your-station) | | ShipFinder | `SHIPFINDER_SHAREDATA=true` | [ais.shipfinder.co.uk:4001](http://ais.shipfinder.co.uk:4001/) | UDP | [https://shipfinder.co/about/coverage/](https://shipfinder.co/about/coverage/) | | ShippingExplorer | `SHIPPINGEXPLORER_UDP_PORT` | 144.76.54.111 | UDP | Request UDP port at [https://www.shippingexplorer.net/en/contact](https://www.shippingexplorer.net/en/contact) | - | ShipXplorer | `SHIPXPLORER_FEEDER_KEY` or `FEEDER_KEY` (legacy)
`SHIPXPLORER_SERIAL_NUMBER` or `SERIAL_NUMBER` (legacy) | | Other | See [Obtaining a ShipXplorer Sharing Key](#obtaining-a-shipxplorer-sharing-key) | + | ShipXplorer | `SHIPXPLORER_SHARING_KEY` or `SHARING_KEY` (legacy)
`SHIPXPLORER_SERIAL_NUMBER` or `SERIAL_NUMBER` (legacy) | | Other | See [Obtaining a ShipXplorer Sharing Key](#obtaining-a-shipxplorer-sharing-key) | | VesselFinder | `VESSELFINDER_UDP_PORT` | [ais.vesselfinder.com](http://ais.vesselfinder.com) | UDP | [https://stations.vesselfinder.com/become-partner](https://stations.vesselfinder.com/become-partner) | | VesselTracker | `VESSELTRACKER_UDP_PORT` | 83.220.137.136 | UDP | [https://www.vesseltracker.com/en/static/antenna-partner.html](https://www.vesseltracker.com/en/static/antenna-partner.html) | diff --git a/buildnow.sh b/buildnow.sh index 56f1a9b..3a564bd 100755 --- a/buildnow.sh +++ b/buildnow.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # shellcheck disable=SC2086 +echo "Shell: $(bash --version)" [[ "$1" != "" ]] && BRANCH="$1" || BRANCH="$(git branch --show-current)" [[ "$BRANCH" == "main" ]] && TAG="latest" || TAG="$BRANCH" @@ -30,6 +31,6 @@ else sed -i 's/##BRANCH##/'"$BRANCH"'/g' Dockerfile fi -docker buildx build -f Dockerfile --compress --push $2 --platform $ARCHS --tag "$IMAGE1" "${IMAGE2:+-tag $IMAGE2}" . +docker buildx build -f Dockerfile --compress --push $2 --platform $ARCHS --tag $IMAGE1 ${IMAGE2:+--tag $IMAGE2} . mv -f /tmp/Dockerfile . echo "Total build time: $(( $(date +%s) - starttime )) seconds" From 8381005c89aeeff002b848cb23f939c26a1b9f6f Mon Sep 17 00:00:00 2001 From: actions-user Date: Fri, 15 Mar 2024 12:42:06 -0400 Subject: [PATCH 05/20] updates --- README.md | 15 +++++++------- rootfs/etc/s6-overlay/scripts/40-sxfeeder | 25 +++++++---------------- rootfs/etc/s6-overlay/scripts/aiscatcher | 25 ++++++++++++++++++++--- 3 files changed, 36 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 53e4bd3..ade69c1 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,7 @@ In `SX_EXTRA_OPTIONS`, the `-p` directive indicates the PPM value of your SDR. A | `AISCATCHER_DECODER_SOXR` | `-go SOXR` flag for `ais-catcher` | Empty | | `AISCATCHER_DECODER_SRC` | `-go SRC` flag for `ais-catcher` | Empty | | `AISCATCHER_DECODER_DROOP` | `-go DROOP` flag for `ais-catcher` | Empty | +| `AISCATCHER_UDP_INPUTS` | List of comma-separated `hostname:port[:CHANNELS]` combinations of external NMEA AIS data UDP sources. You can use this to feed data between `ais-catcher` or `docker-shipfeeder` instances. The `:CHANNELS` part is optional; channels `AB` will be used if omitted. Examples
`AISCATCHER_UDP_INPUTS=remotehost-1:9999:AB CD,remotehost-2:9988,remotehost-3:8899:CD` | Empty | | `AISCATCHER_EXTRA_OPTIONS` | Any additional command line parameters you wish to pass to `AIS-catcher` | Empty | | `VERBOSE_LOGGING` | If set to a number (`0`-`5`), it's set to the `AIS-Catcher -o` [log level](https://github.com/jvde-github/AIS-catcher#usage). Any other non-empty string corresponds to `-o 2`. To silence `AIS-Catcher` logs, set this parameter to `0` | `2` (a summary is displayed every 60 seconds) | @@ -146,8 +147,8 @@ If the `AISCATCHER_CHANNELS` and `AISCATCHER_DECODER_XXXX` parameters listed abo | `BACKUP_INTERVAL` | How often a file with data statistics (`aiscatcher.bin`) will be written to disk, in minutes. In order to make this backup persistent, make sure to map the `/data` directory to a volume. See example in [docker-compose.yml](docker-compose.yml). | `2880` (=2 days) | | `BACKUP_RETENTION_TIME` | Time (in days) to keep backups of `aiscatcher.bin` and plugins. Note - this only affects the backups of these files and not the active `aiscatcher.bin` or active plugins. | `30` (days) | | `SITESHOW` | If set to anything non-empty, it will show the station location as a dot on the map | Empty | -| `SXFEEDER_LAT` or `FEEDER_LAT` | Used for calculating ship distances on web page | Empty | -| `SXFEEDER_LON` or `FEEDER_LONG` | Used for calculating ship distances on web page | Empty | +| `FEEDER_LAT` or `SXFEEDER_LAT` (legacy) | Used for calculating ship distances on web page | Empty | +| `FEEDER_LONG` or `SXFEEDER_LON` (legacy) | Used for calculating ship distances on web page | Empty | | `DISABLE_SHOWLASTMSG` | If set to `true`, the last NMEA0182 message option won't be shown on the website. | Empty, i.e., last message option is available on website | | `PLUGIN_UPDATE_INTERVAL` | Optional. Set this to the interval (for example, `30` (secs) or `5m` or `6h` or `3d`) to check the AIS-Catcher github repository for updates to the JavaScript web plugins. Set to `0` or `off` to disable checking. | `6h` | | `REFRESHRATE` | Refresh rate of the vessel data on the web page, in msec. Larger numbers reduce web page traffic, which can become an issue if there are a large number of vessels | `2500` (msec) | @@ -338,22 +339,20 @@ If you want `shipfeeder` to use 2 SDRs to listen to AIS Channels AB and CD at th ## Aggregating multiple instances of the container -Sometimes it's convenient to aggregate the data of multiple instances of the container into a single one, and then feed the AIS aggregators from this "central" instance. An example of this is when you have a SDR receiving from channels AB in one instance, and a SDR receiving from channels CD in a separate instance on another machine. (If you have both SDRs on the same machine, you can use a single container instance for both of them as described above). In our case, you'd want to send the data from channels CD to the instance that (also) receives channels AB, and then use the Channel AB instance to disperse the data to the various services. +Sometimes it's convenient to aggregate the data of multiple instances of the container into a single one, and then feed the AIS aggregators from this "central" instance. An example of this is when you have a SDR receiving from channels AB in one instance, and a SDR receiving from channels CD in a separate instance on another machine. (If you have both SDRs on the same machine, you can use a single container instance for both of them as described above). In our case, you'd want to send the data from channels CD to the instance that receives channels AB, and then use that machine to disperse the data to the various services, show its webpage, etc. Do the following. We are assuming that the hostname/container name for the instance receiving channels AB is `shipfeeder_ab` and the hostname/container name for the instance receiving channels CD is `shipfeeder_cd`. Your names may vary. -Situation 1: both instances are in the same container stack, on the same machine: - -- In the section of the `docker-compose.yml` file for `shipfeeder_ab`, make sure to add the following to the `UDP_FEEDS` parameter. Make sure that you replace `target_machine` with the IP or hostname of the target machine: +- In the section of the `docker-compose.yml` file for `shipfeeder_cd`, make sure to add the following to the `UDP_FEEDS` parameter. Make sure that you replace `target_machine` with the IP or hostname of the machine where `shipfeeder_ab` runs: ```yaml - UDP_FEEDS=.....;target_machine:9988 ``` -- In the section of the `docker-compose.yml` file for `shipfeeder_cd`, make sure to add the following to the `UDP_FEEDS` parameter. Make sure that the name after `-x` matches your container name. (DO NOT USE `localhost` or `127.0.0.1` - that won't work): +- In the section of the `docker-compose.yml` file for `shipfeeder_ab`, make sure to add the following to the `AISCATCHER_UDP_INPUTS` parameter. (DO NOT USE `localhost` or `127.0.0.1` - that won't work): ```yaml - - AISCATCHER_EXTRA_OPTIONS=...... -x shipfeeder_cd 9988 -c AB CD + - AISCATCHER_UDP_INPUTS=shipfeeder_cd:9988:AB CD ``` - In addition, to the same section of the `docker-compose.yml` file for `shipfeeder_cd`, make sure to forward the UPD port to the container: diff --git a/rootfs/etc/s6-overlay/scripts/40-sxfeeder b/rootfs/etc/s6-overlay/scripts/40-sxfeeder index 5ae8bee..28c4057 100755 --- a/rootfs/etc/s6-overlay/scripts/40-sxfeeder +++ b/rootfs/etc/s6-overlay/scripts/40-sxfeeder @@ -24,17 +24,11 @@ source /scripts/common APPNAME="10-container-init" s6wrap=(s6wrap --quiet --timestamps --prepend="${APPNAME}") -if [[ -z "${SHARING_KEY}" ]] && [[ -z "${AISCATCHER_EXTRA_OPTIONS}" ]] && [[ -z "${UDP_FEEDS}" ]] -then - "${s6wrap[@]}" --args echo "WARNING: Container is configured for Local Use Only. At least one of SHARING_KEY, AISCATCHER_EXTRA_OPTIONS, or UDP_FEEDS must be defined for this container to feed a service." - exit 0 -fi +SHARING_KEY="${SHARING_KEY:-${SX_SHARING_KEY:-${SHIPXPLORER_SHARING_KEY}}}" +SERIAL_NUMBER="${SERIAL_NUMBER:-${SX_SERIAL_NUMBER:-${SHIPXPLORER_SERIAL_NUMBER}}}" -if [[ -z "${SHARING_KEY}" ]] -then - "${s6wrap[@]}" --args echo "WARNING: SHARING_KEY is not set. Feeding to ShipXplorer is disabled." - "${s6wrap[@]}" --args echo " If you are attempting to generate a new ShipXplorer sharing key and serial, you can do so by giving this command:" - "${s6wrap[@]}" --args echo " docker exec -it shipxplorer /usr/bin/getcreds" +if [[ -z "${SHARING_KEY}" ]]; then + "${s6wrap[@]}" --args echo "ShipXplorer feeding not enabled. Continuing..." exit 0 fi @@ -44,11 +38,6 @@ then exit 1 fi -if [[ -z "${RTLSDR_DEVICE_SERIAL}" ]] -then - "${s6wrap[@]}" --args echo "WARNING: RTLSDR_DEVICE_SERIAL is not set. The container will run in network-only mode." -fi - # Generate /etc/sxfeeder.ini based on environment variables echo """ [client] @@ -68,7 +57,7 @@ sed -i 's/#SERIALNUMBER/sn='"$SERIAL_NUMBER"'/g' /etc/sxfeeder.ini # Create log dirs mkdir -p /var/run/sxfeeder chmod a+rwx /var/run/sxfeeder -touch /var/log/rbfeeder.log -chmod a+rwx /var/log/rbfeeder.log -truncate --size=0 /var/log/rbfeeder.log +touch /var/log/sxfeeder.log +chmod a+rwx /var/log/sxfeeder.log +truncate --size=0 /var/log/sxfeeder.log chmod a+rw /etc/sxfeeder.ini diff --git a/rootfs/etc/s6-overlay/scripts/aiscatcher b/rootfs/etc/s6-overlay/scripts/aiscatcher index 49f1ef1..17bfdd4 100755 --- a/rootfs/etc/s6-overlay/scripts/aiscatcher +++ b/rootfs/etc/s6-overlay/scripts/aiscatcher @@ -21,6 +21,9 @@ s6wrap=(s6wrap --quiet --timestamps --prepend="${APPNAME}") # If not, see . #--------------------------------------------------------------------------------------------- +# Do some parameters housekeeping so both the new and the legacy params are supported: +FEEDER_LAT="${FEEDER_LAT:-$SXFEEDER_LAT}" +FEEDER_LONG="${FEEDER_LONG:-$SXFEEDER_LON}" # check if logging is verbose: if [[ -n "$VERBOSE_LOGGING" ]] @@ -83,15 +86,31 @@ if ! chk_enabled "${DISABLE_WEBSITE}"; then chk_enabled "${PROMETHEUS_ENABLE}" && aiscatcher_command+=("PROME on") || true [[ -n "${STATION_NAME}" ]] && aiscatcher_command+=("STATION $STATION_NAME") || true [[ -n "${STATION_LINK}" ]] && aiscatcher_command+=("STATION_LINK $STATION_LINK") || true - if [[ -n "$SXFEEDER_LAT" ]] && [[ -n "$SXFEEDER_LON" ]] + if [[ -n "$FEEDER_LAT" ]] && [[ -n "$FEEDER_LONG" ]] then - aiscatcher_command+=("LAT $SXFEEDER_LAT LON $SXFEEDER_LON") + aiscatcher_command+=("LAT $FEEDER_LAT LON $FEEDER_LONG") chk_enabled "${SITESHOW}" && aiscatcher_command+=("SHARE_LOC on") || true fi chk_enabled "${DISABLE_SHOWLASTMSG}" && true || aiscatcher_command+=("MESSAGE on") chk_enabled "${REALTIME}" && aiscatcher_command+=("REALTIME on") || true fi +# Add NMEA UDP inputs if needed: +if [[ -n "$AISCATCHER_UDP_INPUTS" ]]; then + readarray -d "," -t feedsarray <<< "$AISCATCHER_UDP_INPUTS" + for feeds in "${feedsarray[@]}" + do + if [[ -n "$feeds" ]]; then + feeds="${feeds/:/ }" + feeds="${feeds/:/ -c }" + if ! grep -q "\-c" <<< "$feeds"; then + feeds="$feeds -c AB" + fi + aiscatcher_command+=("-x ${feeds}") + fi + done +fi + # Add a number of well-known feeders: # ADSBNetwork / RadarVirtuel: if [[ -n "${RADARVIRTUEL_FEEDER_KEY:+$RADARVIRTUEL_STATION_ID}" ]]; then @@ -104,7 +123,7 @@ if [[ -n "$AIRFRAMES_STATION_ID" ]]; then fi # AIS-Catcher: -if chk_enabled "$AISCATCHER_SHAREDATA" && [[ -z "$AISCATCHER_FEEDER_KEY" ]]; then +if chk_enabled "$AISCATCHER_SHAREDATA" || [[ -z "$AISCATCHER_FEEDER_KEY" ]]; then aiscatcher_command+=("-X") AISCATCHER_EXTRA_OPTIONS="$(sed -E 's/-X\s+[0-9]*\s*//g'<<< "$AISCATCHER_EXTRA_OPTIONS")" # Remove any -X from param to avoid duplication elif [[ -n "$AISCATCHER_FEEDER_KEY" ]]; then From 7469861f79d34978a3d588115b1ec873f6c891c9 Mon Sep 17 00:00:00 2001 From: actions-user Date: Fri, 15 Mar 2024 12:57:41 -0400 Subject: [PATCH 06/20] bug fix --- rootfs/etc/s6-overlay/scripts/aiscatcher | 36 ++++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/rootfs/etc/s6-overlay/scripts/aiscatcher b/rootfs/etc/s6-overlay/scripts/aiscatcher index 17bfdd4..22cf6d8 100755 --- a/rootfs/etc/s6-overlay/scripts/aiscatcher +++ b/rootfs/etc/s6-overlay/scripts/aiscatcher @@ -133,7 +133,7 @@ fi # AISHub: if [[ -n "$AISHUB_UDP_PORT" ]]; then - if ! grep -q ":" $AISHUB_UDP_PORT; then AISHUB_UDP_PORT="data.aishub.net:$AISHUB_UDP_PORT"; fi + if ! grep -q ":" <<< "$AISHUB_UDP_PORT"; then AISHUB_UDP_PORT="data.aishub.net:$AISHUB_UDP_PORT"; fi aiscatcher_command+=("-u ${AISHUB_UDP_PORT%%:*} ${AISHUB_UDP_PORT##*:}") fi @@ -146,57 +146,57 @@ fi if chk_enabled "$BOATBEACON_SHAREDATA"; then aiscatcher_command+=("-u boatbeaconapp.com 5322") elif [[ -n "$BOATBEACON_UDP_PORT" ]]; then - if ! grep -q ":" $BOATBEACON_UDP_PORT; then BOATBEACON_UDP_PORT="boatbeaconapp.com:$BOATBEACON_UDP_PORT"; fi - aiscatcher_command+=("-u ${BOATBEACON_UDP_PORT%%:*} ${BOATBEACON_UDP_PORT##*:}") + if ! grep -q ":" <<< "$BOATBEACON_UDP_PORT"; then BOATBEACON_UDP_PORT="boatbeaconapp.com:$BOATBEACON_UDP_PORT"; fi + aiscatcher_command+=("-u ${BOATBEACON_UDP_PORT/:/ }") fi # HPRadar: if [[ -n "$HPRADAR_UDP_PORT" ]]; then - if ! grep -q ":" $HPRADAR_UDP_PORT; then HPRADAR_UDP_PORT="aisfeed.hpradar.com:$HPRADAR_UDP_PORT"; fi - aiscatcher_command+=("-u ${HPRADAR_UDP_PORT%%:*} ${HPRADAR_UDP_PORT##*:} JSON on") + if ! grep -q ":" <<< "$HPRADAR_UDP_PORT"; then HPRADAR_UDP_PORT="aisfeed.hpradar.com:$HPRADAR_UDP_PORT"; fi + aiscatcher_command+=("-u ${HPRADAR_UDP_PORT/:/ } JSON on") fi # MarineTraffic: if [[ -n "$MARINETRAFFIC_UDP_PORT" ]]; then - if ! grep -q ":" $MARINETRAFFIC_UDP_PORT; then MARINETRAFFIC_UDP_PORT="5.9.207.224:$MARINETRAFFIC_UDP_PORT"; fi - aiscatcher_command+=("-u ${MARINETRAFFIC_UDP_PORT%%:*} ${MARINETRAFFIC_UDP_PORT##*:}") + if ! grep -q ":" <<< "$MARINETRAFFIC_UDP_PORT"; then MARINETRAFFIC_UDP_PORT="5.9.207.224:$MARINETRAFFIC_UDP_PORT"; fi + aiscatcher_command+=("-u ${MARINETRAFFIC_UDP_PORT/:/ }") fi # MyShipTracker: if [[ -n "$MYSHIPTRACKER_UDP_PORT" ]]; then - if ! grep -q ":" $MYSHIPTRACKER_UDP_PORT; then MYSHIPTRACKER_UDP_PORT="178.162.215.175:$MYSHIPTRACKER_UDP_PORT"; fi - aiscatcher_command+=("-u ${MYSHIPTRACKER_UDP_PORT%%:*} ${MYSHIPTRACKER_UDP_PORT##*:}") + if ! grep -q ":" <<< "$MYSHIPTRACKER_UDP_PORT"; then MYSHIPTRACKER_UDP_PORT="178.162.215.175:$MYSHIPTRACKER_UDP_PORT"; fi + aiscatcher_command+=("-u ${MYSHIPTRACKER_UDP_PORT/:/ }") fi # ShippingExplorer: if [[ -n "$SHIPPINGEXPLORER_UDP_PORT" ]]; then - if ! grep -q ":" $SHIPPINGEXPLORER_UDP_PORT; then SHIPPINGEXPLORER_UDP_PORT="144.76.54.111:$SHIPPINGEXPLORER_UDP_PORT"; fi - aiscatcher_command+=("-u ${SHIPPINGEXPLORER_UDP_PORT%%:*} ${SHIPPINGEXPLORER_UDP_PORT##*:}") + if ! grep -q ":" <<< "$SHIPPINGEXPLORER_UDP_PORT"; then SHIPPINGEXPLORER_UDP_PORT="144.76.54.111:$SHIPPINGEXPLORER_UDP_PORT"; fi + aiscatcher_command+=("-u ${SHIPPINGEXPLORER_UDP_PORT/:/ :}") fi # ShipFinder: if chk_enabled "$SHIPFINDER_SHAREDATA"; then aiscatcher_command+=("-u ais.shipfinder.co.uk 4001") elif [[ -n "$SHIPFINDER_UDP_PORT" ]]; then - if ! grep -q ":" $SHIPFINDER_UDP_PORT; then SHIPFINDER_UDP_PORT="ais.shipfinder.co.uk:$SHIPFINDER_UDP_PORT"; fi - aiscatcher_command+=("-u ${SHIPFINDER_UDP_PORT%%:*} ${SHIPFINDER_UDP_PORT##*:}") + if ! grep -q ":" <<< "$SHIPFINDER_UDP_PORT"; then SHIPFINDER_UDP_PORT="ais.shipfinder.co.uk:$SHIPFINDER_UDP_PORT"; fi + aiscatcher_command+=("-u ${SHIPFINDER_UDP_PORT/:/ }") fi # VesselFinder: if [[ -n "$VESSELFINDER_UDP_PORT" ]]; then - if ! grep -q ":" $VESSELFINDER_UDP_PORT; then VESSELFINDER_UDP_PORT="ais.vesselfinder.com:$VESSELFINDER_UDP_PORT"; fi - aiscatcher_command+=("-u ${VESSELFINDER_UDP_PORT%%:*} ${VESSELFINDER_UDP_PORT##*:}") + if ! grep -q ":" <<< "$VESSELFINDER_UDP_PORT"; then VESSELFINDER_UDP_PORT="ais.vesselfinder.com:$VESSELFINDER_UDP_PORT"; fi + aiscatcher_command+=("-u ${VESSELFINDER_UDP_PORT/:/ }") fi # VesselTracker: if [[ -n "$VESSELTRACKER_UDP_PORT" ]]; then - if ! grep -q ":" $VESSELFINDER_UDP_PORT; then VESSELTRACKER_UDP_PORT="83.220.137.136:$VESSELTRACKER_UDP_PORT"; fi - aiscatcher_command+=("-u ${VESSELTRACKER_UDP_PORT%%:*} ${VESSELTRACKER_UDP_PORT##*:}") + if ! grep -q ":" <<< "$VESSELFINDER_UDP_PORT"; then VESSELTRACKER_UDP_PORT="83.220.137.136:$VESSELTRACKER_UDP_PORT"; fi + aiscatcher_command+=("-u ${VESSELTRACKER_UDP_PORT/:/ }") fi +aiscatcher_command+=("${FEEDSTRING[*]}") aiscatcher_command+=("-u 127.0.0.1 34994") aiscatcher_command+=("-u 127.0.0.1 34995") -aiscatcher_command+=("${FEEDSTRING[*]}") aiscatcher_command+=("$SHOWLOGS") if [[ -n "${RTLSDR_DEVICE_SERIAL}" ]]; then AISCATCHER_CHANNELS="${AISCATCHER_CHANNELS^^}"; aiscatcher_command+=("-c ${AISCATCHER_CHANNELS:-AB}") From 7f59c4da5321e3ecaa257aa2692418289837af1c Mon Sep 17 00:00:00 2001 From: actions-user Date: Fri, 15 Mar 2024 13:01:25 -0400 Subject: [PATCH 07/20] bug fix --- rootfs/etc/s6-overlay/scripts/sxfeeder | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rootfs/etc/s6-overlay/scripts/sxfeeder b/rootfs/etc/s6-overlay/scripts/sxfeeder index 61a478b..5b6ab27 100755 --- a/rootfs/etc/s6-overlay/scripts/sxfeeder +++ b/rootfs/etc/s6-overlay/scripts/sxfeeder @@ -22,7 +22,8 @@ s6wrap=(s6wrap --quiet --timestamps --prepend="${APPNAME}") # If not, see . #--------------------------------------------------------------------------------------------- -if [[ -z "${SHARING_KEY}" ]]; then + +if [[ -z "${SHARING_KEY:-${SX_SHARING_KEY:-${SHIPXPLORER_SHARING_KEY}}}" ]] || [[ -z "${SERIAL_NUMBER:-${SX_SERIAL_NUMBER:-${SHIPXPLORER_SERIAL_NUMBER}}}" ]]; then "${s6wrap[@]}" --args echo "ShipXplorer sharing disabled." sleep infinity fi From 41b3130fdfa731714899e554089d4792a0c64bf1 Mon Sep 17 00:00:00 2001 From: actions-user Date: Fri, 15 Mar 2024 13:13:58 -0400 Subject: [PATCH 08/20] bug fix --- rootfs/etc/s6-overlay/scripts/aiscatcher | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rootfs/etc/s6-overlay/scripts/aiscatcher b/rootfs/etc/s6-overlay/scripts/aiscatcher index 22cf6d8..802f565 100755 --- a/rootfs/etc/s6-overlay/scripts/aiscatcher +++ b/rootfs/etc/s6-overlay/scripts/aiscatcher @@ -171,7 +171,7 @@ fi # ShippingExplorer: if [[ -n "$SHIPPINGEXPLORER_UDP_PORT" ]]; then if ! grep -q ":" <<< "$SHIPPINGEXPLORER_UDP_PORT"; then SHIPPINGEXPLORER_UDP_PORT="144.76.54.111:$SHIPPINGEXPLORER_UDP_PORT"; fi - aiscatcher_command+=("-u ${SHIPPINGEXPLORER_UDP_PORT/:/ :}") + aiscatcher_command+=("-u ${SHIPPINGEXPLORER_UDP_PORT/:/ }") fi # ShipFinder: @@ -190,7 +190,7 @@ fi # VesselTracker: if [[ -n "$VESSELTRACKER_UDP_PORT" ]]; then - if ! grep -q ":" <<< "$VESSELFINDER_UDP_PORT"; then VESSELTRACKER_UDP_PORT="83.220.137.136:$VESSELTRACKER_UDP_PORT"; fi + if ! grep -q ":" <<< "$VESSELTRACKER_UDP_PORT"; then VESSELTRACKER_UDP_PORT="83.220.137.136:$VESSELTRACKER_UDP_PORT"; fi aiscatcher_command+=("-u ${VESSELTRACKER_UDP_PORT/:/ }") fi From b2324a0f8f3151aa7eab7328678b772a59bf6523 Mon Sep 17 00:00:00 2001 From: actions-user Date: Fri, 15 Mar 2024 14:25:03 -0400 Subject: [PATCH 09/20] documentation updates --- README.md | 94 +++++++++++----- config-examples/.env.sample | 45 +++++--- config-examples/docker-compose.yml.sample | 125 ++++++++-------------- 3 files changed, 143 insertions(+), 121 deletions(-) diff --git a/README.md b/README.md index ade69c1..70b9d02 100644 --- a/README.md +++ b/README.md @@ -63,46 +63,90 @@ services: hostname: shipfeeder restart: always environment: +# general parameters: - VERBOSE_LOGGING= - - SHARING_KEY=${SX_SHARING_KEY} - - SERIAL_NUMBER=${SX_SERIAL_NUMBER} - - RTLSDR_DEVICE_SERIAL=${SX_RTLSDR_DEVICE_SERIAL} - - UDP_FEEDS=${SX_UDP_FEEDS} - - RTLSDR_DEVICE_GAIN=${SX_RTLSDR_GAIN} +# ais-catcher general and website related parameters - AISCATCHER_EXTRA_OPTIONS=${SX_EXTRA_OPTIONS} - - STATION_NAME=${SX_STATION_NAME}${SX_SERIAL_NUMBER} + - STATION_NAME=${STATION_NAME} - STATION_HISTORY=3600 - BACKUP_INTERVAL=5 - - SXFEEDER_LON=${FEEDER_LONG} - - SXFEEDER_LAT=${FEEDER_LAT} - - PROMETHEUS_ENABLE=true - - AISCATCHER_SHAREDATA=true + - FEEDER_LONG=${FEEDER_LONG} + - FEEDER_LAT=${FEEDER_LAT} + - SITESHOW=on + - PROMETHEUS_ENABLE=on + - REALTIME=on +# ais-catcher receiver related parameters + - RTLSDR_DEVICE_SERIAL=${RTLSDR_DEVICE_SERIAL} + - RTLSDR_DEVICE_GAIN=${RTLSDR_DEVICE_GAIN} + - RTLSDR_DEVICE_PPM=${RTLSDR_DEVICE_PPM} + - RTLSDR_DEVICE_BANDWIDTH=${RTLSDR_DEVICE_BANDWIDTH} + - AISCATCHER_DECODER_AFC_WIDE=${AISCATCHER_DECODER_AFC_WIDE} +# aggregrators related parameters + - AIRFRAMES_STATION_ID=${AIRFRAMES_STATION_ID} + - AISCATCHER_FEEDER_KEY=${AISCATCHER_FEEDER_KEY} + - AISHUB_UDP_PORT=${AISHUB_UDP_PORT} + - APRSFI_FEEDER_KEY=${APRSFI_FEEDER_KEY} + - BOATBEACON_SHAREDATA=${BOATBEACON_SHAREDATA} + - HPRADAR_UDP_PORT=${HPRADAR_UDP_PORT} + - MARINETRAFFIC_UDP_PORT=${MARINETRAFFIC_UDP_PORT} + - MYSHIPTRACKING_UDP_PORT=${MYSHIPTRACKING_UDP_PORT} + - RADARVIRTUEL_FEEDER_KEY=${RADARVIRTUEL_FEEDER_KEY} + - RADARVIRTUEL_STATION_ID=${RADARVIRTUEL_STATION_ID} + - SHIPFINDER_SHAREDATA=${SHIPFINDER_SHAREDATA} + - SHIPPINGEXPLORER_UDP_PORT=${SHIPPINGEXPLORER_UDP_PORT} + - SHIPXPLORER_SHARING_KEY=${SHIPXPLORER_SHARING_KEY} + - SHIPXPLORER_SERIAL_NUMBER=${SHIPXPLORER_SERIAL_NUMBER} + - VESSELFINDER_UDP_PORT=${VESSELFINDER_UDP_PORT} + - VESSELTRACKER_UDP_PORT=${VESSELTRACKER_UDP_PORT} + - UDP_FEEDS=${SX_UDP_FEEDS} +# incoming UDP data related parameters: + - AISCATCHER_UDP_INPUTS=${AISCATCHER_UDP_INPUTS} ports: - 90:80 - devices: - - /dev/bus/usb + - 9988:9988/udp + device_cgroup_rules: + - 'c 189:* rwm' tmpfs: - /tmp volumes: - "/etc/localtime:/etc/localtime:ro" - "/etc/timezone:/etc/timezone:ro" - - "/opt/ais/shipfeeder/data:/data" - labels: - - "com.centurylinklabs.watchtower.scope=ais" + - "/opt/ais/shipxplorer/data:/data" + - /dev:/dev:rw ``` Example accompanying `.env` file: -```bash -FEEDER_LAT=42.3788502 -FEEDER_LONG=-71.0360718 -SX_SHARING_KEY=0123456789abcdef -SX_SERIAL_NUMBER=SXTRPI000xxx -SX_RTLSDR_DEVICE_SERIAL=sdr_serial_number_here -SX_RTLSDR_GAIN=auto -SX_UDP_FEEDS=ip1:port1,ip2:port2:JSON on,ip3:port3 -SX_EXTRA_OPTIONS=-p 0 -a 192K -m 4 -go AFC_WIDE on -SX_STATION_NAME=My_station_name_single_string_no_spaces_but_html_char_encoding_is_ok_for_example This is Boston Calling +```text +# ShipFeeder receiver and webpage related parameters: +FEEDER_LAT=xx.xxxxxx +FEEDER_LONG=yy.yyyyyy +RTLSDR_DEVICE_SERIAL=DEVICE-SERIAL +RTLSDR_DEVICE_GAIN=xxx +RTLSDR_DEVICE_PPM=xxx +AISCATCHER_DECODER_AFC_WIDE=on +AISCATCHER_CHANNELS=AB CD +STATION_NAME=My Station Name +# +# keys and params for aggregators: +# If you aren't feeding a specific aggregator, leave the value EMPTY or remove the parameter +AIRFRAMES_STATION_ID=XX-XXXXXXX-AIS +AISCATCHER_FEEDER_KEY=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx +AISHUB_UDP_PORT=xxxx +APRSFI_FEEDER_KEY=xxxxxxx +APRSFI_STATION_ID=MYCALL +BOATBEACON_SHAREDATA=true +HPRADAR_UDP_PORT=xxxx +MARINETRAFFIC_UDP_PORT=xxxxx +MYSHIPTRACKING_UDP_PORT=xxxxx +RADARVIRTUEL_FEEDER_KEY=xxxxxxxxx +RADARVIRTUEL_STATION_ID=xx +SHIPFINDER_SHAREDATA=true +SHIPPINGEXPLORER_UDP_PORT=xxxxx +SHIPXPLORER_SHARING_KEY=xxxxxxxxxxxxxxxxxxx +SHIPXPLORER_SERIAL_NUMBER=SXTRPI00xxxx +VESSELFINDER_UDP_PORT=xxxx +VESSELTRACKER_UDP_PORT=xxxx ``` Replace the `SHARING_KEY`, `SERIAL_NUMBER`, and `RTLSDR_DEVICE_SERIAL` with the appropriate values. diff --git a/config-examples/.env.sample b/config-examples/.env.sample index 0a33557..f4991d2 100644 --- a/config-examples/.env.sample +++ b/config-examples/.env.sample @@ -1,16 +1,29 @@ -FEEDER_LAT=xx.xxxxx -FEEDER_LONG=-yy.yyyyy -SX_SHARING_KEY=fxxxxxxxxxxxxxxxxxxxxxx7 -SX_SERIAL_NUMBER=SXTRPI000000 -SX_RTLSDR_DEVICE_SERIAL=AIS -SX_RTLSDR_GAIN=auto -SX_UDP_FEEDS=5.9.207.224:xxxxx,ais.vesselfinder.com:xxxx,144.76.54.111:xxxxx -SX_EXTRA_OPTIONS=-p -2 -a 192K -H http://aprs.fi/jsonais/post/zxxxxxxV ID MYCALL PROTOCOL aprs INTERVAL 30 RESPONSE off -H http://10.147.20.76:9995/test ID XX-USXXX-AIS INTERVAL 30 RESPONSE off -SX_STATION_NAME=My Station Name Here -VA_MASTODON_SERVER=airwaves.social -VA_MASTODON_ACCESS_TOKEN=9xxxxxxxxxxxxxxxxxxxxxxxxxxxo -VA_MASTODON_SKIP_FILTER=^[9]{2}[0-9]{7}$$|^[0-9]{7}$$ -VA_MASTODON_CUSTOM_FIELD=Join us! https://vesselalert.com -VA_DISCORD_NAME=My AIS - My Location, USA -VA_DISCORD_AVATAR_URL=https://files.airwaves.social/accounts/avatars/xxxxxxxx.jpeg -VA_DISCORD_WEBHOOKS= +# ShipFeeder receiver and webpage related parameters: +FEEDER_LAT=xx.xxxxxx +FEEDER_LONG=yy.yyyyyy +RTLSDR_DEVICE_SERIAL=DEVICE-SERIAL +RTLSDR_DEVICE_GAIN=xxx +RTLSDR_DEVICE_PPM=xxx +AISCATCHER_DECODER_AFC_WIDE=on +AISCATCHER_CHANNELS=AB CD +STATION_NAME=My Station Name +# +# keys and params for aggregators: +# If you aren't feeding a specific aggregator, leave the value EMPTY or remove the parameter +AIRFRAMES_STATION_ID=XX-XXXXXXX-AIS +AISCATCHER_FEEDER_KEY=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx +AISHUB_UDP_PORT=xxxx +APRSFI_FEEDER_KEY=xxxxxxx +APRSFI_STATION_ID=MYCALL +BOATBEACON_SHAREDATA=true +HPRADAR_UDP_PORT=xxxx +MARINETRAFFIC_UDP_PORT=xxxxx +MYSHIPTRACKING_UDP_PORT=xxxxx +RADARVIRTUEL_FEEDER_KEY=xxxxxxxxx +RADARVIRTUEL_STATION_ID=xx +SHIPFINDER_SHAREDATA=true +SHIPPINGEXPLORER_UDP_PORT=xxxxx +SHIPXPLORER_SHARING_KEY=xxxxxxxxxxxxxxxxxxx +SHIPXPLORER_SERIAL_NUMBER=SXTRPI00xxxx +VESSELFINDER_UDP_PORT=xxxx +VESSELTRACKER_UDP_PORT=xxxx \ No newline at end of file diff --git a/config-examples/docker-compose.yml.sample b/config-examples/docker-compose.yml.sample index efa43c8..118d494 100644 --- a/config-examples/docker-compose.yml.sample +++ b/config-examples/docker-compose.yml.sample @@ -1,93 +1,58 @@ version: '3.8' - services: - shipxplorer: - image: ghcr.io/sdr-enthusiasts/shipxplorer - container_name: shipxplorer - hostname: shipxplorer - restart: unless-stopped + shipfeeder: + image: ghcr.io/sdr-enthusiasts/docker-shipfeeder + container_name: shipfeeder + hostname: shipfeeder + restart: always environment: - - STATION_NAME=${SX_STATION_NAME} - - SXFEEDER_LAT=${FEEDER_LAT} - - SXFEEDER_LON=${FEEDER_LONG} +# general parameters: + - VERBOSE_LOGGING= +# ais-catcher general and website related parameters - AISCATCHER_EXTRA_OPTIONS=${SX_EXTRA_OPTIONS} - - RTLSDR_DEVICE_GAIN=${SX_RTLSDR_GAIN} - - SERIAL_NUMBER=${SX_SERIAL_NUMBER} - - RTLSDR_DEVICE_SERIAL=${SX_RTLSDR_DEVICE_SERIAL} + - STATION_NAME=${STATION_NAME}${SHIPXPLORER_SERIAL_NUMBER} + - STATION_HISTORY=3600 + - BACKUP_INTERVAL=5 + - FEEDER_LONG=${FEEDER_LONG} + - FEEDER_LAT=${FEEDER_LAT} + - SITESHOW=on + - PROMETHEUS_ENABLE=on + - REALTIME=on +# ais-catcher receiver related parameters + - RTLSDR_DEVICE_SERIAL=${RTLSDR_DEVICE_SERIAL} + - RTLSDR_DEVICE_GAIN=${RTLSDR_DEVICE_GAIN} + - RTLSDR_DEVICE_PPM=${RTLSDR_DEVICE_PPM} + - RTLSDR_DEVICE_BANDWIDTH=${RTLSDR_DEVICE_BANDWIDTH} + - AISCATCHER_DECODER_AFC_WIDE=${AISCATCHER_DECODER_AFC_WIDE} +# aggregrators related parameters + - AIRFRAMES_STATION_ID=${AIRFRAMES_STATION_ID} + - AISCATCHER_FEEDER_KEY=${AISCATCHER_FEEDER_KEY} + - AISHUB_UDP_PORT=${AISHUB_UDP_PORT} + - APRSFI_FEEDER_KEY=${APRSFI_FEEDER_KEY} + - BOATBEACON_SHAREDATA=${BOATBEACON_SHAREDATA} + - HPRADAR_UDP_PORT=${HPRADAR_UDP_PORT} + - MARINETRAFFIC_UDP_PORT=${MARINETRAFFIC_UDP_PORT} + - MYSHIPTRACKING_UDP_PORT=${MYSHIPTRACKING_UDP_PORT} + - RADARVIRTUEL_FEEDER_KEY=${RADARVIRTUEL_FEEDER_KEY} + - RADARVIRTUEL_STATION_ID=${RADARVIRTUEL_STATION_ID} + - SHIPFINDER_SHAREDATA=${SHIPFINDER_SHAREDATA} + - SHIPPINGEXPLORER_UDP_PORT=${SHIPPINGEXPLORER_UDP_PORT} + - SHIPXPLORER_SHARING_KEY=${SHIPXPLORER_SHARING_KEY} + - SHIPXPLORER_SERIAL_NUMBER=${SHIPXPLORER_SERIAL_NUMBER} + - VESSELFINDER_UDP_PORT=${VESSELFINDER_UDP_PORT} + - VESSELTRACKER_UDP_PORT=${VESSELTRACKER_UDP_PORT} - UDP_FEEDS=${SX_UDP_FEEDS} - - SHARING_KEY=${SX_SHARING_KEY} +# incoming UDP data related parameters: + - AISCATCHER_UDP_INPUTS=${AISCATCHER_UDP_INPUTS} ports: - 90:80 - devices: - - /dev/bus/usb + - 9988:9988/udp + device_cgroup_rules: + - 'c 189:* rwm' tmpfs: - /tmp volumes: - "/etc/localtime:/etc/localtime:ro" - "/etc/timezone:/etc/timezone:ro" - "/opt/ais/shipxplorer/data:/data" - - /opt/ais/shipxplorer/cpuinfo/cpuinfo:/proc/cpuinfo - labels: - - com.centurylinklabs.watchtower.scope=ais - - ais-screenshot: - image: ghcr.io/sdr-enthusiasts/screenshot:aiscatcher - tty: true - container_name: ais-screenshot - hostname: ais-screenshot - restart: always - shm_size: 1gb - environment: - - LOAD_SLEEP_TIME=15 - - BASE_URL=http://shipxplorer - - MAXTIME=60 - - MAP_ARGS=map=OpenStreetMap - ports: - - 5043:5042 - labels: - - com.centurylinklabs.watchtower.scope=ais - - vesselalert: - image: ghcr.io/sdr-enthusiasts/vesselalert - container_name: vesselalert - hostname: vesselalert - restart: always - environment: - - AIS_URL=https://shipxplorer - - MASTODON_SERVER=${VA_MASTODON_SERVER} - - MASTODON_ACCESS_TOKEN=${VA_MASTODON_ACCESS_TOKEN} - - MASTODON_SKIP_FILTER=${VA_MASTODON_SKIP_FILTER} - - NOTIFICATION_MIN_DIST=8 - - MASTODON_CUSTOM_FIELD=${VA_MASTODON_CUSTOM_FIELD} - - MASTODON_LINK_SHIPXPLORER=on - - MASTODON_LINK_MARINETRAFFIC=on - - MASTODON_LINK_VESSELFINDER=on - - MASTODON_ONLY_NEW_ON_STARTUP=on - - MASTODON_THROTTLE=on - - NOTIFICATION_MAPURL=on - - DISCORD_NAME=${VA_DISCORD_NAME} - - DISCORD_AVATAR_URL=${VA_DISCORD_AVATAR_URL} - - DISCORD_WEBHOOKS=${VA_DISCORD_WEBHOOKS} - - SCREENSHOT_URL=http://ais-screenshot:5042 - tmpfs: - - /tmp - volumes: - - /opt/ais/vesselalert/data:/data - - "/etc/localtime:/etc/localtime:ro" - - "/etc/timezone:/etc/timezone:ro" - labels: - - com.centurylinklabs.watchtower.scope=ais - - watchtower: - image: containrrr/watchtower - container_name: watchtower-ais - environment: - - TZ=Europe/London - - WATCHTOWER_CLEANUP=true - - WATCHTOWER_ROLLING_RESTART=true - hostname: watchtower-ais - volumes: - - /var/run/docker.sock:/var/run/docker.sock - command: --interval 1800 --scope ais - labels: - - com.centurylinklabs.watchtower.scope=ais \ No newline at end of file + - /dev:/dev:rw \ No newline at end of file From e6f703f25594f877c4b62cd68280d1284278da62 Mon Sep 17 00:00:00 2001 From: kx1t Date: Fri, 15 Mar 2024 15:18:34 -0400 Subject: [PATCH 10/20] fix a bunch of linter errors (but not all) --- .github/workflows/markdownlint.yml | 2 +- .markdownlint.yaml | 5 ++++- Dockerfile.build-aiscatcher | 4 ++-- config-examples/README.md | 2 +- rootfs/scripts/update-plugins | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml index 72115e3..c75fbe5 100644 --- a/.github/workflows/markdownlint.yml +++ b/.github/workflows/markdownlint.yml @@ -20,4 +20,4 @@ jobs: - name: Pull markdownlint/markdownlint:latest Image run: docker pull markdownlint/markdownlint:latest - name: Run markdownlint against *.md files - run: docker run --rm -i -v "$(pwd)":/workdir --workdir /workdir markdownlint/markdownlint:latest --rules ~MD013,~MD033,~MD026,~MD002,~MD022 $(find . -type f -iname '*.md' | grep -v '/.git/') + run: docker run --rm -i -v "$(pwd)":/workdir --workdir /workdir markdownlint/markdownlint:latest --rules ~MD013,~MD033,~MD026,~MD002,~MD022,~MD029,~MD034,~MD056 $(find . -type f -iname '*.md' | grep -v '/.git/') diff --git a/.markdownlint.yaml b/.markdownlint.yaml index 151ee39..5dec587 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -1,4 +1,7 @@ { "MD013": false, - "MD033": false + "MD033": false, + "MD029": false, + "MD034": false, + "MD056": false } \ No newline at end of file diff --git a/Dockerfile.build-aiscatcher b/Dockerfile.build-aiscatcher index 71f47d3..f096ccc 100644 --- a/Dockerfile.build-aiscatcher +++ b/Dockerfile.build-aiscatcher @@ -1,9 +1,9 @@ -FROM debian:bullseye-slim AS build +FROM debian:bookwork-slim AS build RUN set -x && \ apt-get update -y && \ apt-get upgrade -y && \ - apt-get install -q -o Dpkg::Options::="--force-confnew" -y \ + apt-get install -q -o Dpkg::Options::="--force-confnew" --no-install-recommends -y \ git make gcc g++ cmake pkg-config librtlsdr-dev libairspy-dev libhackrf-dev libairspyhf-dev libzmq3-dev libsoxr-dev libcurl4-openssl-dev zlib1g-dev && \ git clone --depth=1 -b develop --single-branch https://github.com/jvde-github/AIS-catcher.git /root/AIS-catcher && \ cd /root/AIS-catcher && \ diff --git a/config-examples/README.md b/config-examples/README.md index 35172ac..2243609 100644 --- a/config-examples/README.md +++ b/config-examples/README.md @@ -89,7 +89,7 @@ Make the changes based on the description below, and once you are done, you can | `VA_DISCORD_AVATAR_URL` | Link to a URL that contains your avatar / picture | | `VA_DISCORD_WEBHOOKS` | Webhook(s) for Discord notifications. If you have multiple channels your want to notify to, you can comma-separate them. We prefilled this field with one for our special [`#Vessel-Alerts` Discord Channel](https://discord.gg/UMgZMc2AGp) | | `VA_SCREENSHOT_URL` | `http://ais-screenshot:5042` | -| `BACKUP_RETENTION_TIME` | Time (in days) to keep backups of `aiscatcher.bin` and plugins. Note - this only affects the backups of these files and not the active `aiscatcher.bin` or active plugins | `30` (days) | +| `BACKUP_RETENTION_TIME` | Time (in days) to keep backups of `aiscatcher.bin` and plugins. Note - this only affects the backups of these files and not the active `aiscatcher.bin` or active plugins. Default: `30` (days) | ## Starting your AIS Feeder diff --git a/rootfs/scripts/update-plugins b/rootfs/scripts/update-plugins index ccb0424..f424aeb 100755 --- a/rootfs/scripts/update-plugins +++ b/rootfs/scripts/update-plugins @@ -76,7 +76,7 @@ then for file in /tmp/AIS-catcher/plugins/* do file="${file##*/}" - if [[ f /data/plugins/${file} ]] && ! diff "${file}" "/data/plugins/${file}" >/dev/null 2>&1 + if [[ -f /data/plugins/${file} ]] && ! diff "${file}" "/data/plugins/${file}" >/dev/null 2>&1 then # Copy plugin file if it's newer but leave a backup in place cp --backup=numbered -u "/tmp/AIS-catcher/plugins/${file}" "/data/plugins/${file}" From 01b6bb55cbdaddfa855803d9720b12751d4d614e Mon Sep 17 00:00:00 2001 From: kx1t Date: Fri, 15 Mar 2024 15:24:19 -0400 Subject: [PATCH 11/20] Update on_pr.yml --- .github/workflows/on_pr.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/on_pr.yml b/.github/workflows/on_pr.yml index 0b3f13f..8771dab 100644 --- a/.github/workflows/on_pr.yml +++ b/.github/workflows/on_pr.yml @@ -53,7 +53,6 @@ jobs: - linux/amd64 - linux/arm64 - linux/arm/v7 - - linux/i386 steps: From 400f497d5fc084b7f395980159a9de8bdbdc7ad5 Mon Sep 17 00:00:00 2001 From: kx1t Date: Fri, 15 Mar 2024 15:43:56 -0400 Subject: [PATCH 12/20] documentation updates --- README.md | 6 +- config-examples/README.md | 137 -------------------------------------- docker-compose.yml | 36 ---------- 3 files changed, 4 insertions(+), 175 deletions(-) delete mode 100644 config-examples/README.md delete mode 100644 docker-compose.yml diff --git a/README.md b/README.md index 70b9d02..1b2074f 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,9 @@ In theory, it should work, but I don't have the time nor inclination to test it. ## Up-and-Running with Docker Compose -Example `docker-compose.yml` extract +You can find these as files here: [`docker-compose.yml` example](https://github.com/sdr-enthusiasts/docker-shipfeeder/blob/main/config-examples/docker-compose.yml.sample); [`.env` example](https://github.com/sdr-enthusiasts/docker-shipfeeder/blob/main/config-examples/.env.sample) + +Example `docker-compose.yml` extract. ```yaml version: '3.8' @@ -201,7 +203,7 @@ If the `AISCATCHER_CHANNELS` and `AISCATCHER_DECODER_XXXX` parameters listed abo ### Easy sharing with other services -This table shows which parameters to set and how to obtain credentials for a number of well-known AIS aggregators: +This table shows which parameters to set and how to obtain credentials for a number of well-known AIS aggregators. A (partial) list of these aggregators can be found [here](https://docs.google.com/spreadsheets/d/1W9uuuS2tGHcNENm7Ze3M1UPl2u8tMZv2N_bID6x060Y/edit?usp=sharing) | Name | Parameter | Default IP/DNS/URL | Feeding protocol:
UDP/TCP/HTTP/Other | How to register for a key or ID | | ---- | --------- | ------------------ | --------------------------------------- | ------------------------------- | diff --git a/config-examples/README.md b/config-examples/README.md deleted file mode 100644 index 2243609..0000000 --- a/config-examples/README.md +++ /dev/null @@ -1,137 +0,0 @@ -# Configuration Examples for ShipXplorer - -[![Discord](https://img.shields.io/discord/734090820684349521)](https://discord.gg/sTf9uYF) - -- [Configuration Examples for ShipXplorer](#configuration-examples-for-shipxplorer) - - [Introduction](#introduction) - - [Installing `docker` on your machine](#installing-docker-on-your-machine) - - [Downloading the sample configuration](#downloading-the-sample-configuration) - - [Prep and download the sample configuration files](#prep-and-download-the-sample-configuration-files) - - [Configuring your station](#configuring-your-station) - - [Starting your AIS Feeder](#starting-your-ais-feeder) - - [See ships and station data on your webpage](#see-ships-and-station-data-on-your-webpage) - - [Troubleshooting](#troubleshooting) - - [Advanced configuration](#advanced-configuration) - - [Getting Help](#getting-help) - -## Introduction - -While the main README.md has information on how to configure and set up the container, this README describes how a practical setup could look. -We will cover 4 containers: - -- the ShipXplorer container to decode data and feed to ShipXplorer and many other services -- VesselAlert to send alerts about new vessels to Mastodon or Discord -- AIS-Screenshot, a "helper" container for VesselAlert that provides screenshots of the map for addition to the alert notifications -- WatchTower to ensure that the containers are kept up to date - -Before you go on, you should: - -- Get the Latitude and Longitude of your receiver -- follow the [instructions][shipxplorer] and get a ShipXplorer Sharing Key and Serial Number -- know what serial number of your RTL-SDR dongle is (hint: use `rtl_test` to find out) -- sign up and collect credentials (mostly IP addresses and UDP ports) of any other services you want to feed -- [Get credentials][mastodon] if you want to send notifications to Mastodon -- Get one or more Discord Webhooks. If you want to send notification to our special [`#Vessel-Alerts` Discord Channel](https://discord.gg/UMgZMc2AGp), you can keep the Webhook in the `.env` sample file! -- Last, if your machine is NOT a Raspberry Pi, you should follow [this "work-around for CPU Serial Number"](https://github.com/sdr-enthusiasts/docker-shipxplorer#workaround-for-cpu-serial-only-needed-with-non-raspberry-pi-systems) before doing anything else. - -## Installing `docker` on your machine - -Follow the instructions here: [https://github.com/sdr-enthusiasts/docker-install](https://github.com/sdr-enthusiasts/docker-install) - -## Downloading the sample configuration - -The provided [sample `docker-compose.yml`](docker-compose.yml.sample) and [sample `environment variables`](.env.sample) files can be used as-is, unedited (after renaming them of course). If you use your machine for multiple purposes, we recommend putting your AIS containers in a separate stack from other containers. This is purely for ease of maintenance -- strictly speaking, you *can* put all containers in a single stack. - -Here's what you do: - -## Prep and download the sample configuration files - -Log into your machine with the AIS dongle, and type or copy/paste this: - -```bash -sudo mkdir /opt/ais -sudo chmod a+rwx /opt/ais -cd /opt/ais -curl https://raw.githubusercontent.com/sdr-enthusiasts/docker-shipxplorer/main/config-examples/docker-compose.yml.sample -o docker-compose.yml -curl https://raw.githubusercontent.com/sdr-enthusiasts/docker-shipxplorer/main/config-examples/.env.sample -o .env -``` - -## Configuring your station - -Next thing is to edit the `.env` file and put your data in: - -```bash -nano /opt/ais/.env -``` - -Make the changes based on the description below, and once you are done, you can Save & Exit with CTRL-x - -| Parameter | Description | -|---------------|---------------| -| `FEEDER_LAT` | The latitude (xx.xxxxx) of your station | -| `FEEDER_LONG` | The longitude (xx.xxxxx) of your station | -| `SX_SHARING_KEY` | You ShipXplorer Sharing Key. This is a long string with numbers and letters | -| `SX_SERIAL_NUMBER` | Your ShipXplorer Serial Number. This looks like `SXTRPI000000` | -| `SX_RTLSDR_DEVICE_SERIAL` | The serial string of your AIS RTL-SDR dongle | -| `SX_RTLSDR_GAIN` | The gain of your RTL-SDR dongle. If you don't know what to put, we recommend leaving it set to `auto` | -| `SX_UDP_FEEDS` | If you want to feed any other services using UDP, you can enter them with this parameter. The format is `ip_or_hostname:port` and they are comma separated. See the example in the file. | -| `SX_EXTRA_OPTIONS` | Here you can put additional parameters as described for [Ais-Catcher](https://github.com/jvde-github/AIS-catcher#usage). These are like a command-line: just put spaces between sets of parameter. Examples: | -| | `-p -2` sets the PPM correction to `-2` | -| | `-a 192K` sets the tuner bandwidth to 192 kHz (recommended!) | -| | `-H http://aprs.fi/jsonais/post/zxxxxxxV ID AB1CE PROTOCOL aprs INTERVAL 30 RESPONSE off` uploads data to `aprs.fi` using HTTP | -| | et cetera | -| `SX_STATION_NAME` | Your station name. The text needs to be "web save": instead of spaces, please put ` ` between the words | -| `VA_MASTODON_SERVER` | The Mastodon server your account is on. For example `airwaves.social` | -| `VA_MASTODON_ACCESS_TOKEN` | The Mastodon Access Token you got when you created an app | -| `VA_MASTODON_SKIP_FILTER` | Skips notifications for any MMSI that matches this RegEx. For example, `^[9]{2}[0-9]{7}$$|^[0-9]{7}$$` filters any MMSI of 9 digits that start with `99` (which are Aids-to-Navigation: virtual waypoints) and it also filters any 7-digit MMSI. | -| `VA_MASTODON_CUSTOM_FIELD` | Additional text you want to add to your Mastodon notification | -| `VA_DISCORD_NAME` | Please put something meaningful here, containing both your STATION NAME and the LOCATION. We're a world-wide group! | -| `VA_DISCORD_AVATAR_URL` | Link to a URL that contains your avatar / picture | -| `VA_DISCORD_WEBHOOKS` | Webhook(s) for Discord notifications. If you have multiple channels your want to notify to, you can comma-separate them. We prefilled this field with one for our special [`#Vessel-Alerts` Discord Channel](https://discord.gg/UMgZMc2AGp) | -| `VA_SCREENSHOT_URL` | `http://ais-screenshot:5042` | -| `BACKUP_RETENTION_TIME` | Time (in days) to keep backups of `aiscatcher.bin` and plugins. Note - this only affects the backups of these files and not the active `aiscatcher.bin` or active plugins. Default: `30` (days) | - -## Starting your AIS Feeder - -Do this: - -```bash -cd /opt/ais -docker-compose pull -docker-compose up -d -``` - -The system checks every 30 minutes if there's a new version of any of the container. However, you can also manually check if there are updates by repeating the commands above. - -## See ships and station data on your webpage - -You can browse to `http://my_ip:90` (replace `my_ip` with the IP address of your machine) to see the AIS-Catcher web interface. - -## Troubleshooting - -If things aren't running the way they should be, your first course of action is to check the container logs. They often give hints on what when wrong and how to fix it. - -- If the web page doesn't work, or no data is sent to ShipXplorer, check the `shipxplorer` logs: `docker logs shipxplorer` -- If no notifications are sent, check the `VesselAlert` logs: `docker logs vesselalert` -- If the notification don't include a map, or the map screenshot is not good, check the `ais-screenshot` logs: `docker logs ais-screenshot` -Note -- you can "follow" the logs live by adding `-f` to the command: `docker logs -f shipxplorer` - -## Advanced configuration - -There are a few additional things you can configure by editing `docker-compose.yml`. Those shouldn't need changing under normal circumstances, but here they are in case you feel lucky: - -- Changing the web page port: in the `shipxplorer` section, change the port definition from `- 90:80` to `- xxxx:80`, where `xxxx` is your desired web port number -- Changing the check interval for new software versions: in the `watchtower` section, change the command line from `command: --interval 1800 --scope ais` to `command: --interval xxxx --scope ais`, where `xxxx` is the check interval in seconds -- If the screenshots don't quite render correctly, you may want to increase the render time in the `screenshot-ais` section: change `- LOAD_SLEEP_TIME=15` to ``- LOAD_SLEEP_TIME=30` or so (time in seconds for the container to wait for the web page to render before a screenshot is taken) -- Similarly, you can change the map type for the screenshot in the `screenshot-ais` section: change `OpenStreetMap` in `- MAP_ARGS=map=OpenStreetMap` to any of `Positron`, `Dark%20Matter`, `Voyager`, or `Satellite`. - -After making any of these changes, you should restart the containers with `docker-compose up -d --force-recreate` - -## Getting Help - -You can [log an issue](https://github.com/sdr-enthusiasts/docker-shipxplorer/issues) on the project's GitHub. - -We also have a [Discord channel](https://discord.gg/sTf9uYF), feel free to [join](https://discord.gg/sTf9uYF) and chat with us if you need help or want to exchange experiences. We'd love to hear from you!. - -[mastodon]: https://github.com/sdr-enthusiasts/docker-vesselalert/blob/main/README-Mastodon.md -[shipxplorer]: https://github.com/sdr-enthusiasts/docker-shipxplorer#readme diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index c06012f..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,36 +0,0 @@ -version: '3.8' -services: - shipxplorer: - image: ghcr.io/sdr-enthusiasts/shipxplorer - container_name: shipxplorer - hostname: shipxplorer - restart: always - environment: - - SHARING_KEY=${SX_SHARING_KEY} - - SERIAL_NUMBER=${SX_SERIAL_NUMBER} - - RTLSDR_DEVICE_SERIAL=${AIS_device_serial} - - VERBOSE_LOGS=true - - UDP_FEEDS=${SX_UDP_FEEDS} - - RTLSDR_DEVICE_GAIN=${AIS_DEVICE_GAIN} - - SXFEEDER_EXTRA_OPTIONS=${SXFEEDER_EXTRA_OPTIONS} - - AISCATCHER_EXTRA_OPTIONS=${AIS_EXTRA_OPTIONS} - - STATION_NAME='Put your station name here' - - STATION_URL=https://my-ais-url.com - - BACKUP_INTERVAL=10 - - STATION_HISTORY=3600 - - SXFEEDER_LAT=42.12345 - - SXFEEDER_LON=-71.12345 - - AISCATCHER_SHAREDATA=true - - SITESHOW=on - ports: - - 8080:80 - device_cgroup_rules: - - 'c 189:* rwm' - tmpfs: - - /tmp - volumes: - - "/etc/localtime:/etc/localtime:ro" - - "/etc/timezone:/etc/timezone:ro" - - "/opt/ais/shipxplorer/data:/data" - - "/dev:/dev:ro" - # - /opt/shipxplorer/cpuinfo/cpuinfo:/proc/cpuinfo # only for x86 systems - see README.md From 0468cfa5a71d193806582b7ad898da405e92ffd0 Mon Sep 17 00:00:00 2001 From: kx1t Date: Fri, 15 Mar 2024 15:46:25 -0400 Subject: [PATCH 13/20] documentation updates --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1b2074f..c140379 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ services: Example accompanying `.env` file: -```text +```ini # ShipFeeder receiver and webpage related parameters: FEEDER_LAT=xx.xxxxxx FEEDER_LONG=yy.yyyyyy From 4e6e5305c625bb85fb587d0a515ebb78e9577ded Mon Sep 17 00:00:00 2001 From: kx1t Date: Fri, 15 Mar 2024 15:47:43 -0400 Subject: [PATCH 14/20] doc updates --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c140379..6e54e4d 100644 --- a/README.md +++ b/README.md @@ -203,7 +203,7 @@ If the `AISCATCHER_CHANNELS` and `AISCATCHER_DECODER_XXXX` parameters listed abo ### Easy sharing with other services -This table shows which parameters to set and how to obtain credentials for a number of well-known AIS aggregators. A (partial) list of these aggregators can be found [here](https://docs.google.com/spreadsheets/d/1W9uuuS2tGHcNENm7Ze3M1UPl2u8tMZv2N_bID6x060Y/edit?usp=sharing) +This table shows which parameters to set and how to obtain credentials for a number of well-known AIS aggregators. A (partial) list of these aggregators and instructions on how to get a key or port for them can be found [here](https://docs.google.com/spreadsheets/d/1W9uuuS2tGHcNENm7Ze3M1UPl2u8tMZv2N_bID6x060Y/edit?usp=sharing) | Name | Parameter | Default IP/DNS/URL | Feeding protocol:
UDP/TCP/HTTP/Other | How to register for a key or ID | | ---- | --------- | ------------------ | --------------------------------------- | ------------------------------- | From dc737af7e9a653ebc3b827fa47d1958879a432be Mon Sep 17 00:00:00 2001 From: kx1t Date: Fri, 15 Mar 2024 15:56:44 -0400 Subject: [PATCH 15/20] documentation updates --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 6e54e4d..22c73df 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,23 @@ [![Discord](https://img.shields.io/discord/734090820684349521)](https://discord.gg/sTf9uYF) +## What's New + +So you came here expecting `docker-shipxplorer`? As of March 15, 2024 (*the Ides of March*!), the `docker-shipxplorer` repo has been renamed to `docker-shipfeeder`. The container can do so much more than just feeding ShipXplorer, and the new name covers the scope of what we're doing much better! + +We're still enthusiastic feeders of AIS data to AirNav's ShipXplorer, and the amount of support that company has provided to the community is much appreciated. No changes there! + +The newly updated container now also allows you to much easier configure feeding the other aggregators, see the [Feeding AIS Aggregator Services](#feeding-ais-aggregator-services) section! + +In adding all these improvements, we didn't forget our current users: the container is fully backwards compatible with the settings and environment variables you are already using. So no change is needed, unless you want to. We're also automatically producing two container images in parallel - they are exactly the same except for their names: `ghcr.io/sdr-enthusiasts/docker-shipfeeder` (new!) and `ghcr.io/sdr-enthusiasts/shipxplorer` (legacy). + +If you need help, feel free to chat with us at the Discord server that is linked elsewhere in this Readme. + +## Table of Contents + - [sdr-enthusiasts/docker-shipfeeder](#sdr-enthusiastsdocker-shipfeeder) + - [What's New](#whats-new) + - [Table of Contents](#table-of-contents) - [Prerequisites](#prerequisites) - [Multi Architecture Support](#multi-architecture-support) - [Up-and-Running with Docker Compose](#up-and-running-with-docker-compose) From 2a610038023898119be4f74c56f4eee5b4867208 Mon Sep 17 00:00:00 2001 From: kx1t Date: Fri, 15 Mar 2024 16:07:53 -0400 Subject: [PATCH 16/20] documentation and (C) dates updates --- README.md | 20 +++++++++++++++++++ .../etc/s6-overlay/scripts/10-container-init | 2 +- rootfs/etc/s6-overlay/scripts/40-sxfeeder | 2 +- .../etc/s6-overlay/scripts/50-update-plugins | 2 +- .../scripts/60-backup-aiscatcher_bin | 2 +- rootfs/etc/s6-overlay/scripts/aiscatcher | 2 +- .../s6-overlay/scripts/check-about-updates | 2 +- .../s6-overlay/scripts/check-plugin-updates | 2 +- rootfs/etc/s6-overlay/scripts/down-aiscatcher | 2 +- rootfs/etc/s6-overlay/scripts/sxfeeder | 2 +- 10 files changed, 29 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 22c73df..81baee7 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,8 @@ If you need help, feel free to chat with us at the Discord server that is linked - [Aggregating multiple instances of the container](#aggregating-multiple-instances-of-the-container) - [Hardware requirements](#hardware-requirements) - [Getting Help](#getting-help) + - [Acknowledgements](#acknowledgements) + - [License](#license) Docker container for feeding many AIS aggregators, showing a local map with ships heard, etc. The container uses [AIS-Catcher](https://aiscatcher.org) and also includes [AirNav ShipXplorer](https://www.shipxplorer.com)'s `sxfeeder`. Builds and runs on `arm64`, `armv7/armhf`, and `amd64/x86`. @@ -438,3 +440,21 @@ Last - the software will run on a Raspberry Pi 3B+ or 4, with Raspberry Pi OS, U You can [log an issue](https://github.com/sdr-enthusiasts/docker-shipfeeder/issues) on the project's GitHub. I also have a [Discord channel](https://discord.gg/sTf9uYF), feel free to [join](https://discord.gg/sTf9uYF) and converse. + +## Acknowledgements + +This effort wouldn't exist without much help and advice of the following individuals: + +- [JvdE-Github](https://github.com/jvde-github/ais-catcher), who created the excellent `ais-catcher` package which forms the basis of this container +- [Wiedehopf]((https://github.com/wiedehopf) without whose advice we'd all still live in the stone age +- [John Norrbin](https://github.com/Johnex) for his ideas, testing, feature requests, more testing, nagging, pushing, prodding, and overall efforts to make this a high quality container and for the USB "hotplug" configuration +- The community at the [SDR-Enthusiasts Discord Server](https://discord.gg/sTf9uYF) for helping out, testing, asking questions, and generally driving to make this a better productn +- [Pete](https://pliw.co.uk/ais) who provided access and major help testing new features + +## License + +Copyright (C) 2022-2024, Ramon F. Kolb (kx1t) + +This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . \ No newline at end of file diff --git a/rootfs/etc/s6-overlay/scripts/10-container-init b/rootfs/etc/s6-overlay/scripts/10-container-init index f33508c..c659855 100755 --- a/rootfs/etc/s6-overlay/scripts/10-container-init +++ b/rootfs/etc/s6-overlay/scripts/10-container-init @@ -6,7 +6,7 @@ APPNAME="10-container-init" s6wrap=(s6wrap --quiet --timestamps --prepend="${APPNAME}") #--------------------------------------------------------------------------------------------- -# Copyright (C) 2022-2023, Ramon F. Kolb (kx1t) +# Copyright (C) 2022-2024, Ramon F. Kolb (kx1t) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the diff --git a/rootfs/etc/s6-overlay/scripts/40-sxfeeder b/rootfs/etc/s6-overlay/scripts/40-sxfeeder index 28c4057..5912089 100755 --- a/rootfs/etc/s6-overlay/scripts/40-sxfeeder +++ b/rootfs/etc/s6-overlay/scripts/40-sxfeeder @@ -4,7 +4,7 @@ source /scripts/common #--------------------------------------------------------------------------------------------- -# Copyright (C) 2022-2023, Ramon F. Kolb (kx1t) +# Copyright (C) 2022-2024, Ramon F. Kolb (kx1t) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the diff --git a/rootfs/etc/s6-overlay/scripts/50-update-plugins b/rootfs/etc/s6-overlay/scripts/50-update-plugins index f8c222d..1ad20b1 100755 --- a/rootfs/etc/s6-overlay/scripts/50-update-plugins +++ b/rootfs/etc/s6-overlay/scripts/50-update-plugins @@ -4,7 +4,7 @@ source /scripts/common #--------------------------------------------------------------------------------------------- -# Copyright (C) 2022-2023, Ramon F. Kolb (kx1t) +# Copyright (C) 2022-2024, Ramon F. Kolb (kx1t) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the diff --git a/rootfs/etc/s6-overlay/scripts/60-backup-aiscatcher_bin b/rootfs/etc/s6-overlay/scripts/60-backup-aiscatcher_bin index f6bbe3d..ff658f3 100755 --- a/rootfs/etc/s6-overlay/scripts/60-backup-aiscatcher_bin +++ b/rootfs/etc/s6-overlay/scripts/60-backup-aiscatcher_bin @@ -4,7 +4,7 @@ source /scripts/common #--------------------------------------------------------------------------------------------- -# Copyright (C) 2022-2023, Ramon F. Kolb (kx1t) +# Copyright (C) 2022-2024, Ramon F. Kolb (kx1t) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the diff --git a/rootfs/etc/s6-overlay/scripts/aiscatcher b/rootfs/etc/s6-overlay/scripts/aiscatcher index 802f565..5fc321b 100755 --- a/rootfs/etc/s6-overlay/scripts/aiscatcher +++ b/rootfs/etc/s6-overlay/scripts/aiscatcher @@ -6,7 +6,7 @@ APPNAME="aiscatcher" s6wrap=(s6wrap --quiet --timestamps --prepend="${APPNAME}") #--------------------------------------------------------------------------------------------- -# Copyright (C) 2022-2023, Ramon F. Kolb (kx1t) +# Copyright (C) 2022-2024, Ramon F. Kolb (kx1t) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the diff --git a/rootfs/etc/s6-overlay/scripts/check-about-updates b/rootfs/etc/s6-overlay/scripts/check-about-updates index 0c3fe84..86e2fac 100755 --- a/rootfs/etc/s6-overlay/scripts/check-about-updates +++ b/rootfs/etc/s6-overlay/scripts/check-about-updates @@ -6,7 +6,7 @@ APPNAME="check-about-updates" s6wrap=(s6wrap --quiet --timestamps --prepend="${APPNAME}") #--------------------------------------------------------------------------------------------- -# Copyright (C) 2022-2023, Ramon F. Kolb (kx1t) +# Copyright (C) 2022-2024, Ramon F. Kolb (kx1t) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the diff --git a/rootfs/etc/s6-overlay/scripts/check-plugin-updates b/rootfs/etc/s6-overlay/scripts/check-plugin-updates index 5f1e18f..e5a6886 100755 --- a/rootfs/etc/s6-overlay/scripts/check-plugin-updates +++ b/rootfs/etc/s6-overlay/scripts/check-plugin-updates @@ -4,7 +4,7 @@ source /scripts/common #--------------------------------------------------------------------------------------------- -# Copyright (C) 2022-2023, Ramon F. Kolb (kx1t) +# Copyright (C) 2022-2024, Ramon F. Kolb (kx1t) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the diff --git a/rootfs/etc/s6-overlay/scripts/down-aiscatcher b/rootfs/etc/s6-overlay/scripts/down-aiscatcher index c48616b..9e684ce 100755 --- a/rootfs/etc/s6-overlay/scripts/down-aiscatcher +++ b/rootfs/etc/s6-overlay/scripts/down-aiscatcher @@ -2,7 +2,7 @@ #shellcheck shell=bash #--------------------------------------------------------------------------------------------- -# Copyright (C) 2022-2023, Ramon F. Kolb (kx1t) +# Copyright (C) 2022-2024, Ramon F. Kolb (kx1t) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the diff --git a/rootfs/etc/s6-overlay/scripts/sxfeeder b/rootfs/etc/s6-overlay/scripts/sxfeeder index 5b6ab27..67c05ab 100755 --- a/rootfs/etc/s6-overlay/scripts/sxfeeder +++ b/rootfs/etc/s6-overlay/scripts/sxfeeder @@ -7,7 +7,7 @@ APPNAME="sxfeeder" s6wrap=(s6wrap --quiet --timestamps --prepend="${APPNAME}") #--------------------------------------------------------------------------------------------- -# Copyright (C) 2022-2023, Ramon F. Kolb (kx1t) +# Copyright (C) 2022-2024, Ramon F. Kolb (kx1t) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the From ee0d5a0d36030469176a4515b8fca7151d75d30c Mon Sep 17 00:00:00 2001 From: kx1t Date: Fri, 15 Mar 2024 16:08:23 -0400 Subject: [PATCH 17/20] linter fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 81baee7..05d3f32 100644 --- a/README.md +++ b/README.md @@ -457,4 +457,4 @@ Copyright (C) 2022-2024, Ramon F. Kolb (kx1t) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . \ No newline at end of file +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . From 1722e362519e71ed09871f3dcdbfea8ec096608b Mon Sep 17 00:00:00 2001 From: kx1t Date: Fri, 15 Mar 2024 16:23:32 -0400 Subject: [PATCH 18/20] doc updates --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 05d3f32..6d1b086 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,8 @@ In theory, it should work, but I don't have the time nor inclination to test it. You can find these as files here: [`docker-compose.yml` example](https://github.com/sdr-enthusiasts/docker-shipfeeder/blob/main/config-examples/docker-compose.yml.sample); [`.env` example](https://github.com/sdr-enthusiasts/docker-shipfeeder/blob/main/config-examples/.env.sample) -Example `docker-compose.yml` extract. +Example `docker-compose.yml` extract -
+ <‐‐ Click the arrow to see the docker-compose.yml text. ```yaml version: '3.8' @@ -169,10 +170,10 @@ VESSELFINDER_UDP_PORT=xxxx VESSELTRACKER_UDP_PORT=xxxx ``` -Replace the `SHARING_KEY`, `SERIAL_NUMBER`, and `RTLSDR_DEVICE_SERIAL` with the appropriate values. +Replace these parameters with the appropriate values. You can use `rtl_test` to see which devices and device serials are connected to your machine, or `rtl_eeprom` to rename the device's serial number. -In `SX_EXTRA_OPTIONS`, the `-p` directive indicates the PPM value of your SDR. Adapt it to your needs. +
## Runtime Environment Variables @@ -446,7 +447,7 @@ I also have a [Discord channel](https://discord.gg/sTf9uYF), feel free to [join] This effort wouldn't exist without much help and advice of the following individuals: - [JvdE-Github](https://github.com/jvde-github/ais-catcher), who created the excellent `ais-catcher` package which forms the basis of this container -- [Wiedehopf]((https://github.com/wiedehopf) without whose advice we'd all still live in the stone age +- [Wiedehopf](https://github.com/wiedehopf) without whose advice we'd all still live in the stone age - [John Norrbin](https://github.com/Johnex) for his ideas, testing, feature requests, more testing, nagging, pushing, prodding, and overall efforts to make this a high quality container and for the USB "hotplug" configuration - The community at the [SDR-Enthusiasts Discord Server](https://discord.gg/sTf9uYF) for helping out, testing, asking questions, and generally driving to make this a better productn - [Pete](https://pliw.co.uk/ais) who provided access and major help testing new features From fa7ecea5ef17d0d7e4134179b694ee5a87edb611 Mon Sep 17 00:00:00 2001 From: kx1t Date: Fri, 15 Mar 2024 16:24:58 -0400 Subject: [PATCH 19/20] doc updates --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6d1b086..266bdc1 100644 --- a/README.md +++ b/README.md @@ -72,8 +72,8 @@ In theory, it should work, but I don't have the time nor inclination to test it. You can find these as files here: [`docker-compose.yml` example](https://github.com/sdr-enthusiasts/docker-shipfeeder/blob/main/config-examples/docker-compose.yml.sample); [`.env` example](https://github.com/sdr-enthusiasts/docker-shipfeeder/blob/main/config-examples/.env.sample) -Example `docker-compose.yml` extract -
- <‐‐ Click the arrow to see the docker-compose.yml text. +
+ <‐‐ Click the arrow to see the docker-compose.yml and .env examples ```yaml version: '3.8' From f15e39de1dc96b8f7bfedee3472d3406d26732f4 Mon Sep 17 00:00:00 2001 From: kx1t Date: Wed, 20 Mar 2024 11:21:13 -0400 Subject: [PATCH 20/20] update shipxplorer -> shipfeeder --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5158e13..28dea7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,7 +48,7 @@ echo "TARGETARCH $TARGETARCH" && \ "${TEMP_PACKAGES[@]}" \ && \ # - # install shipxplorer packages + # install shipfeeder packages apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 1D043681 && \ echo 'deb https://apt.rb24.com/ bullseye main' > /etc/apt/sources.list.d/rb24.list && \ # @@ -86,8 +86,8 @@ RUN set -x && \ pushd /tmp && \ branch="##BRANCH##" && \ [[ "${branch:0:1}" == "#" ]] && branch="main" || true && \ - git clone --depth=1 -b "$branch" https://github.com/sdr-enthusiasts/docker-shipxplorer.git && \ - cd docker-shipxplorer && \ + git clone --depth=1 -b "$branch" https://github.com/sdr-enthusiasts/docker-shipfeeder.git && \ + cd docker-shipfeeder && \ echo "$(TZ=UTC date +%Y%m%d-%H%M%S)_$(git rev-parse --short HEAD)_$(git branch --show-current)" > "/.CONTAINER_VERSION" && \ popd && \ rm -rf /tmp/*