mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-08-12 11:42:56 +02:00
feat: Auto-detect serial port from /dev/serial/by-id/
When MC_SERIAL_PORT=auto, bridge scans /dev/serial/by-id/ and: - Uses the device if exactly one found - Fails with helpful message if multiple devices (list provided) - Fails if no devices found docker-compose.yml now uses device_cgroup_rules instead of explicit device mapping, allowing auto-detection inside the container. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+7
-4
@@ -6,14 +6,17 @@ services:
|
||||
dockerfile: Dockerfile
|
||||
container_name: meshcore-bridge
|
||||
restart: unless-stopped
|
||||
devices:
|
||||
- "${MC_SERIAL_PORT}:${MC_SERIAL_PORT}"
|
||||
# Grant access to all ttyUSB devices (major 188) for auto-detection
|
||||
# This allows MC_SERIAL_PORT=auto to work without specifying device upfront
|
||||
device_cgroup_rules:
|
||||
- 'c 188:* rmw'
|
||||
volumes:
|
||||
- "${MC_CONFIG_DIR}:/root/.config/meshcore:rw"
|
||||
- "/dev:/dev"
|
||||
environment:
|
||||
- MC_SERIAL_PORT=${MC_SERIAL_PORT}
|
||||
- MC_SERIAL_PORT=${MC_SERIAL_PORT:-auto}
|
||||
- MC_CONFIG_DIR=/root/.config/meshcore
|
||||
- MC_DEVICE_NAME=${MC_DEVICE_NAME}
|
||||
- MC_DEVICE_NAME=${MC_DEVICE_NAME:-auto}
|
||||
- TZ=${TZ:-UTC}
|
||||
networks:
|
||||
- meshcore-net
|
||||
|
||||
Reference in New Issue
Block a user