mirror of
https://github.com/agessaman/meshcore-packet-capture.git
synced 2026-04-20 23:23:37 +00:00
Merge branch 'main' into dev
This commit is contained in:
commit
8537ccd9c4
5 changed files with 477 additions and 94 deletions
266
DOCKER.md
Normal file
266
DOCKER.md
Normal file
|
|
@ -0,0 +1,266 @@
|
|||
# Docker Deployment Guide
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Docker and Docker Compose installed
|
||||
- Linux host system (recommended for BLE and serial support)
|
||||
|
||||
## Quick Start
|
||||
|
||||
1. **Download configuration files**:
|
||||
```bash
|
||||
# Download docker-compose.yml and .env.local.example
|
||||
curl -O https://raw.githubusercontent.com/agessaman/meshcore-packet-capture/main/docker-compose.yml
|
||||
curl -O https://raw.githubusercontent.com/agessaman/meshcore-packet-capture/main/.env.local.example
|
||||
```
|
||||
|
||||
2. **Configure**:
|
||||
```bash
|
||||
# Copy example configuration
|
||||
cp .env.local.example .env.local
|
||||
# Edit .env.local with your settings (IATA code, MQTT broker, etc.)
|
||||
```
|
||||
|
||||
3. **Start the container**:
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
4. **View logs**:
|
||||
```bash
|
||||
docker compose logs -f meshcore-capture
|
||||
```
|
||||
|
||||
## Connection Types
|
||||
|
||||
### Serial Connection (Default)
|
||||
|
||||
The default configuration uses serial connection with `privileged: false` for improved security.
|
||||
|
||||
1. **Find your device**:
|
||||
```bash
|
||||
sudo ls -la /dev/serial/by-id/
|
||||
```
|
||||
|
||||
2. **Mount device in docker-compose.yml**:
|
||||
```yaml
|
||||
devices:
|
||||
- /dev/serial/by-id/usb-Heltec_HT-n5262_3D3B4D4A4D776001-if00:/dev/ttyUSB0
|
||||
```
|
||||
|
||||
3. **Configure serial port** (if not using `/dev/ttyUSB0`):
|
||||
```yaml
|
||||
environment:
|
||||
- PACKETCAPTURE_SERIAL_PORTS=/dev/ttyUSB0
|
||||
```
|
||||
|
||||
The container path defaults to `/dev/ttyUSB0`, so no additional configuration is needed if using the standard path.
|
||||
|
||||
### BLE Connection
|
||||
|
||||
1. **Enable privileged mode** in `docker-compose.yml`:
|
||||
```yaml
|
||||
privileged: true
|
||||
```
|
||||
|
||||
2. **Set connection type**:
|
||||
```yaml
|
||||
environment:
|
||||
- PACKETCAPTURE_CONNECTION_TYPE=ble
|
||||
```
|
||||
|
||||
3. **Optionally specify BLE device**:
|
||||
```yaml
|
||||
environment:
|
||||
- PACKETCAPTURE_BLE_ADDRESS=AA:BB:CC:DD:EE:FF
|
||||
# or
|
||||
- PACKETCAPTURE_BLE_DEVICE_NAME=MeshCore Device
|
||||
```
|
||||
|
||||
4. **Enable host networking** (may be required for BLE discovery):
|
||||
```yaml
|
||||
network_mode: host
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
Configuration is provided via:
|
||||
|
||||
1. **Environment variables** in `docker-compose.yml`
|
||||
2. **`.env.local` file** mounted as a volume (recommended)
|
||||
|
||||
The `.env.local` file supports all configuration options. See `.env.local.example` for available settings.
|
||||
|
||||
### Required Settings
|
||||
|
||||
- `PACKETCAPTURE_IATA`: 3-letter airport code (e.g., `SEA`, `LAX`)
|
||||
- `PACKETCAPTURE_MQTT1_SERVER`: MQTT broker address
|
||||
- `PACKETCAPTURE_MQTT1_PORT`: MQTT broker port
|
||||
|
||||
### MQTT Authentication
|
||||
|
||||
**Username/Password**:
|
||||
```bash
|
||||
PACKETCAPTURE_MQTT1_USERNAME=your_username
|
||||
PACKETCAPTURE_MQTT1_PASSWORD=your_password
|
||||
```
|
||||
|
||||
**Auth Token (JWT)**:
|
||||
```bash
|
||||
PACKETCAPTURE_MQTT1_USE_AUTH_TOKEN=true
|
||||
PACKETCAPTURE_MQTT1_TOKEN_AUDIENCE=mqtt.example.com
|
||||
PACKETCAPTURE_PRIVATE_KEY=your_private_key_hex
|
||||
```
|
||||
|
||||
## Container Management
|
||||
|
||||
**Start**:
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
**Stop**:
|
||||
```bash
|
||||
docker compose down
|
||||
```
|
||||
|
||||
**Restart**:
|
||||
```bash
|
||||
docker compose restart meshcore-capture
|
||||
```
|
||||
|
||||
**View logs**:
|
||||
```bash
|
||||
docker compose logs -f meshcore-capture
|
||||
```
|
||||
|
||||
**View status**:
|
||||
```bash
|
||||
docker compose ps
|
||||
```
|
||||
|
||||
**Execute commands in container**:
|
||||
```bash
|
||||
docker compose exec meshcore-capture /bin/bash
|
||||
```
|
||||
|
||||
## Data Storage
|
||||
|
||||
Packet data is stored in the `./data` directory, which is mounted as a volume. Data persists across container restarts.
|
||||
|
||||
### Separate Logs Directory
|
||||
|
||||
To store logs separately from packet data, uncomment the logs volume mount in `docker-compose.yml`:
|
||||
|
||||
```yaml
|
||||
volumes:
|
||||
- ./logs:/app/logs
|
||||
```
|
||||
|
||||
Create the logs directory before starting:
|
||||
```bash
|
||||
mkdir -p logs
|
||||
```
|
||||
|
||||
Container logs are also available via Docker:
|
||||
```bash
|
||||
docker compose logs -f meshcore-capture > logs/container.log
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Serial Device Not Found
|
||||
|
||||
**Check device exists**:
|
||||
```bash
|
||||
ls -la /dev/serial/by-id/
|
||||
```
|
||||
|
||||
**Check device permissions**:
|
||||
```bash
|
||||
sudo chmod 666 /dev/ttyUSB0
|
||||
# Or add user to dialout group
|
||||
sudo usermod -a -G dialout $USER
|
||||
# Then log out and back in
|
||||
```
|
||||
|
||||
**Verify device mount**:
|
||||
```bash
|
||||
docker compose exec meshcore-capture ls -la /dev/ttyUSB0
|
||||
```
|
||||
|
||||
### BLE Connection Issues
|
||||
|
||||
**Enable host networking**:
|
||||
```yaml
|
||||
network_mode: host
|
||||
```
|
||||
|
||||
**Check Bluetooth adapter**:
|
||||
```bash
|
||||
docker compose exec meshcore-capture hciconfig
|
||||
```
|
||||
|
||||
**Verify privileged mode**:
|
||||
```bash
|
||||
docker compose exec meshcore-capture cat /proc/self/status | grep CapEff
|
||||
```
|
||||
|
||||
### MQTT Connection Issues
|
||||
|
||||
**Test network connectivity**:
|
||||
```bash
|
||||
docker compose exec meshcore-capture ping mqtt-broker
|
||||
```
|
||||
|
||||
**Check MQTT configuration**:
|
||||
```bash
|
||||
docker compose exec meshcore-capture env | grep MQTT
|
||||
```
|
||||
|
||||
**View connection logs**:
|
||||
```bash
|
||||
docker compose logs meshcore-capture | grep -i mqtt
|
||||
```
|
||||
|
||||
### Container Won't Start
|
||||
|
||||
**Check logs**:
|
||||
```bash
|
||||
docker compose logs meshcore-capture
|
||||
```
|
||||
|
||||
**Verify configuration**:
|
||||
```bash
|
||||
docker compose config
|
||||
```
|
||||
|
||||
**Check image**:
|
||||
```bash
|
||||
docker pull ghcr.io/agessaman/meshcore-packet-capture:latest
|
||||
```
|
||||
|
||||
## Building from Source
|
||||
|
||||
To build the image locally instead of using the pre-built image:
|
||||
|
||||
1. **Comment out image line** in `docker-compose.yml`:
|
||||
```yaml
|
||||
# image: ghcr.io/agessaman/meshcore-packet-capture:latest
|
||||
```
|
||||
|
||||
2. **Uncomment build line**:
|
||||
```yaml
|
||||
build: .
|
||||
```
|
||||
|
||||
3. **Build and start**:
|
||||
```bash
|
||||
docker compose up -d --build
|
||||
```
|
||||
|
||||
## Platform Notes
|
||||
|
||||
- **Linux**: Full support for both BLE and serial connections
|
||||
- **macOS**: Serial connections work; BLE may require host networking
|
||||
- **Windows**: Serial connections work with proper device mounting; BLE support is limited
|
||||
|
|
@ -46,11 +46,8 @@ RUN mkdir -p /app/data && chown -R meshcore:meshcore /app
|
|||
USER meshcore
|
||||
|
||||
# Set default environment variables
|
||||
ENV PACKETCAPTURE_CONNECTION_TYPE=ble \
|
||||
PACKETCAPTURE_TIMEOUT=30 \
|
||||
PACKETCAPTURE_MAX_CONNECTION_RETRIES=5 \
|
||||
PACKETCAPTURE_CONNECTION_RETRY_DELAY=5 \
|
||||
PACKETCAPTURE_HEALTH_CHECK_INTERVAL=30 \
|
||||
# Note: These are defaults - override in docker-compose.yml or .env.local
|
||||
ENV PACKETCAPTURE_CONNECTION_TYPE=serial \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PYTHONDONTWRITEBYTECODE=1
|
||||
|
||||
|
|
|
|||
21
LICENSE
Normal file
21
LICENSE
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2026 Adam Gessaman
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
|
@ -2,56 +2,118 @@ version: '3.8'
|
|||
|
||||
services:
|
||||
meshcore-capture:
|
||||
build: .
|
||||
# Use pre-built image (recommended)
|
||||
image: ghcr.io/agessaman/meshcore-packet-capture:latest
|
||||
# Or build from source: uncomment the line below and comment out the image line above
|
||||
# build: .
|
||||
container_name: meshcore-packet-capture
|
||||
privileged: true # Required for BLE access and device communication
|
||||
# Privileged mode configuration:
|
||||
# - Set to 'false' for serial connections (default, more secure)
|
||||
# - Set to 'true' for BLE connections (required for Bluetooth access)
|
||||
# To enable for BLE, change 'false' to 'true' below
|
||||
# or create docker-compose.override.yml with: privileged: true
|
||||
privileged: false # Change to true for BLE connections
|
||||
devices:
|
||||
# Mount serial devices (uncomment and modify as needed)
|
||||
- /dev/ttyUSB0:/dev/ttyUSB0
|
||||
- /dev/ttyUSB1:/dev/ttyUSB1
|
||||
- /dev/ttyACM0:/dev/ttyACM0
|
||||
# Mount serial devices using persistent device IDs (recommended)
|
||||
# Format: host_path:container_path
|
||||
# Find your device ID on the host with: sudo ls -la /dev/serial/by-id/
|
||||
# Standard container path is /dev/ttyUSB0 (matches code default, no config needed)
|
||||
# Example: /dev/serial/by-id/usb-Heltec_HT-n5262_3D3B4D4A4D776001-if00:/dev/ttyUSB0
|
||||
# Uncomment and modify the line below with your device ID:
|
||||
- /dev/serial/by-id/usb-Heltec_HT-n5262_3D3B4D4A4D776001-if00:/dev/ttyUSB0
|
||||
|
||||
# Alternative: Use numbered devices directly (may change after reboot)
|
||||
# - /dev/ttyUSB0:/dev/ttyUSB0
|
||||
# - /dev/ttyUSB1:/dev/ttyUSB1
|
||||
# - /dev/ttyACM0:/dev/ttyACM0
|
||||
volumes:
|
||||
# Persistent data storage
|
||||
- ./data:/app/data
|
||||
# Configuration files (optional - can use environment variables instead)
|
||||
# Copy .env.local.example to .env.local and customize for your setup
|
||||
- ./.env.local:/app/.env.local:ro
|
||||
# Logs directory (optional - uncomment to mount logs separately from data)
|
||||
# - ./logs:/app/logs
|
||||
environment:
|
||||
# Connection settings
|
||||
- PACKETCAPTURE_CONNECTION_TYPE=ble
|
||||
- PACKETCAPTURE_TIMEOUT=30
|
||||
- PACKETCAPTURE_MAX_CONNECTION_RETRIES=5
|
||||
- PACKETCAPTURE_CONNECTION_RETRY_DELAY=5
|
||||
- PACKETCAPTURE_HEALTH_CHECK_INTERVAL=30
|
||||
- PACKETCAPTURE_CONNECTION_TYPE=serial
|
||||
# For serial connections:
|
||||
# PACKETCAPTURE_SERIAL_PORTS defaults to /dev/ttyUSB0 (matches standard container path above)
|
||||
# Only set this if using a different container path or multiple ports
|
||||
# - PACKETCAPTURE_SERIAL_PORTS=/dev/ttyUSB0
|
||||
# For BLE connections:
|
||||
# 1. Change CONNECTION_TYPE above to 'ble'
|
||||
# 2. Set privileged: true (see line 15)
|
||||
# 3. Optionally set BLE device address or name:
|
||||
# - PACKETCAPTURE_BLE_ADDRESS=AA:BB:CC:DD:EE:FF
|
||||
# - PACKETCAPTURE_BLE_DEVICE_NAME=MeshCore Device
|
||||
# Connection timeout, retries, and health check use defaults (30s, 5 retries, 30s interval)
|
||||
# Uncomment to customize:
|
||||
# - PACKETCAPTURE_TIMEOUT=30
|
||||
# - PACKETCAPTURE_MAX_CONNECTION_RETRIES=5
|
||||
# - PACKETCAPTURE_CONNECTION_RETRY_DELAY=5
|
||||
# - PACKETCAPTURE_HEALTH_CHECK_INTERVAL=30
|
||||
|
||||
# MQTT settings (configure as needed)
|
||||
# MQTT settings - Let'sMesh Analyzer (US and EU servers for redundancy)
|
||||
# MQTT Broker 1 - Let'sMesh Analyzer (US)
|
||||
- PACKETCAPTURE_MQTT1_ENABLED=true
|
||||
- PACKETCAPTURE_MQTT1_SERVER=localhost
|
||||
- PACKETCAPTURE_MQTT1_PORT=1883
|
||||
- PACKETCAPTURE_MQTT1_USERNAME=
|
||||
- PACKETCAPTURE_MQTT1_PASSWORD=
|
||||
- PACKETCAPTURE_MQTT1_USE_TLS=false
|
||||
- PACKETCAPTURE_MQTT1_SERVER=mqtt-us-v1.letsmesh.net
|
||||
- PACKETCAPTURE_MQTT1_PORT=443
|
||||
- PACKETCAPTURE_MQTT1_TRANSPORT=websockets
|
||||
- PACKETCAPTURE_MQTT1_USE_TLS=true
|
||||
- PACKETCAPTURE_MQTT1_USE_AUTH_TOKEN=true
|
||||
- PACKETCAPTURE_MQTT1_TOKEN_AUDIENCE=mqtt-us-v1.letsmesh.net
|
||||
- PACKETCAPTURE_MQTT1_KEEPALIVE=120
|
||||
|
||||
# MQTT reconnection settings
|
||||
- PACKETCAPTURE_MAX_MQTT_RETRIES=5
|
||||
- PACKETCAPTURE_MQTT_RETRY_DELAY=5
|
||||
- PACKETCAPTURE_EXIT_ON_RECONNECT_FAIL=true
|
||||
# MQTT Broker 2 - Let'sMesh Analyzer (EU)
|
||||
- PACKETCAPTURE_MQTT2_ENABLED=true
|
||||
- PACKETCAPTURE_MQTT2_SERVER=mqtt-eu-v1.letsmesh.net
|
||||
- PACKETCAPTURE_MQTT2_PORT=443
|
||||
- PACKETCAPTURE_MQTT2_TRANSPORT=websockets
|
||||
- PACKETCAPTURE_MQTT2_USE_TLS=true
|
||||
- PACKETCAPTURE_MQTT2_USE_AUTH_TOKEN=true
|
||||
- PACKETCAPTURE_MQTT2_TOKEN_AUDIENCE=mqtt-eu-v1.letsmesh.net
|
||||
- PACKETCAPTURE_MQTT2_KEEPALIVE=120
|
||||
|
||||
# Topic settings
|
||||
- PACKETCAPTURE_TOPIC_STATUS=meshcore/status
|
||||
- PACKETCAPTURE_TOPIC_PACKETS=meshcore/packets
|
||||
- PACKETCAPTURE_TOPIC_RAW=meshcore/raw
|
||||
- PACKETCAPTURE_TOPIC_DECODED=meshcore/decoded
|
||||
- PACKETCAPTURE_TOPIC_DEBUG=meshcore/debug
|
||||
# Custom MQTT broker (optional - uncomment and configure as needed)
|
||||
# - PACKETCAPTURE_MQTT3_ENABLED=true
|
||||
# - PACKETCAPTURE_MQTT3_SERVER=your-mqtt-broker
|
||||
# - PACKETCAPTURE_MQTT3_PORT=1883
|
||||
# - PACKETCAPTURE_MQTT3_USERNAME=your_username
|
||||
# - PACKETCAPTURE_MQTT3_PASSWORD=your_password
|
||||
# - PACKETCAPTURE_MQTT3_USE_TLS=false
|
||||
|
||||
# MQTT reconnection settings use defaults (5 retries, 5s delay, exit on fail)
|
||||
# Uncomment to customize:
|
||||
# - PACKETCAPTURE_MAX_MQTT_RETRIES=5
|
||||
# - PACKETCAPTURE_MQTT_RETRY_DELAY=5
|
||||
# - PACKETCAPTURE_EXIT_ON_RECONNECT_FAIL=true
|
||||
|
||||
# Topic settings (when IATA is configured, topics automatically use template format)
|
||||
# Template variables: {IATA}, {IATA_lower}, {PUBLIC_KEY}
|
||||
# Default when IATA is set: meshcore/{IATA}/{PUBLIC_KEY}/status, etc.
|
||||
# Uncomment to override with custom topics:
|
||||
# - PACKETCAPTURE_TOPIC_STATUS=meshcore/{IATA}/{PUBLIC_KEY}/status
|
||||
# - PACKETCAPTURE_TOPIC_PACKETS=meshcore/{IATA}/{PUBLIC_KEY}/packets
|
||||
# - PACKETCAPTURE_TOPIC_RAW=meshcore/{IATA}/{PUBLIC_KEY}/raw
|
||||
# - PACKETCAPTURE_TOPIC_DECODED=meshcore/{IATA}/{PUBLIC_KEY}/decoded
|
||||
# - PACKETCAPTURE_TOPIC_DEBUG=meshcore/{IATA}/{PUBLIC_KEY}/debug
|
||||
|
||||
# Device settings
|
||||
- PACKETCAPTURE_IATA=LOC
|
||||
- PACKETCAPTURE_ORIGIN=PacketCapture Docker
|
||||
# PACKETCAPTURE_ORIGIN is optional - if not set, uses device name from meshcore connection
|
||||
# Uncomment and set if you want to override the device name:
|
||||
# - PACKETCAPTURE_ORIGIN=Your Custom Name
|
||||
|
||||
# Advert settings
|
||||
# Adverts are used for network discovery, not connection keepalive
|
||||
# The connection stays alive through regular packet traffic
|
||||
# Default: 11 hours. Set to 0 to disable periodic adverts
|
||||
- PACKETCAPTURE_ADVERT_INTERVAL_HOURS=11
|
||||
|
||||
# RF data settings
|
||||
- PACKETCAPTURE_RF_DATA_TIMEOUT=15.0
|
||||
# RF data settings use default (15.0 seconds timeout)
|
||||
# Uncomment to customize:
|
||||
# - PACKETCAPTURE_RF_DATA_TIMEOUT=15.0
|
||||
networks:
|
||||
- meshcore-network
|
||||
restart: unless-stopped
|
||||
|
|
|
|||
155
install.sh
155
install.sh
|
|
@ -125,6 +125,11 @@ detect_serial_devices() {
|
|||
while IFS= read -r device; do
|
||||
devices+=("$device")
|
||||
done < <(ls /dev/cu.usb* /dev/cu.wchusbserial* /dev/cu.SLAB_USBtoUART* 2>/dev/null | sort)
|
||||
elif [ "$(uname)" = "FreeBSD" ]; then
|
||||
# FreeBSD: Use /dev/cuaU* devices (callout devices, preferred over ttyU*)
|
||||
while IFS= read -r device; do
|
||||
devices+=("$device")
|
||||
done < <(ls /dev/cuaU* | grep -v -E '\.(lock|init)$' 2>/dev/null | sort)
|
||||
else
|
||||
# Linux: Prefer /dev/serial/by-id/ for persistent naming
|
||||
if [ -d /dev/serial/by-id ]; then
|
||||
|
|
@ -2274,11 +2279,10 @@ USER meshcore
|
|||
RUN mkdir -p /app/data
|
||||
|
||||
# Set default environment variables
|
||||
ENV PACKETCAPTURE_CONNECTION_TYPE=ble
|
||||
ENV PACKETCAPTURE_TIMEOUT=30
|
||||
ENV PACKETCAPTURE_MAX_CONNECTION_RETRIES=5
|
||||
ENV PACKETCAPTURE_CONNECTION_RETRY_DELAY=5
|
||||
ENV PACKETCAPTURE_HEALTH_CHECK_INTERVAL=30
|
||||
# Note: These are defaults - override in docker-compose.yml or .env.local
|
||||
ENV PACKETCAPTURE_CONNECTION_TYPE=serial
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
|
||||
# Default command
|
||||
CMD ["python", "packet_capture.py"]
|
||||
|
|
@ -2290,19 +2294,38 @@ version: '3.8'
|
|||
|
||||
services:
|
||||
meshcore-capture:
|
||||
build: .
|
||||
# Use pre-built image (recommended)
|
||||
image: ghcr.io/agessaman/meshcore-packet-capture:latest
|
||||
# Or build from source: uncomment the line below and comment out the image line above
|
||||
# build: .
|
||||
container_name: meshcore-packet-capture
|
||||
privileged: true # Required for BLE access and device communication
|
||||
# Privileged mode configuration:
|
||||
# - Set to 'false' for serial connections (default, more secure)
|
||||
# - Set to 'true' for BLE connections (required for Bluetooth access)
|
||||
# To enable for BLE, change 'false' to 'true' below
|
||||
# or create docker-compose.override.yml with: privileged: true
|
||||
privileged: false # Change to true for BLE connections
|
||||
devices:
|
||||
# Mount serial devices (uncomment and modify as needed)
|
||||
- /dev/ttyUSB0:/dev/ttyUSB0
|
||||
- /dev/ttyUSB1:/dev/ttyUSB1
|
||||
- /dev/ttyACM0:/dev/ttyACM0
|
||||
# Mount serial devices using persistent device IDs (recommended)
|
||||
# Format: host_path:container_path
|
||||
# Find your device ID on the host with: sudo ls -la /dev/serial/by-id/
|
||||
# Standard container path is /dev/ttyUSB0 (matches code default, no config needed)
|
||||
# Example: /dev/serial/by-id/usb-Heltec_HT-n5262_3D3B4D4A4D776001-if00:/dev/ttyUSB0
|
||||
# Uncomment and modify the line below with your device ID:
|
||||
# - /dev/serial/by-id/usb-Heltec_HT-n5262_3D3B4D4A4D776001-if00:/dev/ttyUSB0
|
||||
|
||||
# Alternative: Use numbered devices directly (may change after reboot)
|
||||
# - /dev/ttyUSB0:/dev/ttyUSB0
|
||||
# - /dev/ttyUSB1:/dev/ttyUSB1
|
||||
# - /dev/ttyACM0:/dev/ttyACM0
|
||||
volumes:
|
||||
# Persistent data storage
|
||||
- ./data:/app/data
|
||||
# Configuration files
|
||||
# Configuration files (optional - can use environment variables instead)
|
||||
# Copy .env.local.example to .env.local and customize for your setup
|
||||
- ./.env.local:/app/.env.local:ro
|
||||
# Logs directory (optional - uncomment to mount logs separately from data)
|
||||
# - ./logs:/app/logs
|
||||
# Resource limits to prevent runaway processes
|
||||
deploy:
|
||||
resources:
|
||||
|
|
@ -2314,64 +2337,78 @@ services:
|
|||
cpus: '0.1'
|
||||
environment:
|
||||
# Connection settings
|
||||
- PACKETCAPTURE_CONNECTION_TYPE=ble
|
||||
- PACKETCAPTURE_TIMEOUT=30
|
||||
- PACKETCAPTURE_MAX_CONNECTION_RETRIES=5
|
||||
- PACKETCAPTURE_CONNECTION_RETRY_DELAY=5
|
||||
- PACKETCAPTURE_HEALTH_CHECK_INTERVAL=30
|
||||
- PACKETCAPTURE_CONNECTION_TYPE=serial
|
||||
# PACKETCAPTURE_SERIAL_PORTS defaults to /dev/ttyUSB0 (matches standard container path above)
|
||||
# Only set this if using a different container path or multiple ports
|
||||
# - PACKETCAPTURE_SERIAL_PORTS=/dev/ttyUSB0
|
||||
# For BLE connections, change CONNECTION_TYPE to 'ble' and set privileged: true
|
||||
# Connection timeout, retries, and health check use defaults (30s, 5 retries, 30s interval)
|
||||
# Uncomment to customize:
|
||||
# - PACKETCAPTURE_TIMEOUT=30
|
||||
# - PACKETCAPTURE_MAX_CONNECTION_RETRIES=5
|
||||
# - PACKETCAPTURE_CONNECTION_RETRY_DELAY=5
|
||||
# - PACKETCAPTURE_HEALTH_CHECK_INTERVAL=30
|
||||
|
||||
# MQTT settings (configure as needed)
|
||||
# MQTT settings - Let'sMesh Analyzer (US and EU servers for redundancy)
|
||||
# MQTT Broker 1 - Let'sMesh Analyzer (US)
|
||||
- PACKETCAPTURE_MQTT1_ENABLED=true
|
||||
- PACKETCAPTURE_MQTT1_SERVER=localhost
|
||||
- PACKETCAPTURE_MQTT1_PORT=1883
|
||||
- PACKETCAPTURE_MQTT1_USERNAME=
|
||||
- PACKETCAPTURE_MQTT1_PASSWORD=
|
||||
- PACKETCAPTURE_MQTT1_USE_TLS=false
|
||||
- PACKETCAPTURE_MQTT1_SERVER=mqtt-us-v1.letsmesh.net
|
||||
- PACKETCAPTURE_MQTT1_PORT=443
|
||||
- PACKETCAPTURE_MQTT1_TRANSPORT=websockets
|
||||
- PACKETCAPTURE_MQTT1_USE_TLS=true
|
||||
- PACKETCAPTURE_MQTT1_USE_AUTH_TOKEN=true
|
||||
- PACKETCAPTURE_MQTT1_TOKEN_AUDIENCE=mqtt-us-v1.letsmesh.net
|
||||
- PACKETCAPTURE_MQTT1_KEEPALIVE=120
|
||||
|
||||
# MQTT reconnection settings
|
||||
- PACKETCAPTURE_MAX_MQTT_RETRIES=5
|
||||
- PACKETCAPTURE_MQTT_RETRY_DELAY=5
|
||||
- PACKETCAPTURE_EXIT_ON_RECONNECT_FAIL=true
|
||||
# MQTT Broker 2 - Let'sMesh Analyzer (EU)
|
||||
- PACKETCAPTURE_MQTT2_ENABLED=true
|
||||
- PACKETCAPTURE_MQTT2_SERVER=mqtt-eu-v1.letsmesh.net
|
||||
- PACKETCAPTURE_MQTT2_PORT=443
|
||||
- PACKETCAPTURE_MQTT2_TRANSPORT=websockets
|
||||
- PACKETCAPTURE_MQTT2_USE_TLS=true
|
||||
- PACKETCAPTURE_MQTT2_USE_AUTH_TOKEN=true
|
||||
- PACKETCAPTURE_MQTT2_TOKEN_AUDIENCE=mqtt-eu-v1.letsmesh.net
|
||||
- PACKETCAPTURE_MQTT2_KEEPALIVE=120
|
||||
|
||||
# Topic settings
|
||||
- PACKETCAPTURE_TOPIC_STATUS=meshcore/status
|
||||
- PACKETCAPTURE_TOPIC_PACKETS=meshcore/packets
|
||||
- PACKETCAPTURE_TOPIC_RAW=meshcore/raw
|
||||
- PACKETCAPTURE_TOPIC_DECODED=meshcore/decoded
|
||||
- PACKETCAPTURE_TOPIC_DEBUG=meshcore/debug
|
||||
# Custom MQTT broker (optional - uncomment and configure as needed)
|
||||
# - PACKETCAPTURE_MQTT3_ENABLED=true
|
||||
# - PACKETCAPTURE_MQTT3_SERVER=your-mqtt-broker
|
||||
# - PACKETCAPTURE_MQTT3_PORT=1883
|
||||
# - PACKETCAPTURE_MQTT3_USERNAME=your_username
|
||||
# - PACKETCAPTURE_MQTT3_PASSWORD=your_password
|
||||
# - PACKETCAPTURE_MQTT3_USE_TLS=false
|
||||
|
||||
# MQTT reconnection settings use defaults (5 retries, 5s delay, exit on fail)
|
||||
# Uncomment to customize:
|
||||
# - PACKETCAPTURE_MAX_MQTT_RETRIES=5
|
||||
# - PACKETCAPTURE_MQTT_RETRY_DELAY=5
|
||||
# - PACKETCAPTURE_EXIT_ON_RECONNECT_FAIL=true
|
||||
|
||||
# Topic settings (when IATA is configured, topics automatically use template format)
|
||||
# Template variables: {IATA}, {IATA_lower}, {PUBLIC_KEY}
|
||||
# Default when IATA is set: meshcore/{IATA}/{PUBLIC_KEY}/status, etc.
|
||||
# Uncomment to override with custom topics:
|
||||
# - PACKETCAPTURE_TOPIC_STATUS=meshcore/{IATA}/{PUBLIC_KEY}/status
|
||||
# - PACKETCAPTURE_TOPIC_PACKETS=meshcore/{IATA}/{PUBLIC_KEY}/packets
|
||||
# - PACKETCAPTURE_TOPIC_RAW=meshcore/{IATA}/{PUBLIC_KEY}/raw
|
||||
# - PACKETCAPTURE_TOPIC_DECODED=meshcore/{IATA}/{PUBLIC_KEY}/decoded
|
||||
# - PACKETCAPTURE_TOPIC_DEBUG=meshcore/{IATA}/{PUBLIC_KEY}/debug
|
||||
|
||||
# Device settings
|
||||
- PACKETCAPTURE_IATA=XYZ
|
||||
- PACKETCAPTURE_ORIGIN=PacketCapture Docker
|
||||
# PACKETCAPTURE_ORIGIN is optional - if not set, uses device name from meshcore connection
|
||||
# Uncomment and set if you want to override the device name:
|
||||
# - PACKETCAPTURE_ORIGIN=Your Custom Name
|
||||
|
||||
# Advert settings
|
||||
# Adverts are used for network discovery, not connection keepalive
|
||||
# The connection stays alive through regular packet traffic
|
||||
# Default: 11 hours. Set to 0 to disable periodic adverts
|
||||
- PACKETCAPTURE_ADVERT_INTERVAL_HOURS=11
|
||||
|
||||
# RF data settings
|
||||
- PACKETCAPTURE_RF_DATA_TIMEOUT=15.0
|
||||
|
||||
# JWT token renewal settings
|
||||
- PACKETCAPTURE_JWT_RENEWAL_INTERVAL=3600
|
||||
- PACKETCAPTURE_JWT_RENEWAL_THRESHOLD=300
|
||||
|
||||
# Resource management settings (prevent runaway processes)
|
||||
- PACKETCAPTURE_MAX_ACTIVE_TASKS=50
|
||||
- PACKETCAPTURE_JWT_CIRCUIT_BREAKER_FAILURES=3
|
||||
- PACKETCAPTURE_JWT_CIRCUIT_BREAKER_TIMEOUT=180
|
||||
|
||||
# Exponential backoff settings (prevent server overload)
|
||||
- PACKETCAPTURE_MQTT_RETRY_DELAY_MAX=300
|
||||
- PACKETCAPTURE_MQTT_RETRY_BACKOFF_MULTIPLIER=2.0
|
||||
- PACKETCAPTURE_MQTT_RETRY_JITTER=true
|
||||
- PACKETCAPTURE_CONNECTION_RETRY_DELAY_MAX=300
|
||||
- PACKETCAPTURE_CONNECTION_RETRY_BACKOFF_MULTIPLIER=2.0
|
||||
- PACKETCAPTURE_CONNECTION_RETRY_JITTER=true
|
||||
|
||||
# Service failure tracking (let Docker restart on persistent failures)
|
||||
- PACKETCAPTURE_MAX_SERVICE_FAILURES=3
|
||||
- PACKETCAPTURE_SERVICE_FAILURE_WINDOW=300
|
||||
- PACKETCAPTURE_CRITICAL_FAILURE_THRESHOLD=5
|
||||
- PACKETCAPTURE_MAX_CONSECUTIVE_FAILURES=3
|
||||
# RF data settings use default (15.0 seconds timeout)
|
||||
# Uncomment to customize:
|
||||
# - PACKETCAPTURE_RF_DATA_TIMEOUT=15.0
|
||||
networks:
|
||||
- meshcore-network
|
||||
restart: unless-stopped
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue