Files
mc-webui/.env.example
MarekWo d720d6a263 fix(bridge): Replace polling with msg_subscribe for real-time messages
Critical fixes based on user feedback:

1. **Remove auto-recv polling (30s interval)**
   - Polling with 'recv' doesn't fetch NEW messages, only reads from .msgs
   - Wasteful - creates unnecessary command traffic

2. **Add msg_subscribe for real-time message reception**
   - meshcli's msg_subscribe enables automatic message events
   - Messages arrive via EventType.CHANNEL_MSG_RECV events
   - No polling needed - truly asynchronous

3. **Make TZ configurable via .env instead of hardcoded**
   - Changed docker-compose.yml: TZ=${TZ:-UTC}
   - Added TZ=Europe/Warsaw to .env.example
   - Users can now set their own timezone

4. **Remove unused shlex import**
   - Not needed after switching to manual double-quote wrapping

Technical details:
- msg_subscribe sends subscription command to meshcli at init
- meshcli then emits events when messages arrive
- Events trigger TTY errors (harmless - meshcli tries to print_above)
- Messages are still saved to .msgs file by meshcli core

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-28 17:10:33 +01:00

61 lines
1.8 KiB
Plaintext

# mc-webui Environment Configuration
# Copy this file to .env and adjust values for your setup
# ============================================
# MeshCore Device Configuration
# ============================================
# Serial port path (use /dev/serial/by-id for stable device names)
# Find your device: ls -l /dev/serial/by-id/
MC_SERIAL_PORT=/dev/serial/by-id/usb-Espressif_Systems_heltec_wifi_lora_32_v4__16_MB_FLASH__2_MB_PSRAM__90706984A000-if00
# Your MeshCore device name (used for .msgs file)
MC_DEVICE_NAME=MarWoj
# MeshCore configuration directory (where .msgs file is stored)
MC_CONFIG_DIR=/home/marek/.config/meshcore
# ============================================
# Application Settings
# ============================================
# Auto-refresh interval in seconds
MC_REFRESH_INTERVAL=60
# Hours of inactivity before contacts can be cleaned up
MC_INACTIVE_HOURS=48
# ============================================
# Archive Configuration
# ============================================
# Directory for storing archived messages
MC_ARCHIVE_DIR=/home/marek/.config/meshcore/archive
# Enable automatic daily archiving at midnight
MC_ARCHIVE_ENABLED=true
# Number of days to show in live view (older messages available in archives)
MC_ARCHIVE_RETENTION_DAYS=7
# ============================================
# Flask Server Configuration
# ============================================
# Listen on all interfaces (0.0.0.0) or specific IP
FLASK_HOST=0.0.0.0
# Port to expose the web interface
FLASK_PORT=5000
# Debug mode (true/false) - use false in production
FLASK_DEBUG=false
# ============================================
# System Configuration
# ============================================
# Timezone for container logs (default: UTC)
# Examples: Europe/Warsaw, America/New_York, Asia/Tokyo
TZ=Europe/Warsaw