openclaw/notebook-auto-deploy.bat
Claude Code 77645d143d feat: complete distributed Moltbot cluster enhancements
This commit adds comprehensive enhancements to the Moltbot distributed
cluster system, completing high and medium priority features.

Features Added:
- Web Management Panel (admin-panel.html)
  - Real-time database integration
  - Device management from database
  - Monitoring integration links (Grafana/Prometheus)
  - System health status indicator

- Database Persistence System
  - PostgreSQL database with 4 tables (conversations, devices, system_logs, statistics)
  - HTTP API at port 18800 for database operations
  - systemd service for auto-start

- Monitoring Stack (Grafana + Prometheus)
  - Docker Compose setup
  - Grafana: http://38.14.254.51:3000 (admin/moltbot2024)
  - Prometheus: http://38.14.254.51:9090
  - Node Exporter for system metrics

- Automation Scripts
  - notebook-auto-deploy.bat: Automated notebook deployment
  - register-device.bat: Device registration with database
  - setup-ssh-keys.bat: SSH key configuration for passwordless sync
  - sync-daemon.bat: Auto-sync every 10 minutes
  - sync-sessions.bat: Manual session sync

- Email/Webhook Alert System
  - Alert configuration at /opt/moltbot-monitoring/alert-config.json
  - Support for email, DingTalk, Slack, WeChat

- Session Synchronization
  - Server-side: /opt/moltbot-sync/sync-sessions.sh
  - Client-side: sync-sessions.bat
  - Cron job: */10 * * * * (every 10 minutes)
  - Backup rotation (keeps last 10)

Updated:
- ROADMAP.md: Marked completed features, updated progress

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-29 17:42:40 +08:00

165 lines
3.9 KiB
Batchfile

@echo off
chcp 65001 >nul
title Moltbot Notebook Auto Deployment
set "REPO_URL=https://github.com/flowerjunjie/moltbot.git"
set "INSTALL_DIR=C:\moltbot"
set "CONFIG_DIR=%USERPROFILE%\.clawdbot"
echo ========================================
echo Moltbot Notebook Auto Deployment
echo ========================================
echo.
echo This script will automatically install Moltbot on this notebook.
echo.
echo Installation directory: %INSTALL_DIR%
echo Configuration directory: %CONFIG_DIR%
echo.
REM Check if Git is installed
where git >nul 2>&1
if errorlevel 1 (
echo ERROR: Git is not installed
echo Please install Git from: https://git-scm.com/downloads
pause
exit /b 1
)
REM Check if Node.js is installed
where node >nul 2>&1
if errorlevel 1 (
echo ERROR: Node.js is not installed
echo Please install Node.js from: https://nodejs.org/
pause
exit /b 1
)
echo [1/6] Checking prerequisites...
echo.
echo Git: OK
echo Node.js: OK
echo.
REM Clone or update repository
if exist "%INSTALL_DIR%\.git" (
echo [2/6] Repository exists, updating...
cd /d "%INSTALL_DIR%"
git pull
) else (
echo [2/6] Cloning repository...
if exist "%INSTALL_DIR%" (
echo Installation directory already exists (not a git repo)
choice /C YN /M "Remove and re-clone"
if errorlevel 2 (
echo Installation cancelled
pause
exit /b 1
)
rmdir /s /q "%INSTALL_DIR%"
)
git clone "%REPO_URL%" "%INSTALL_DIR%"
cd /d "%INSTALL_DIR%"
)
if errorlevel 1 (
echo ERROR: Failed to clone repository
pause
exit /b 1
)
echo.
echo [3/6] Installing dependencies...
call pnpm install --silent
if errorlevel 1 (
echo ERROR: Failed to install dependencies
echo Trying with npm instead...
call npm install --silent
if errorlevel 1 (
echo ERROR: Failed to install dependencies with npm
pause
exit /b 1
)
)
echo.
echo [4/6] Building Moltbot...
call pnpm build --silent
if errorlevel 1 (
echo WARNING: Build failed, but continuing...
)
echo.
echo [5/6] Creating configuration...
REM Create config directory if not exists
if not exist "%CONFIG_DIR%" mkdir "%CONFIG_DIR%"
REM Check if config already exists
if exist "%CONFIG_DIR%\moltbot.json" (
echo Configuration file already exists
choice /C YN /M "Overwrite existing configuration"
if errorlevel 2 goto skip_config
)
REM Create configuration file
(
echo {
echo "gateway": {
echo "mode": "hybrid",
echo "bind": "lan",
echo "auth": {"token": "moltbot-cluster-2024"}
echo },
echo "browser": {"enabled": true},
echo "models": {
echo "mode": "merge",
echo "providers": {
echo "minimax": {
echo "baseUrl": "https://api.minimaxi.com/anthropic",
echo "apiKey": "YOUR_API_KEY_HERE",
echo "authHeader": true
echo }
echo }
echo }
echo }
) > "%CONFIG_DIR%\moltbot.json"
echo Configuration created at: %CONFIG_DIR%\moltbot.json
echo.
:skip_config
echo [6/6] Creating shortcuts...
REM Create desktop shortcut
set "SHORTCUT=%USERPROFILE%\Desktop\Moltbot.lnk"
powershell -Command "$ws = New-Object -ComObject WScript.Shell; $s = $ws.CreateShortcut('%SHORTCUT%'); $s.TargetPath = '%INSTALL_DIR%\Moltbot.bat'; $s.WorkingDirectory = '%INSTALL_DIR%'; $s.Save()"
echo.
echo ========================================
echo Installation Complete!
echo ========================================
echo.
echo Desktop shortcut created: %SHORTCUT%
echo.
echo To configure your API key:
echo 1. Edit: %CONFIG_DIR%\moltbot.json
echo 2. Replace YOUR_API_KEY_HERE with your actual MiniMax API key
echo.
echo To start Moltbot:
echo - Double-click the desktop shortcut
echo - Or run: %INSTALL_DIR%\Moltbot.bat
echo.
echo To register this device with the cluster:
echo - Run: %INSTALL_DIR%\register-device.bat
echo.
choice /C YN /M "Start Moltbot now"
if errorlevel 1 (
start "" "%INSTALL_DIR%\Moltbot.bat"
)
echo.
echo Thank you for installing Moltbot!
echo.
pause