Files
claudetools/setup-ssh-keys.ps1
Mike Swanson 89e5118306 Remove conversation context/recall system from ClaudeTools
Completely removed the database context recall system while preserving
database tables for safety. This major cleanup removes 80+ files and
16,831 lines of code.

What was removed:
- API layer: 4 routers (conversation-contexts, context-snippets,
  project-states, decision-logs) with 35+ endpoints
- Database models: 5 models (ConversationContext, ContextSnippet,
  DecisionLog, ProjectState, ContextTag)
- Services: 4 service layers with business logic
- Schemas: 4 Pydantic schema files
- Claude Code hooks: 13 hook files (user-prompt-submit, task-complete,
  sync-contexts, periodic saves)
- Scripts: 15+ scripts (import, migration, testing, tombstone checking)
- Tests: 5 test files (context recall, compression, diagnostics)
- Documentation: 30+ markdown files (guides, architecture, quick starts)
- Utilities: context compression, conversation parsing

Files modified:
- api/main.py: Removed router registrations
- api/models/__init__.py: Removed model imports
- api/schemas/__init__.py: Removed schema imports
- api/services/__init__.py: Removed service imports
- .claude/claude.md: Completely rewritten without context references

Database tables preserved:
- conversation_contexts, context_snippets, context_tags,
  project_states, decision_logs (5 orphaned tables remain for safety)
- Migration created but NOT applied: 20260118_172743_remove_context_system.py
- Tables can be dropped later when confirmed not needed

New files added:
- CONTEXT_SYSTEM_REMOVAL_SUMMARY.md: Detailed removal report
- CONTEXT_SYSTEM_REMOVAL_COMPLETE.md: Final status
- CONTEXT_EXPORT_RESULTS.md: Export attempt results
- scripts/export-tombstoned-contexts.py: Export tool for future use
- migrations/versions/20260118_172743_remove_context_system.py

Impact:
- Reduced from 130 to 95 API endpoints
- Reduced from 43 to 38 active database tables
- Removed 16,831 lines of code
- System fully operational without context recall

Reason for removal:
- System was not actively used (no tombstoned contexts found)
- Reduces codebase complexity
- Focuses on core MSP work tracking functionality
- Database preserved for safety (can rollback if needed)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-18 19:10:41 -07:00

108 lines
3.3 KiB
PowerShell

# Setup Passwordless SSH Access to RMM Server
# This script configures SSH key authentication for automated deployments
param(
[string]$Password
)
$ErrorActionPreference = "Stop"
$RMM_HOST = "guru@172.16.3.30"
$SSH_PUB_KEY = Get-Content "$env:USERPROFILE\.ssh\id_rsa.pub"
Write-Host "[INFO] Setting up passwordless SSH access to RMM server..." -ForegroundColor Cyan
Write-Host ""
# Step 1: Copy public key to RMM server
Write-Host "[1/4] Copying SSH public key to RMM server..." -ForegroundColor Yellow
# Create temp file with public key
$tempKeyFile = "$env:TEMP\claude_ssh_key.pub"
$SSH_PUB_KEY | Out-File -FilePath $tempKeyFile -Encoding ASCII -NoNewline
# Copy to RMM server /tmp
if ($Password) {
# Use password if provided
$env:PLINK_PASSWORD = $Password
echo y | pscp -pw $Password $tempKeyFile "${RMM_HOST}:/tmp/claude_key.pub" 2>&1 | Out-Null
} else {
# Interactive password prompt
echo y | pscp $tempKeyFile "${RMM_HOST}:/tmp/claude_key.pub"
}
if ($LASTEXITCODE -ne 0) {
Write-Host "[ERROR] Failed to copy SSH key to server" -ForegroundColor Red
exit 1
}
Write-Host "[OK] Public key copied to /tmp/claude_key.pub" -ForegroundColor Green
Write-Host ""
# Step 2: Create .ssh directory on RMM server
Write-Host "[2/4] Creating .ssh directory on RMM server..." -ForegroundColor Yellow
if ($Password) {
plink -batch -pw $Password $RMM_HOST "mkdir -p ~/.ssh && chmod 700 ~/.ssh" 2>&1 | Out-Null
} else {
plink $RMM_HOST "mkdir -p ~/.ssh && chmod 700 ~/.ssh"
}
if ($LASTEXITCODE -ne 0) {
Write-Host "[WARNING] .ssh directory may already exist" -ForegroundColor Yellow
}
Write-Host "[OK] .ssh directory ready" -ForegroundColor Green
Write-Host ""
# Step 3: Append public key to authorized_keys
Write-Host "[3/4] Adding public key to authorized_keys..." -ForegroundColor Yellow
$setupCommand = @"
cat /tmp/claude_key.pub >> ~/.ssh/authorized_keys && \
chmod 600 ~/.ssh/authorized_keys && \
rm /tmp/claude_key.pub && \
echo 'SSH key installed successfully'
"@
if ($Password) {
plink -batch -pw $Password $RMM_HOST $setupCommand
} else {
plink $RMM_HOST $setupCommand
}
if ($LASTEXITCODE -ne 0) {
Write-Host "[ERROR] Failed to configure authorized_keys" -ForegroundColor Red
exit 1
}
Write-Host "[OK] Public key added to authorized_keys" -ForegroundColor Green
Write-Host ""
# Step 4: Test passwordless access
Write-Host "[4/4] Testing passwordless SSH access..." -ForegroundColor Yellow
Start-Sleep -Seconds 2
$testResult = plink -batch $RMM_HOST "echo 'Passwordless SSH working!'" 2>&1
if ($LASTEXITCODE -eq 0) {
Write-Host "[SUCCESS] Passwordless SSH is configured!" -ForegroundColor Green
Write-Host ""
Write-Host "You can now use plink/pscp without passwords:" -ForegroundColor White
Write-Host " pscp file.txt ${RMM_HOST}:/tmp/" -ForegroundColor Gray
Write-Host " plink ${RMM_HOST} 'ls -l'" -ForegroundColor Gray
Write-Host ""
Write-Host "The deploy.ps1 script will now work without prompts." -ForegroundColor White
} else {
Write-Host "[ERROR] Passwordless SSH test failed" -ForegroundColor Red
Write-Host "Output: $testResult" -ForegroundColor Gray
exit 1
}
# Clean up
Remove-Item $tempKeyFile -ErrorAction SilentlyContinue
Write-Host ""
Write-Host "=" * 70 -ForegroundColor Green
Write-Host "SSH KEY AUTHENTICATION CONFIGURED" -ForegroundColor Green
Write-Host "=" * 70 -ForegroundColor Green