mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-03-28 17:42:45 +01:00
feat(tcp): document TCP connection in .env.example + fix defaults
- Add MC_TCP_HOST and MC_TCP_PORT options to .env.example with clear documentation for serial vs TCP transport selection - Change default MC_TCP_PORT from 5000 to 5555 (avoids Flask conflict) - Wire MC_TCP_HOST/MC_TCP_PORT through docker-compose.yml from .env (previously was commented-out hardcoded values) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
14
.env.example
14
.env.example
@@ -2,17 +2,25 @@
|
|||||||
# Copy this file to .env and adjust values for your setup
|
# Copy this file to .env and adjust values for your setup
|
||||||
|
|
||||||
# ============================================
|
# ============================================
|
||||||
# MeshCore Device Configuration
|
# MeshCore Device Connection
|
||||||
# ============================================
|
# ============================================
|
||||||
|
# Two transport options: Serial (USB) or TCP (network).
|
||||||
|
# Set MC_TCP_HOST to use TCP; leave empty to use serial.
|
||||||
|
|
||||||
# Serial port path
|
# --- Option A: Serial (default) ---
|
||||||
# Use "auto" for automatic detection (recommended if only one USB device)
|
# Use "auto" for automatic detection (recommended if only one USB device)
|
||||||
# Or specify manually: /dev/serial/by-id/usb-xxx or /dev/ttyUSB0
|
# Or specify manually: /dev/serial/by-id/usb-xxx or /dev/ttyUSB0
|
||||||
# Find available devices: ls /dev/serial/by-id/
|
# Find available devices: ls /dev/serial/by-id/
|
||||||
MC_SERIAL_PORT=auto
|
MC_SERIAL_PORT=auto
|
||||||
|
|
||||||
|
# --- Option B: TCP (e.g. remote device via ser2net, meshcore-proxy) ---
|
||||||
|
# Set the IP/hostname of the device to connect via TCP instead of serial.
|
||||||
|
# When MC_TCP_HOST is set, MC_SERIAL_PORT is ignored.
|
||||||
|
# MC_TCP_HOST=192.168.1.100
|
||||||
|
# MC_TCP_PORT=5555
|
||||||
|
|
||||||
# Your MeshCore device name (used for .msgs file)
|
# Your MeshCore device name (used for .msgs file)
|
||||||
# Use "auto" for automatic detection from meshcli (recommended)
|
# Use "auto" for automatic detection from device (recommended)
|
||||||
# Or specify manually: MarWoj, SP5XYZ, MyNode
|
# Or specify manually: MarWoj, SP5XYZ, MyNode
|
||||||
MC_DEVICE_NAME=auto
|
MC_DEVICE_NAME=auto
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class Config:
|
|||||||
|
|
||||||
# v2: TCP connection (alternative to serial, e.g. meshcore-proxy)
|
# v2: TCP connection (alternative to serial, e.g. meshcore-proxy)
|
||||||
MC_TCP_HOST = os.getenv('MC_TCP_HOST', '') # empty = use serial
|
MC_TCP_HOST = os.getenv('MC_TCP_HOST', '') # empty = use serial
|
||||||
MC_TCP_PORT = int(os.getenv('MC_TCP_PORT', '5000'))
|
MC_TCP_PORT = int(os.getenv('MC_TCP_PORT', '5555'))
|
||||||
|
|
||||||
# v2: Backup
|
# v2: Backup
|
||||||
MC_BACKUP_ENABLED = os.getenv('MC_BACKUP_ENABLED', 'true').lower() == 'true'
|
MC_BACKUP_ENABLED = os.getenv('MC_BACKUP_ENABLED', 'true').lower() == 'true'
|
||||||
|
|||||||
@@ -19,9 +19,8 @@ services:
|
|||||||
- MC_DEVICE_NAME=${MC_DEVICE_NAME:-MeshCore}
|
- MC_DEVICE_NAME=${MC_DEVICE_NAME:-MeshCore}
|
||||||
- MC_CONFIG_DIR=/data
|
- MC_CONFIG_DIR=/data
|
||||||
- MC_DB_PATH=/data/mc-webui.db
|
- MC_DB_PATH=/data/mc-webui.db
|
||||||
# TCP mode (uncomment to use meshcore-proxy instead of serial):
|
- MC_TCP_HOST=${MC_TCP_HOST:-}
|
||||||
# - MC_TCP_HOST=192.168.1.100
|
- MC_TCP_PORT=${MC_TCP_PORT:-5555}
|
||||||
# - MC_TCP_PORT=5000
|
|
||||||
- MC_BACKUP_ENABLED=${MC_BACKUP_ENABLED:-true}
|
- MC_BACKUP_ENABLED=${MC_BACKUP_ENABLED:-true}
|
||||||
- MC_BACKUP_HOUR=${MC_BACKUP_HOUR:-2}
|
- MC_BACKUP_HOUR=${MC_BACKUP_HOUR:-2}
|
||||||
- MC_BACKUP_RETENTION_DAYS=${MC_BACKUP_RETENTION_DAYS:-7}
|
- MC_BACKUP_RETENTION_DAYS=${MC_BACKUP_RETENTION_DAYS:-7}
|
||||||
|
|||||||
Reference in New Issue
Block a user