mirror of
https://github.com/smittix/intercept.git
synced 2026-04-25 23:29:59 -07:00
Enhance Docker environment with missing SDR dependencies
Added build and runtime dependencies for AIS-catcher, readsb (SoapySDR enabled), direwolf, and hcxtools. Included rx_tools build from source. Updated dependency checker to potentialy verify SoapySDR modules.
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -34,4 +34,7 @@ build/
|
|||||||
uv.lock
|
uv.lock
|
||||||
*.db
|
*.db
|
||||||
*.sqlite3
|
*.sqlite3
|
||||||
intercept.db
|
intercept.db
|
||||||
|
|
||||||
|
# Agent Files
|
||||||
|
.agent
|
||||||
66
Dockerfile
66
Dockerfile
@@ -31,6 +31,19 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
# GPS support
|
# GPS support
|
||||||
gpsd-clients \
|
gpsd-clients \
|
||||||
# Utilities
|
# Utilities
|
||||||
|
# APRS
|
||||||
|
direwolf \
|
||||||
|
# WiFi Extra
|
||||||
|
hcxdumptool \
|
||||||
|
hcxtools \
|
||||||
|
# SDR Hardware & SoapySDR
|
||||||
|
soapysdr-tools \
|
||||||
|
soapysdr-module-rtlsdr \
|
||||||
|
soapysdr-module-hackrf \
|
||||||
|
soapysdr-module-lms7 \
|
||||||
|
limesuite \
|
||||||
|
hackrf \
|
||||||
|
# Utilities
|
||||||
curl \
|
curl \
|
||||||
procps \
|
procps \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
@@ -43,6 +56,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
cmake \
|
cmake \
|
||||||
libncurses-dev \
|
libncurses-dev \
|
||||||
libsndfile1-dev \
|
libsndfile1-dev \
|
||||||
|
libsoapysdr-dev \
|
||||||
|
libhackrf-dev \
|
||||||
|
liblimesuite-dev \
|
||||||
|
libsqlite3-dev \
|
||||||
|
libcurl4-openssl-dev \
|
||||||
|
zlib1g-dev \
|
||||||
|
libzmq3-dev \
|
||||||
# Build dump1090
|
# Build dump1090
|
||||||
&& cd /tmp \
|
&& cd /tmp \
|
||||||
&& git clone --depth 1 https://github.com/flightaware/dump1090.git \
|
&& git clone --depth 1 https://github.com/flightaware/dump1090.git \
|
||||||
@@ -51,6 +71,34 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
&& cp dump1090 /usr/bin/dump1090-fa \
|
&& cp dump1090 /usr/bin/dump1090-fa \
|
||||||
&& ln -s /usr/bin/dump1090-fa /usr/bin/dump1090 \
|
&& ln -s /usr/bin/dump1090-fa /usr/bin/dump1090 \
|
||||||
&& rm -rf /tmp/dump1090 \
|
&& rm -rf /tmp/dump1090 \
|
||||||
|
# Build AIS-catcher
|
||||||
|
&& cd /tmp \
|
||||||
|
&& git clone https://github.com/jvde-github/AIS-catcher.git \
|
||||||
|
&& cd AIS-catcher \
|
||||||
|
&& mkdir build && cd build \
|
||||||
|
&& cmake .. \
|
||||||
|
&& make \
|
||||||
|
&& cp AIS-catcher /usr/bin/AIS-catcher \
|
||||||
|
&& cd /tmp \
|
||||||
|
&& rm -rf /tmp/AIS-catcher \
|
||||||
|
# Build readsb
|
||||||
|
&& cd /tmp \
|
||||||
|
&& git clone --depth 1 https://github.com/wiedehopf/readsb.git \
|
||||||
|
&& cd readsb \
|
||||||
|
&& make BLADERF=no PLUTOSDR=no SOAPYSDR=yes \
|
||||||
|
&& cp readsb /usr/bin/readsb \
|
||||||
|
&& cd /tmp \
|
||||||
|
&& rm -rf /tmp/readsb \
|
||||||
|
# Build rx_tools
|
||||||
|
&& cd /tmp \
|
||||||
|
&& git clone https://github.com/rxseger/rx_tools.git \
|
||||||
|
&& cd rx_tools \
|
||||||
|
&& mkdir build && cd build \
|
||||||
|
&& cmake .. \
|
||||||
|
&& make \
|
||||||
|
&& make install \
|
||||||
|
&& cd /tmp \
|
||||||
|
&& rm -rf /tmp/rx_tools \
|
||||||
# Build acarsdec
|
# Build acarsdec
|
||||||
&& cd /tmp \
|
&& cd /tmp \
|
||||||
&& git clone --depth 1 https://github.com/TLeconte/acarsdec.git \
|
&& git clone --depth 1 https://github.com/TLeconte/acarsdec.git \
|
||||||
@@ -62,11 +110,19 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
&& rm -rf /tmp/acarsdec \
|
&& rm -rf /tmp/acarsdec \
|
||||||
# Cleanup build tools to reduce image size
|
# Cleanup build tools to reduce image size
|
||||||
&& apt-get remove -y \
|
&& apt-get remove -y \
|
||||||
build-essential \
|
build-essential \
|
||||||
git \
|
git \
|
||||||
pkg-config \
|
pkg-config \
|
||||||
cmake \
|
cmake \
|
||||||
libncurses-dev \
|
libncurses-dev \
|
||||||
|
libsndfile1-dev \
|
||||||
|
libsoapysdr-dev \
|
||||||
|
libhackrf-dev \
|
||||||
|
liblimesuite-dev \
|
||||||
|
libsqlite3-dev \
|
||||||
|
libcurl4-openssl-dev \
|
||||||
|
zlib1g-dev \
|
||||||
|
libzmq3-dev \
|
||||||
&& apt-get autoremove -y \
|
&& apt-get autoremove -y \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ from __future__ import annotations
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import subprocess
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
logger = logging.getLogger('intercept.dependencies')
|
logger = logging.getLogger('intercept.dependencies')
|
||||||
@@ -32,6 +33,28 @@ def get_tool_path(name: str) -> str | None:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def check_soapy_factory(factory_name: str) -> bool:
|
||||||
|
"""Check if a SoapySDR factory/module is available using SoapySDRUtil."""
|
||||||
|
try:
|
||||||
|
# Run SoapySDRUtil --info and look for the factory in 'Available factories'
|
||||||
|
result = subprocess.run(['SoapySDRUtil', '--info'], capture_output=True, text=True)
|
||||||
|
if result.returncode != 0:
|
||||||
|
return False
|
||||||
|
|
||||||
|
# Parse output for available factories
|
||||||
|
# Format usually: "Available factories... hackrf, lime, rtlsdr"
|
||||||
|
for line in result.stdout.splitlines():
|
||||||
|
if "Available factories" in line:
|
||||||
|
factories = line.split("...")[-1].strip().split(",")
|
||||||
|
factories = [f.strip() for f in factories]
|
||||||
|
if factory_name in factories:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
except Exception as e:
|
||||||
|
logger.debug(f"Failed to check SoapySDR factory {factory_name}: {e}")
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
# Comprehensive tool dependency definitions
|
# Comprehensive tool dependency definitions
|
||||||
TOOL_DEPENDENCIES = {
|
TOOL_DEPENDENCIES = {
|
||||||
'pager': {
|
'pager': {
|
||||||
@@ -291,6 +314,7 @@ TOOL_DEPENDENCIES = {
|
|||||||
'SoapyLMS7': {
|
'SoapyLMS7': {
|
||||||
'required': False,
|
'required': False,
|
||||||
'description': 'SoapySDR plugin for LimeSDR',
|
'description': 'SoapySDR plugin for LimeSDR',
|
||||||
|
'soapy_factory': 'lime',
|
||||||
'install': {
|
'install': {
|
||||||
'apt': 'sudo apt install soapysdr-module-lms7',
|
'apt': 'sudo apt install soapysdr-module-lms7',
|
||||||
'brew': 'brew install soapylms7',
|
'brew': 'brew install soapylms7',
|
||||||
@@ -309,6 +333,7 @@ TOOL_DEPENDENCIES = {
|
|||||||
'SoapyHackRF': {
|
'SoapyHackRF': {
|
||||||
'required': False,
|
'required': False,
|
||||||
'description': 'SoapySDR plugin for HackRF',
|
'description': 'SoapySDR plugin for HackRF',
|
||||||
|
'soapy_factory': 'hackrf',
|
||||||
'install': {
|
'install': {
|
||||||
'apt': 'sudo apt install soapysdr-module-hackrf',
|
'apt': 'sudo apt install soapysdr-module-hackrf',
|
||||||
'brew': 'brew install soapyhackrf',
|
'brew': 'brew install soapyhackrf',
|
||||||
@@ -400,6 +425,9 @@ def check_all_dependencies() -> dict[str, dict[str, Any]]:
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.debug(f"Failed to import {tool}: {type(e).__name__}: {e}")
|
logger.debug(f"Failed to import {tool}: {type(e).__name__}: {e}")
|
||||||
installed = False
|
installed = False
|
||||||
|
# Check using SoapySDRUtil if specified
|
||||||
|
elif tool_config.get('soapy_factory'):
|
||||||
|
installed = check_soapy_factory(tool_config['soapy_factory'])
|
||||||
else:
|
else:
|
||||||
# Check for alternatives
|
# Check for alternatives
|
||||||
alternatives = tool_config.get('alternatives', [])
|
alternatives = tool_config.get('alternatives', [])
|
||||||
|
|||||||
Reference in New Issue
Block a user