8 Commits

Author SHA1 Message Date
MarekWo
97323649c7 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>
2026-03-06 07:27:08 +01:00
MarekWo
61bd4b41ae chore: Remove unused MC_INACTIVE_HOURS config variable
This variable was defined but never used in the code.
Contact cleanup threshold is controlled directly in the UI.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 17:09:32 +01:00
MarekWo
b2496b17b0 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>
2026-01-15 15:18:07 +01:00
MarekWo
b8a77285ab docs: Add MC_DEVICE_NAME=auto as recommended setting
Updated README.md and .env.example to recommend auto-detection
of device name from meshcli prompt instead of manual configuration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 12:26:58 +01:00
MarekWo
f8ef1ac297 docs: Move data storage to project directory and cleanup configuration
Major documentation update with new data structure:

Breaking Changes:
- Data storage moved from host directories to ./data/ inside project
- MC_CONFIG_DIR default changed: /root/.config/meshcore → ./data/meshcore
- MC_ARCHIVE_DIR default changed: /mnt/archive/meshcore → ./data/archive
- Requires migration for existing installations (see MIGRATION.md)

Documentation:
- Add MIGRATION.md - step-by-step guide for existing users
- Add FRESH_INSTALL.md - complete installation guide for new users
- Update README.md - new Configuration section with ./data/ structure
- Update .env.example - placeholders instead of real values, new defaults
- Update .claude/CLAUDE.md - updated environment variables documentation
- Change serial device detection from 'ls -l' to 'ls' (cleaner output)

Code Cleanup:
- Remove deprecated MC_REFRESH_INTERVAL variable (unused since intelligent refresh)
- Remove MC_REFRESH_INTERVAL from app/config.py
- Remove refresh_interval from app/routes/views.py (5 functions)
- Remove refresh_interval from app/routes/api.py
- Remove refreshInterval from app/templates/index.html
- Remove refreshInterval from app/templates/dm.html
- Remove MC_REFRESH_INTERVAL from docker-compose.yml

Configuration:
- Update .gitignore - exclude data/ and docs/github-discussion-*.md
- Serial port: use /dev/serial/by-id/[YOUR_DEVICE_ID] placeholder
- Device name: use [YOUR_DEVICE_NAME] placeholder

Benefits:
- All project data in one location (easier backups)
- Better portability (no host dependencies)
- Cleaner codebase (removed unused variables)
- Comprehensive documentation for migration and fresh install

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 15:31:26 +01:00
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
MarekWo
f5fedbc96c Feature: Add message archiving system with browse-by-date selector
Implements automatic daily archiving of messages to improve performance
and enable browsing historical chat by date.

Backend changes:
- Add APScheduler for daily archiving at midnight (00:00 UTC)
- Create app/archiver/manager.py with archive logic and scheduler
- Extend parser.py to read from archive files and filter by days
- Add archive configuration to config.py (MC_ARCHIVE_*)

API changes:
- Extend GET /api/messages with archive_date and days parameters
- Add GET /api/archives endpoint to list available archives
- Add POST /api/archive/trigger for manual archiving

Frontend changes:
- Add date selector dropdown in navbar for archive browsing
- Implement archive list loading and date selection
- Update formatTime() to show full dates in archive view
- Live view now shows only last 7 days (configurable)

Docker & Config:
- Add archive volume mount in docker-compose.yml
- Add MC_ARCHIVE_DIR, MC_ARCHIVE_ENABLED, MC_ARCHIVE_RETENTION_DAYS env vars
- Update .env.example with archive configuration section

Documentation:
- Update README.md with archive feature and usage instructions
- Update .claude/instructions.md with archive endpoints

Key features:
- Automatic daily archiving (midnight UTC)
- Live view filtered to last 7 days for better performance
- Browse historical messages by date via dropdown selector
- Archives stored as dated files: {device}.YYYY-MM-DD.msgs
- Original .msgs file never modified (safe, read-only approach)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 20:21:33 +01:00
MarekWo
6a455cb652 Phase 0: Environment setup - Docker infrastructure and project scaffolding
Created complete project structure for mc-webui MVP:
- Docker configuration (Dockerfile, docker-compose.yml)
- Environment configuration (.env.example)
- Python dependencies (requirements.txt)
- Project documentation (README.md)
- Git ignore rules (.gitignore)
- Directory structure for app, routes, templates, static files

Ready for Phase 1: Backend implementation

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 13:39:06 +01:00