mirror of
https://github.com/agessaman/meshcore-bot.git
synced 2026-03-29 03:19:51 +00:00
- Add Flask + Flask-SocketIO web viewer with dashboard (modules/web_viewer/app.py and related) - Add web viewer templates: index, realtime, tracking (contacts), cache, purging, stats (modules/web_viewer/templates/) - Add integration hooks and utility functions for web viewer (modules/web_viewer/integration.py, modules/utils.py) - Add command to launch web viewer from bot CLI (modules/commands/webviewer_command.py) - Update .gitignore: ignore db/log files, test scripts, and web viewer artifacts - Add restart_viewer.sh helper script for standalone web viewer restart/troubleshooting - Add guidance and documentation for modern viewer in WEB_VIEWER.md and docs/ - Various code structure and import improvements to core bot and command modules to support integration - Add ACL support for sensitive commands - Example config updates Benefits: - Decouples monitoring/UI from bot core process - Enables real-time browser dashboard and unified contact/repeater tracking - Easier integration, dev, and troubleshooting
43 lines
1.3 KiB
Bash
Executable File
43 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# MeshCore Bot Data Viewer Restart Script
|
|
# Manual restart tool for troubleshooting and development
|
|
# Use when integrated web viewer has issues or for standalone testing
|
|
|
|
echo "Restarting MeshCore Bot Data Viewer in standalone mode..."
|
|
|
|
# Check if Python 3 is available
|
|
if ! command -v python3 &> /dev/null; then
|
|
echo "Error: Python 3 is required but not installed."
|
|
exit 1
|
|
fi
|
|
|
|
# Check if we're in the right directory
|
|
if [ ! -f "modules/web_viewer/app.py" ]; then
|
|
echo "Error: app.py not found. Please run from the project root directory."
|
|
exit 1
|
|
fi
|
|
|
|
# Create logs directory if it doesn't exist
|
|
mkdir -p logs
|
|
|
|
# Set environment variables for better performance
|
|
export PYTHONPATH="${PYTHONPATH}:$(pwd)"
|
|
export FLASK_ENV=production
|
|
|
|
# Kill any existing web viewer processes on port 8080
|
|
echo "Checking for existing web viewer processes..."
|
|
if lsof -ti:8080 >/dev/null 2>&1; then
|
|
echo "Found existing processes on port 8080, stopping them..."
|
|
lsof -ti:8080 | xargs kill -9 2>/dev/null || true
|
|
sleep 2
|
|
fi
|
|
|
|
# Start the web viewer in standalone mode
|
|
echo "Starting web viewer in standalone mode on http://127.0.0.1:8080"
|
|
echo "Note: This runs independently of the main bot"
|
|
echo "Press Ctrl+C to stop"
|
|
echo ""
|
|
|
|
python3 modules/web_viewer/app.py --host 127.0.0.1 --port 8080
|