Skip to content
Merged
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
31 changes: 25 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ RUN cd /tmp \
&& rm -rf /tmp/slowrx

# Build SatDump (weather satellite decoder - NOAA APT & Meteor LRPT) — pinned to v1.2.2
# Split into compile (heavy, cached) and staging (light, safe to change) layers
RUN cd /tmp \
&& git clone --depth 1 --branch 1.2.2 https://github.com/SatDump/SatDump.git \
&& cd SatDump \
Expand All @@ -147,14 +148,29 @@ RUN cd /tmp \
fi; \
done; \
fi \
# Copy SatDump install artifacts to staging
&& cp -a /usr/local/bin/satdump /staging/usr/local/bin/ 2>/dev/null || true \
&& cp -a /usr/local/lib/libsatdump* /staging/usr/local/lib/ 2>/dev/null || true \
&& cp -a /usr/local/lib/satdump /staging/usr/local/lib/ 2>/dev/null || true \
&& cp -a /usr/local/share/satdump /staging/usr/local/share/ 2>/dev/null; mkdir -p /staging/usr/local/share \
&& cp -a /usr/local/share/satdump /staging/usr/local/share/ 2>/dev/null || true \
&& rm -rf /tmp/SatDump

# Stage SatDump artifacts (separate layer so compile cache survives staging changes)
# On arm64 cmake installs to /usr/{bin,lib,share}; on x86 to /usr/local/{bin,lib,share}
RUN mkdir -p /staging/usr/local/share /staging/usr/local/lib/satdump/plugins \
# Binary
&& (cp -a /usr/local/bin/satdump /staging/usr/local/bin/ 2>/dev/null \
|| cp -a /usr/bin/satdump /staging/usr/local/bin/) \
# Core shared library
&& (cp -a /usr/local/lib/libsatdump* /staging/usr/local/lib/ 2>/dev/null \
|| cp -a /usr/lib/libsatdump* /staging/usr/local/lib/) \
# Plugins
&& (cp -a /usr/local/lib/satdump/plugins/*.so /staging/usr/local/lib/satdump/plugins/ 2>/dev/null \
|| cp -a /usr/lib/satdump/plugins/*.so /staging/usr/local/lib/satdump/plugins/ 2>/dev/null \
|| true) \
# Pipeline definitions and resources
&& (cp -a /usr/local/share/satdump /staging/usr/local/share/ 2>/dev/null \
|| cp -a /usr/share/satdump /staging/usr/local/share/) \
# Verify
&& test -x /staging/usr/local/bin/satdump \
&& ls /staging/usr/local/share/satdump/pipelines/*.json >/dev/null 2>&1 \
&& echo "SatDump staging OK: $(ls /staging/usr/local/share/satdump/pipelines/*.json | wc -l) pipeline files"

# Build hackrf CLI tools from source — avoids libhackrf0 version conflict
# between the 'hackrf' apt package and soapysdr-module-hackrf's newer libhackrf0
RUN cd /tmp \
Expand Down Expand Up @@ -219,6 +235,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libpng16-16 \
libtiff6 \
libjemalloc2 \
libfftw3-double3 \
libfftw3-single3 \
libvolk-bin \
libnng1 \
libzstd1 \
Expand Down Expand Up @@ -254,6 +272,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
COPY --from=builder /staging/usr/bin/ /usr/bin/
COPY --from=builder /staging/usr/local/bin/ /usr/local/bin/
COPY --from=builder /staging/usr/local/lib/ /usr/local/lib/
COPY --from=builder /staging/usr/local/share/ /usr/local/share/
COPY --from=builder /staging/opt/ /opt/

# Copy radiosonde Python dependencies installed during builder stage
Expand Down
5 changes: 5 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,11 @@ def get_sdr_device_status() -> dict[str, str]:

@app.before_request
def require_login():
# Skip auth entirely when INTERCEPT_DISABLE_AUTH is set
if os.environ.get('INTERCEPT_DISABLE_AUTH', '').lower() in ('1', 'true', 'yes'):
session['logged_in'] = True
return None

# Routes that don't require login (to avoid infinite redirect loop)
allowed_routes = ["login", "static", "favicon", "health", "health_check"]

Expand Down
19 changes: 8 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@
# Basic usage (build locally):
# docker compose --profile basic up -d --build
#
# Basic usage (pre-built image from registry):
# INTERCEPT_IMAGE=ghcr.io/user/intercept:latest docker compose --profile basic up -d
#
# With ADS-B history (Postgres):
# docker compose --profile history up -d

services:
intercept:
# When INTERCEPT_IMAGE is set, use that pre-built image; otherwise build locally
image: ${INTERCEPT_IMAGE:-intercept:latest}
# Always build and use the local image
image: intercept:latest
build: .
pull_policy: never
container_name: intercept
ports:
- "5050:5050"
Expand Down Expand Up @@ -72,9 +70,10 @@ services:
# ADS-B history with Postgres persistence
# Enable with: docker compose --profile history up -d
intercept-history:
# Same image/build fallback pattern as above
image: ${INTERCEPT_IMAGE:-intercept:latest}
# Always build and use the local image
image: intercept:latest
build: .
pull_policy: never
container_name: intercept-history
profiles:
- history
Expand Down Expand Up @@ -112,6 +111,8 @@ services:
- INTERCEPT_ADSB_AUTO_START=${INTERCEPT_ADSB_AUTO_START:-false}
# Shared observer location across modules
- INTERCEPT_SHARED_OBSERVER_LOCATION=${INTERCEPT_SHARED_OBSERVER_LOCATION:-true}
# Disable login auth (set to true for local/dev use)
- INTERCEPT_DISABLE_AUTH=${INTERCEPT_DISABLE_AUTH:-false}
# Default observer coordinates (set to your location to skip the GPS prompt)
# - INTERCEPT_DEFAULT_LAT=${INTERCEPT_DEFAULT_LAT:-0}
# - INTERCEPT_DEFAULT_LON=${INTERCEPT_DEFAULT_LON:-0}
Expand Down Expand Up @@ -142,7 +143,3 @@ services:
interval: 10s
timeout: 5s
retries: 5

# Optional: Add volume for persistent SQLite database
# volumes:
# intercept-data:
30 changes: 27 additions & 3 deletions routes/vdl2.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,35 @@ def stream_vdl2_output(process: subprocess.Popen, is_text_mode: bool = False) ->
data['type'] = 'vdl2'
data['timestamp'] = datetime.utcnow().isoformat() + 'Z'

# Enrich with translated ACARS label at top level (consistent with ACARS route)
# Flatten nested VDL2 identifying fields to top level for correlator matching
# dumpvdl2 nests flight/reg inside vdl2.avlc.acars and ICAO in avlc.src.addr
try:
vdl2_inner = data.get('vdl2', data)
acars_payload = (vdl2_inner.get('avlc') or {}).get('acars')
if acars_payload and acars_payload.get('label'):
avlc = vdl2_inner.get('avlc') or {}
acars_payload = avlc.get('acars') or {}

# Promote AVLC source address — this is the aircraft ICAO hex
# Do this FIRST so even non-ACARS VDL2 frames can be correlated
src = avlc.get('src') or {}
src_addr = src.get('addr', '')
src_type = src.get('type', '')
if src_addr and src_type == 'Aircraft':
data['icao'] = src_addr.upper()
data['addr'] = src_addr.upper()

# Promote ACARS fields to top level so FlightCorrelator can match them
if acars_payload.get('flight'):
data['flight'] = acars_payload['flight']
if acars_payload.get('reg'):
data['reg'] = acars_payload['reg']
data['tail'] = acars_payload['reg']
if acars_payload.get('label'):
data['label'] = acars_payload['label']
if acars_payload.get('msg_text'):
data['text'] = acars_payload['msg_text']

# Enrich with translated ACARS label (consistent with ACARS route)
if acars_payload.get('label'):
translation = translate_message({
'label': acars_payload.get('label'),
'text': acars_payload.get('msg_text', ''),
Expand Down
Loading
Loading