mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-03-28 17:42:45 +01:00
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>
37 lines
1.1 KiB
YAML
37 lines
1.1 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
mc-webui:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: mc-webui
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${FLASK_PORT:-5000}:5000"
|
|
devices:
|
|
- "${MC_SERIAL_PORT}:${MC_SERIAL_PORT}"
|
|
volumes:
|
|
- "${MC_CONFIG_DIR}:/root/.config/meshcore:rw"
|
|
- "${MC_ARCHIVE_DIR:-./archive}:/root/.archive/meshcore:rw"
|
|
environment:
|
|
- MC_SERIAL_PORT=${MC_SERIAL_PORT}
|
|
- MC_DEVICE_NAME=${MC_DEVICE_NAME}
|
|
- MC_CONFIG_DIR=/root/.config/meshcore
|
|
- MC_REFRESH_INTERVAL=${MC_REFRESH_INTERVAL:-60}
|
|
- MC_INACTIVE_HOURS=${MC_INACTIVE_HOURS:-48}
|
|
- MC_ARCHIVE_DIR=/root/.archive/meshcore
|
|
- MC_ARCHIVE_ENABLED=${MC_ARCHIVE_ENABLED:-true}
|
|
- MC_ARCHIVE_RETENTION_DAYS=${MC_ARCHIVE_RETENTION_DAYS:-7}
|
|
- FLASK_HOST=${FLASK_HOST:-0.0.0.0}
|
|
- FLASK_PORT=${FLASK_PORT:-5000}
|
|
- FLASK_DEBUG=${FLASK_DEBUG:-false}
|
|
env_file:
|
|
- .env
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5000/api/status')"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 10s
|