Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ RUN set -x && \
KEPT_PACKAGES+=(libpqxx-dev) && \
KEPT_PACKAGES+=(lsb-release) && \
KEPT_PACKAGES+=(sqlite3) && \
# openssl CLI: Ed25519 key for the Open Waters station token
KEPT_PACKAGES+=(openssl) && \
TEMP_PACKAGES+=(make) && \
TEMP_PACKAGES+=(gcc) && \
TEMP_PACKAGES+=(g++) && \
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ services:
- HPRADAR_UDP_PORT=${HPRADAR_UDP_PORT}
- MARINETRAFFIC_UDP_PORT=${MARINETRAFFIC_UDP_PORT}
- MYSHIPTRACKING_UDP_PORT=${MYSHIPTRACKING_UDP_PORT}
- OPENWATERS_SHAREDATA=${OPENWATERS_SHAREDATA}
- OPENWATERS_TOKEN=${OPENWATERS_TOKEN}
- RADARVIRTUEL_FEEDER_KEY=${RADARVIRTUEL_FEEDER_KEY}
- RADARVIRTUEL_STATION_ID=${RADARVIRTUEL_STATION_ID}
- SDRMAP_STATION_ID=${SDRMAP_STATION_ID}
Expand Down Expand Up @@ -165,6 +167,8 @@ BOATBEACON_SHAREDATA=true
HPRADAR_UDP_PORT=xxxxx
MARINETRAFFIC_UDP_PORT=xxxxx
MYSHIPTRACKING_UDP_PORT=xxxxx
OPENWATERS_SHAREDATA=true
OPENWATERS_TOKEN=
RADARVIRTUEL_FEEDER_KEY=xxxxxxxxx
RADARVIRTUEL_STATION_ID=xx
SDRMAP_STATION_ID=xxxxxx
Expand Down Expand Up @@ -251,6 +255,7 @@ This table shows which parameters to set and how to obtain credentials for a num
| MarineTraffic | `MARINETRAFFIC_UDP_PORT` or<br/>`MARINETRAFFIC_TCP_PORT` | 5.9.207.224 | UDP / TCP | [https://www.marinetraffic.com/en/join-us/cover-your-area](https://www.marinetraffic.com/en/join-us/cover-your-area) Please use either the UDP option or the TCP option as instructed by MarineTraffic, but don't use both! |
| MLAT.uk | `MLATUK_SHAREDATA=true` | feed.mlat.uk:50001 | UDP | [https://shipfinder.co/about/coverage/](https://www.mlat.uk/contribute#ais) |
| MyShipTracking | `MYSHIPTRACKING_UDP_PORT` or<br/>`MYSHIPTRACKING_TCP_PORT` | 178.162.215.175 | UDP / TCP | [https://www.myshiptracking.com/help-center/contributors/add-your-station](https://www.myshiptracking.com/help-center/contributors/add-your-station) By default, you should use UDP to feed, unless you are specifically asked to use TCP by the company. Do not use both! |
| [Open Waters](https://openwaters.io/ais/) | `OPENWATERS_SHAREDATA=true` or<br/>`OPENWATERS_TOKEN` | `ais.openwaters.io` | HTTPS (UDP fallback) | Set `OPENWATERS_SHAREDATA=true`: no sign-up; the container creates a station key and a free token once (kept in `/data/openwaters`) and feeds over HTTPS, so your station has a stable identity and earns the feeder tier (raw feed back, higher limits). If a token cannot be obtained it feeds anonymously over UDP. To use an existing token, set `OPENWATERS_TOKEN` |
| SDRMap | `SDRMAP_STATION_ID`<br />`SDRMAP_PASSWORD` | [https://ais.feed.sdrmap.org/](https://ais.feed.sdrmap.org/) | HTTP | See here for instructions to get your STATION_ID and PASSWORD: <https://github.com/sdrmap/docs/wiki/2.1-Feeding#request-api-credentials> |
| 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` or<br/>`SHIPPINGEXPLORER_TCP_PORT` | 144.76.54.111 | UDP or TCP | Request UDP port at [https://www.shippingexplorer.net/en/contact](https://www.shippingexplorer.net/en/contact) By default, you should use UDP to feed, unless you are specifically asked to use TCP by the company. Do not use both! |
Expand Down
2 changes: 2 additions & 0 deletions config-examples/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ BOATBEACON_SHAREDATA=true
HPRADAR_UDP_PORT=xxxxx
MARINETRAFFIC_UDP_PORT=xxxxx
MYSHIPTRACKING_UDP_PORT=xxxxx
OPENWATERS_SHAREDATA=true
OPENWATERS_TOKEN=
RADARVIRTUEL_FEEDER_KEY=xxxxxxxxx
RADARVIRTUEL_STATION_ID=xx
SHIPFINDER_SHAREDATA=true
Expand Down
2 changes: 2 additions & 0 deletions config-examples/docker-compose.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ services:
- HPRADAR_UDP_PORT=${HPRADAR_UDP_PORT}
- MARINETRAFFIC_UDP_PORT=${MARINETRAFFIC_UDP_PORT}
- MYSHIPTRACKING_UDP_PORT=${MYSHIPTRACKING_UDP_PORT}
- OPENWATERS_SHAREDATA=${OPENWATERS_SHAREDATA}
- OPENWATERS_TOKEN=${OPENWATERS_TOKEN}
- RADARVIRTUEL_FEEDER_KEY=${RADARVIRTUEL_FEEDER_KEY}
- RADARVIRTUEL_STATION_ID=${RADARVIRTUEL_STATION_ID}
- SHIPFINDER_SHAREDATA=${SHIPFINDER_SHAREDATA}
Expand Down
27 changes: 27 additions & 0 deletions rootfs/etc/s6-overlay/scripts/aiscatcher
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,33 @@ if [[ -n "$AISHUB_UDP_PORT" ]] && [[ -n "$AISHUB_TCP_PORT" ]]; then
"${s6wrap[@]}" echo "[WARNING] Both AISHUB_UDP_PORT and AISHUB_TCP_PORT are defined. This may cause duplicate feeding to this aggregator. Please remove one of these from your environment!"
fi

# Open Waters (ais.openwaters.io, runs aiscast). OPENWATERS_TOKEN feeds over HTTPS under that token.
# OPENWATERS_SHAREDATA=true without a token makes a station key and token once (kept in /data/openwaters so the
# station keeps its identity across restarts) and feeds over HTTPS; if that fails it feeds anonymously over UDP.
OPENWATERS_URL="${OPENWATERS_URL:-https://ais.openwaters.io}"
if [[ -z "$OPENWATERS_TOKEN" ]] && chk_enabled "$OPENWATERS_SHAREDATA"; then
if [[ -s /data/openwaters/token ]]; then
OPENWATERS_TOKEN="$(cat /data/openwaters/token)"
elif command -v openssl >/dev/null && command -v curl >/dev/null && command -v jq >/dev/null; then
# the key and token are credentials: owner-only files
mkdir -p /data/openwaters && chmod 700 /data/openwaters
[[ -s /data/openwaters/key.pem ]] || (umask 077 && openssl genpkey -algorithm ed25519 -out /data/openwaters/key.pem 2>/dev/null)
OW_PUB="$(openssl pkey -in /data/openwaters/key.pem -pubout -outform DER 2>/dev/null | tail -c 32 | base64 | tr '+/' '-_' | tr -d '=\n')"
OW_TOKEN="$(curl -fsS -m 20 -X POST "${OPENWATERS_URL}/v1/keys" -H 'Content-Type: application/json' -d "{\"pubkey\":\"${OW_PUB}\"}" 2>/dev/null | jq -r '.token // empty' 2>/dev/null)"
if [[ -n "$OW_TOKEN" ]] && (umask 077 && printf '%s' "$OW_TOKEN" > /data/openwaters/token) 2>/dev/null; then
OPENWATERS_TOKEN="$OW_TOKEN"
"${s6wrap[@]}" echo "Open Waters: station token created and saved in /data/openwaters"
else
"${s6wrap[@]}" echo "[WARNING] Open Waters: could not obtain or save a station token; feeding anonymously over UDP instead"
fi
fi
fi
if [[ -n "$OPENWATERS_TOKEN" ]]; then
aiscatcher_command+=("-H ${OPENWATERS_URL}/v1/receive USERPWD x:${OPENWATERS_TOKEN} GZIP on INTERVAL 15")
elif chk_enabled "$OPENWATERS_SHAREDATA"; then
aiscatcher_command+=("-u ${OPENWATERS_UDP_HOST:-ais.openwaters.io} ${OPENWATERS_UDP_PORT:-10110}")
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")
Expand Down