Files
claudetools/docs/deployment/deploy_to_rmm.ps1
Mike Swanson 06f7617718 feat: Major directory reorganization and cleanup
Reorganized project structure for better maintainability and reduced
disk usage by 95.9% (11 GB -> 451 MB).

Directory Reorganization (85% reduction in root files):
- Created docs/ with subdirectories (deployment, testing, database, etc.)
- Created infrastructure/vpn-configs/ for VPN scripts
- Moved 90+ files from root to organized locations
- Archived obsolete documentation (context system, offline mode, zombie debugging)
- Moved all test files to tests/ directory
- Root directory: 119 files -> 18 files

Disk Cleanup (10.55 GB recovered):
- Deleted Rust build artifacts: 9.6 GB (target/ directories)
- Deleted Python virtual environments: 161 MB (venv/ directories)
- Deleted Python cache: 50 KB (__pycache__/)

New Structure:
- docs/ - All documentation organized by category
- docs/archives/ - Obsolete but preserved documentation
- infrastructure/ - VPN configs and SSH setup
- tests/ - All test files consolidated
- logs/ - Ready for future logs

Benefits:
- Cleaner root directory (18 vs 119 files)
- Logical organization of documentation
- 95.9% disk space reduction
- Faster navigation and discovery
- Better portability (build artifacts excluded)

Build artifacts can be regenerated:
- Rust: cargo build --release (5-15 min per project)
- Python: pip install -r requirements.txt (2-3 min)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-18 20:42:28 -07:00

61 lines
2.1 KiB
PowerShell

# Deploy recall endpoint fix to RMM server
# Uses plink/pscp for Windows compatibility
$ErrorActionPreference = "Stop"
$sourceFile = "D:\ClaudeTools\api\routers\conversation_contexts.py"
$rmmHost = "guru@172.16.3.30"
$tempFile = "/tmp/conversation_contexts.py"
$targetFile = "/opt/claudetools/api/routers/conversation_contexts.py"
Write-Host "[1/3] Copying file to RMM server..." -ForegroundColor Cyan
& pscp -batch $sourceFile "${rmmHost}:${tempFile}"
if ($LASTEXITCODE -ne 0) {
Write-Host "[ERROR] Failed to copy file" -ForegroundColor Red
Write-Host "Try running: pscp $sourceFile ${rmmHost}:${tempFile}" -ForegroundColor Yellow
exit 1
}
Write-Host "[2/3] Moving file to production location..." -ForegroundColor Cyan
& plink -batch $rmmHost "sudo mv $tempFile $targetFile && sudo chown claudetools:claudetools $targetFile"
if ($LASTEXITCODE -ne 0) {
Write-Host "[ERROR] Failed to move file" -ForegroundColor Red
exit 1
}
Write-Host "[3/3] Restarting API service..." -ForegroundColor Cyan
& plink -batch $rmmHost "sudo systemctl restart claudetools-api && sleep 2 && sudo systemctl status claudetools-api --no-pager | head -15"
Write-Host ""
Write-Host "[SUCCESS] Deployment complete!" -ForegroundColor Green
Write-Host ""
Write-Host "Testing API..." -ForegroundColor Cyan
# Test the API
python - @"
import requests
import json
jwt_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJpbXBvcnQtc2NyaXB0Iiwic2NvcGVzIjpbImFkbWluIiwiaW1wb3J0Il0sImV4cCI6MTc3MTI3NTEyOX0.-DJF50tq0MaNwVQBdO7cGYNuO5pQuXte-tTj5DpHi2U"
response = requests.get(
"http://172.16.3.30:8001/api/conversation-contexts/recall",
headers={"Authorization": f"Bearer {jwt_token}"},
params={"search_term": "dataforth", "limit": 2}
)
print(f"API Status: {response.status_code}")
data = response.json()
if "contexts" in data:
print("[SUCCESS] Recall endpoint updated!")
print(f"Total: {data['total']}, Returned: {len(data['contexts'])}")
for ctx in data['contexts']:
print(f" - {ctx['title'][:60]}")
else:
print("[WARNING] Still old format")
print(json.dumps(data, indent=2)[:300])
"@