Commit Graph

268 Commits

Author SHA1 Message Date
3eb621a8b7 Add message for Howard: need Cascades Synology (cascadesds) credentials
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 18:30:35 -07:00
4220b8f57c sync: auto-sync from ACG-TECH03L at 2026-04-17 15:05:26
Author: Howard Enos
Machine: ACG-TECH03L
Timestamp: 2026-04-17 15:05:26
2026-04-17 15:05:28 -07:00
4886c8cc2a sync: auto-sync from ACG-TECH03L at 2026-04-17 14:34:56
Author: Howard Enos
Machine: ACG-TECH03L
Timestamp: 2026-04-17 14:34:56
2026-04-17 14:34:58 -07:00
5a31946083 sync: auto-sync from ACG-TECH03L at 2026-04-17 14:25:31
Author: Howard Enos
Machine: ACG-TECH03L
Timestamp: 2026-04-17 14:25:31
2026-04-17 14:25:33 -07:00
71c9ddce9e sync: auto-sync from ACG-TECH03L at 2026-04-17 14:10:20
Author: Howard Enos
Machine: ACG-TECH03L
Timestamp: 2026-04-17 14:10:20
2026-04-17 14:10:25 -07:00
e695743149 Session log: Cascades vault fix, Ollama Tailscale sharing, Howard review
Fixed Cascades pfSense password in vault (a6A6c6fe→Th1nk3r^99, moved from
dataforth to cascades-tucson). Ollama exposed via Tailscale for Howard
(100.92.127.64:11434, firewall restricted to 100.0.0.0/8). Reviewed
Howard's first full day of work on shared system.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 13:09:29 -07:00
5995511011 Ollama shared via Tailscale: per-machine URL detection + Howard access
CLAUDE.md: Ollama section rewritten. localhost for Mike's workstation,
100.92.127.64:11434 via Tailscale for all other machines. Claude reads
identity.json hostname to determine which URL to use. Firewall rule
restricts to Tailscale 100.0.0.0/8 subnet only.

ONBOARDING.md: updated Ollama section for remote access.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 13:05:07 -07:00
b99f8512e4 sync: auto-sync from ACG-TECH03L at 2026-04-17 13:02:04
Author: Howard Enos
Machine: ACG-TECH03L
Timestamp: 2026-04-17 13:02:04
2026-04-17 13:02:09 -07:00
68d9836245 Session log: Glaztech/MVAN phishing remediation, Syncro integration, DNS hardening
Glaztech: 32 phishing messages purged, MX/DMARC/EFC hardened, incident report.
MVAN: DMARC p=reject added. Syncro /syncro command built (comment+time flow).
GoDaddy API onboarded. jparkinsonaz.com DNS fixed (A→Neptune, DMARC, autodiscover).
desertrat.com audited (needs DMARC + SPF fix on Route 53).
Jupiter OwnCloud migration confirmed complete.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 12:43:09 -07:00
dd8e45de80 sync: auto-sync from ACG-TECH03L at 2026-04-17 11:44:31
Author: Howard Enos
Machine: ACG-TECH03L
Timestamp: 2026-04-17 11:44:31
2026-04-17 11:44:33 -07:00
32888ea9d4 sync: auto-sync from ACG-TECH03L at 2026-04-17 11:26:41
Author: Howard Enos
Machine: ACG-TECH03L
Timestamp: 2026-04-17 11:26:41
2026-04-17 11:26:46 -07:00
ac4ceb65c0 Fix /syncro: time is added via comment fields, not timer_entry
Discovered from GUI page source: comment[product_id] + comment[minutes_spent]
+ comment[bill_time_now] are fields on POST /tickets/{id}/comment. This is
how the GUI adds time — as part of the comment, not via separate timer_entry.
Updated billing workflow + added --time/--labor flags to comment command.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 11:17:40 -07:00
392c42710c Fix /syncro billing: use timer_entry + labor products, not invoice line items
Timer entries use POST /tickets/{id}/timer_entry with labor product IDs
(not invoice products). "Make Invoice" converts timers to invoice.
Documented 7 common labor products with IDs. Fixed line_items path to
/invoices/{id}/line_items.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 11:14:12 -07:00
046175af3a Add /syncro command — Syncro PSA ticket management
Create, update, close, comment on, search, and bill tickets via Syncro
REST API. Includes customer search, invoice creation, line items, and
ticket timer management. API key from SOPS vault.

Verified: pulls real ticket data from computerguru.syncromsp.com.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 10:53:34 -07:00
6bb00601b7 Glaztech phishing incident: 32 messages purged, MX/DMARC/EFC hardened
Two phishing campaigns hit Glaztech on 2026-04-17 bypassing MailProtector
via exposed M365 MX record. Spoofed internal senders, forwarded by 8 users.

Fixes applied: removed direct M365 MX, DMARC p=reject, Enhanced Filtering
on inbound connector. 32 messages purged across all affected mailboxes.
Forensic samples + full incident report preserved.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 10:47:24 -07:00
996dd515b1 Session log: EVS Win11 context menu -> Win10-style revert
New clients/evs/ directory with session log documenting the
registry tweak to restore the classic right-click context menu
on Howard's EVS VM (reg add of empty InprocServer32 under the
Win11 new-menu CLSID, per-user HKCU, no admin needed).
2026-04-17 10:18:48 -07:00
f190f7813f Session log: OwnCloud cache migration completed successfully
589G OwnCloud data moved from cache SSD to disk7 array (2h49m rsync).
Cache dropped from 82% to 34%. MariaDB + Discourse recovered and running
7h+ healthy. Share config changed to no-cache permanently.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 05:39:39 -07:00
a3fe1b9a9b Session log: Jupiter maintenance, OwnCloud cache migration, /mode fix
Jupiter cache drive at 99% BTRFS data allocation — MariaDB + Discourse
crash-looping. Root cause: 589G OwnCloud data stuck on cache (mover
blocked by active SMB session from OwnCloud VM). Migration in progress
(rsync cache->array disk7, ~90% at time of commit). Also fixed /mode
command to acknowledge /color is user-invokable only.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 20:46:19 -07:00
d13d4e4909 Add /mode command — auto-detecting work mode with terminal color
Five modes: client (orange), dev (cyan), infra (red), general (blue),
remediation (purple). Auto-detects from user messages using keyword
priority rules. Manual override via /mode <name>. Color changes via
/color on mode transitions. Posture adjusts per mode (e.g., infra =
confirm-before-destructive, dev = delegate freely).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 19:49:44 -07:00
8d975c1b44 import: ingested 160 files from C:\Users\howar\Clients
Howard's personal MSP client documentation folder imported into shared
ClaudeTools repo via /import command. Scope:

Clients (structured MSP docs under clients/<name>/docs/):
- anaise       (NEW)  - 13 files
- cascades-tucson     - 47 files merged (existing had only reports/)
- dataforth           - 18 files merged (alongside incident reports)
- instrumental-music-center - 14 files merged
- khalsa       (NEW)  - 22 files, multi-site (camden, river)
- kittle       (NEW)  - 16 files incl. fix-pdf-preview, gpo-intranet-zone
- lens-auto-brokerage (NEW) - 3 files (name matches SOPS vault)
- _client_template    - 13-file scaffold for new clients

MSP tooling (projects/msp-tools/):
- msp-audit-scripts/ - server_audit.ps1, workstation_audit.ps1, README
- utilities/         - clean_printer_ports, win11_upgrade,
                       screenconnect-toolbox-commands

Credential handling:
- Extracted 1 inline password (Anaise DESKTOP-O8GF4SD / david)
  to SOPS vault: clients/anaise/desktop-o8gf4sd.sops.yaml
- Redacted overview.md with vault reference pattern
- Scanned all 160 files for keys/tokens/connection strings -
  no other credentials found

Skipped:
- Cascades/.claude/settings.local.json (per-machine config)
- Source-root CLAUDE.md (personal, claudetools has its own)
- scripts/server_audit.ps1 and workstation_audit.ps1 at source root
  (identical duplicates of msp-audit-scripts versions)

Memory updates:
- reference_client_docs_structure.md (layout, conventions, active list)
- reference_msp_audit_scripts.md (locations, ScreenConnect 80-char rule)

Session log: session-logs/2026-04-16-howard-client-docs-import.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-16 19:43:58 -07:00
6eaba02b71 Session log: multi-user setup, audit fixes, /import command, Howard onboarding
Appended afternoon work: MSI installer MVP, Len's Auto Brokerage test
client, Uranus server docs, multi-user identity system, onboarding guide,
bootstrap package, audit gap fixes (GrepAI/Ollama/MCP/settings), and
generic /import command for folder ingestion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 19:29:07 -07:00
f5acf9f453 Add /import command — generic folder ingestion with smart classification
Slash command that accepts any folder path, scans all files, classifies
by content (client work, project code, credentials, session logs, tools,
docs), sanitizes credentials into SOPS vault, presents a placement plan
for approval, then executes.

Handles Claude Code session data (delegates to tools/import-sessions.py),
existing project detection, duplicate checks, and credential extraction.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 19:25:29 -07:00
8a094529ab Add session import tool + fix audit gaps (GrepAI, Ollama, MCP, settings)
tools/import-sessions.py: Scans ~/.claude/projects/ for existing Claude
Code sessions, extracts summaries (user messages, tools used, files
touched, credential flags), stages for Claude to organize into
ClaudeTools folder structure.

Audit gap fixes:
- .mcp.json: added grepai MCP server
- .claude/settings.json: created with bypassPermissions default
- .claude/MCP_SERVERS.md: documented all MCP servers
- Ollama: all 3 models pulled (qwen3:14b, codestral:22b, nomic-embed-text)
- GrepAI: initialized (grepai init), watcher ready

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 19:21:01 -07:00
6f6a77f8e4 Session log: /save + /sync multi-user change summaries
Enhance /save and /sync slash commands to attribute commits by author
so Mike and Howard can see at a glance what the other person did.

- sync.sh: loads identity.json, shows incoming/outgoing commits with
  author + age before pull/push, groups by author in final summary
- sync.md: describes the new output format + conflict attribution
- save.md: pre-commit Change Summary block + post-commit Summary

Motivation: repo is now shared across team, `git log` alone made it
hard to see "when did Howard change that?" without hunting.
2026-04-16 19:08:25 -07:00
100a491ac6 Session log: multi-user setup, audit + gap fixes, Howard onboarding package
Two session logs:
- session-logs/2026-04-16-session.md: cross-cutting (multi-user, audit, infrastructure)
- guru-rmm session log appended: MSI installer, Len's Auto Brokerage, Uranus, migration drift

Gap fixes: GrepAI initialized + MCP server added, Ollama models pulling,
settings.json created (bypassPermissions), MCP_SERVERS.md written.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 18:56:26 -07:00
a18157b5fa Session log: Automatic context loading system implementation 2026-04-16 18:40:27 -07:00
43c116f0c6 Onboarding guide + Howard's own Gitea account + first-time tutorial flow
- ONBOARDING.md: comprehensive guide explaining WHY the setup exists
  (vault, session logs, skills, agents, Ollama/GrepAI, daily workflow).
  Written for someone who's never used Claude Code before.
- CLAUDE.md: on first sync, Claude walks new users through ONBOARDING.md
  section by section + sets up git remote for their own Gitea account.
- users.json: Howard's gitea_username added (own account, admin on all repos).

Audit findings noted: GrepAI not installed, Ollama not running,
MCP_SERVERS.md missing. These need fixing per-machine before onboarding
is fully smooth.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 18:23:59 -07:00
ea48061389 Multi-user support: identity tracking for Mike + Howard
- .claude/identity.json (gitignored, per-machine) identifies who's at the keyboard
- .claude/users.json (tracked) registers known team members + roles + machines
- CLAUDE.md: on first sync, Claude asks "Mike or Howard?" and creates identity.json
- Session logs must include User section for attribution
- Git commits use per-user name/email (shared Gitea push account)
- Howard Enos (tech, full trust) added as second team member
- Memory entry created for Howard

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 18:11:14 -07:00
232f463325 credentials.md: add Uranus entry, note IP reuse on Saturn
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 09:07:43 -07:00
d033dbe8a2 Session log: CI signing pipeline + v0.6.1 release + MSI installer MVP
End-to-end automated signing via jsign on Linux build server (SP-authenticated
to Azure Trusted Signing). First signed release built through the pipeline.
First signed MSI installer using WiX 5 on Windows workstation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 08:34:53 -07:00
148ac75a25 Add GuruRMM Agent MSI installer (WiX 5) — Phase 1 MVP
Signed Windows installer using our Azure Trusted Signing pipeline. Phase 1
scope: installs signed agent to Program Files, creates ProgramData dir,
Apps & Features entry with proper publisher, clean install + uninstall.

Phase 2 deferred: service registration, MSI properties for site-code
injection, agent install/uninstall custom actions, firewall rules.

Verified end-to-end on Windows workstation:
- wix build produces 1.16 MB MSI
- sign.ps1 signs it against gururmm-public-trust cert profile
- msiexec /qn installs silently, signature chain verifies on installed binary
- msiexec /x uninstalls cleanly, retains ProgramData

Tooling prerequisites documented in installer/README.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 08:19:52 -07:00
2937c29f07 build-agents.sh: fix VERSION parsing with awk (was broken sed backslash)
Sed escape-sequence handling through the heredoc lost the \1
backreference, yielding an empty VERSION. Switched to
awk -F'"' '/^version/{print $2; exit}' which is simpler and resistant to
quoting. First full end-to-end signed build validated v0.6.1 deployed
and verified against the Microsoft cert chain.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 07:59:06 -07:00
fdd0bb0c1f GuruRMM CI signing: jsign on Linux build server + sign-windows.sh wrapper + build-agents.sh integration
- sign-windows.sh: jsign wrapper using Trusted Signing service principal
  via OAuth client_credentials flow. Reads SP creds from
  /etc/gururmm-signing.env (root-only). Uses RFC3161 timestamping (jsign's
  default Authenticode mode fails against Microsoft ACS).
- build-agents.sh: now signs the Windows binary in-place after cargo build
  and computes sha256 AFTER signing so consumers get correct hashes.
- Updated -latest symlinks for both Linux + Windows in the build script.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 07:42:58 -07:00
5abf9ba670 Add Trusted Signing config (metadata.json + sign.ps1 wrapper)
Reproducible signing setup for any developer machine. metadata.json
points signtool at the gururmm-signing account / gururmm-public-trust
cert profile. sign.ps1 wraps signtool with the right /dlib + /dmdf +
timestamp flags; uses az login session for authentication.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 06:54:46 -07:00
f01d9d5538 Add Dataforth process docs + Azure signing attestation letter
- TEST-DATASHEET-PROCESS.md: comprehensive pipeline documentation for
  Dataforth engineering (10 sections, data flow, state diagram, FAQ)
- signing-attestation/: domain ownership attestation letter with
  in-place signature for Azure Trusted Signing identity validation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 19:33:06 -07:00
733d87f20e Dataforth UI push + dedup + refactor, GuruRMM roadmap evolution, Azure signing setup
Dataforth (projects/dataforth-dos/):
- UI feature: row coloring + PUSH/RE-PUSH buttons + Website Status filter
- Database dedup to one row per SN (2.89M -> 469K rows, UNIQUE constraint added)
- Import logic handles FAIL -> PASS retest transition
- Refactored upload-to-api.js to render datasheets in-memory (dropped For_Web filesystem dep)
- Bulk pushed 170,984 records to Hoffman API
- Statistical sanity check: 100/100 stamped SNs verified on Hoffman

GuruRMM (projects/msp-tools/guru-rmm/):
- ROADMAP.md: added Terminology (5-tier hierarchy), Tunnel Channels Phase 2,
  Logging/Audit/Observability, Multi-tenancy, Modular Architecture,
  Protocol Versioning, Certificates sections + Decisions Log
- CONTEXT.md: hierarchy table, new anti-patterns (bootstrap sacred,
  no cross-module imports), revised next-steps priorities

Session logs for both projects.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 17:39:32 -07:00
eae9d7f644 AD2 scheduled task for Dataforth uploader pipeline (hourly, SYSTEM)
Installed C:\ProgramData\dataforth-uploader\ on AD2 with:
  - credentials.json (SYSTEM+Administrators ACL only)
  - run-pipeline.ps1 (DFWDS-process -> enumerate For_Web -> upload-delta)
  - dfwds-process.js + upload-delta.js (copied from prior install dir)
  - logs/ with 60-day retention

Scheduled Task 'DataforthTestDatasheetUploader' registered as SYSTEM,
hourly trigger, 30-min execution limit. First SYSTEM-context run verified:
received=7061 unchanged=7061 errors=0 in 8.7s.

Initial registration via inline base64 mangled the backslashes in the -File
argument (resulted in ERROR_DIRECTORY 0x8007010B). Fixed by running the
registration PowerShell from a file rather than an encoded command string.

Also deleted throwaway tmp/list_amtransit.py + tmp/reset_cansley.py which
had hardcoded ACG admin password.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 07:23:42 -07:00
dd5c5afd4b Session log + DFWDS Node port + Hoffman API uploader pipeline
Built the missing piece between the test datasheet pipeline and Dataforth's
new product API. End-to-end:

- Pulled DFWDS (Dataforth Web Datasheet System) VB6 source from
  AD1\Engineering\ENGR\ATE\Test Datasheets\DFWDS to local for analysis
- Decoded its filename validation: A-J prefix decodes (A=10..J=19), all-
  numeric WO# valid (no leading 0), anything else bad
- Ported the validation + move logic to Node (dfwds-process.js)
- Built bulk uploader (upload-delta.js) for Hoffman's Swagger API
  (POST /api/v1/TestReportDataFiles/bulk with OAuth client_credentials)

Sanitized 3 prior reference scripts (fetch-server-inventory, test-scenarios,
test-upload-two) to read CF_* env vars instead of hardcoded creds.

Live drain results:
- 897 files moved Test_Datasheets -> For_Web (all valid, no renames, no
  bad), DFWDS port summary in 1.1s
- Pushed entire For_Web (7,061 files) to Hoffman API in 49.7s @ 142/s:
  Created=803 Updated=114 Unchanged=6,144 Errors=0
- Server count: 489,579 -> 490,382 (+803 net new)

Also:
- Added clients/dataforth/.gitignore to exclude plaintext Oauth.txt note
- Added clients/instrumental-music-center/docs/2026-04-13-ticket-notes.md
  (ticket write-up of 2026-04-11/12/13 IMC1 RDS removal/SQL migration work)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 21:06:50 -07:00
72105233a2 Add automatic context loading system with triggers 2026-04-14 20:47:43 -07:00
d0dbfed5ec Add CONTEXT.md files for automatic context recovery 2026-04-14 20:45:46 -07:00
04bdac0448 Session log: Tunnel testing + auth fix (Phase 1 complete) 2026-04-14 20:34:54 -07:00
7326fbb05c Fix 4 critical bugs in GuruRMM agent update system
Resolves issues that could cause agent failure, stuck updates, and
silent errors during the update process.

Critical Fixes:

1. Binary Replacement Race Condition (Unix)
   - PROBLEM: Window between rename and copy where no binary exists
   - FIX: Use atomic rename pattern - copy to temp in same directory,
     then single atomic rename operation
   - IMPACT: Eliminates complete agent failure on crash during update

2. Update Failure Without Rollback
   - PROBLEM: If restart fails after update, no rollback triggered
   - FIX: Added rollback_binary() method, explicitly rolls back on
     restart failure before returning error
   - IMPACT: Agent no longer stuck in broken state

3. Windows Scheduled Task Timing Bug
   - PROBLEM: Scheduled time could be in past, schtasks would fail
   - FIX: Add 60-second buffer, return date+time tuple with /SD param
   - IMPACT: Rollback watchdog now reliably schedules on Windows

4. Windows Binary Replacement Error Handling
   - PROBLEM: All errors silently ignored with .ok()
   - FIX: Proper error propagation with .context() on all operations
   - IMPACT: Update failures now visible with actionable error messages

Code Review: APPROVED
- All fixes correctly address root causes
- Atomic operations eliminate race conditions
- Comprehensive error handling throughout
- Platform-specific code properly isolated

Testing: Syntax verified (cross-compilation toolchain not available)

Additional Issues Identified (for follow-up):
- HIGH: Unix watchdog doesn't survive reboots (systemd timer needed)
- MEDIUM: No concurrent update protection (lock file recommended)
- LOW: chmod failure should be fatal

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-04-14 08:39:12 -07:00
c9eba69753 Merge feature/real-time-tunnel: Phase 1 real-time tunnel infrastructure
Complete implementation of Phase 1 tunnel infrastructure enabling
persistent secure channels between GuruRMM server and agents for
future command execution and file operations.

Key Features:
- Bidirectional WebSocket tunnel protocol
- Agent mode switching (Heartbeat ↔ Tunnel) without dropping connection
- REST API for tunnel management (/open, /close, /status)
- Database session tracking with ownership validation
- Automatic cleanup on agent disconnect
- Channel multiplexing infrastructure (ready for Phase 2)

Implementation:
- Server: Database layer, API endpoints, WebSocket handlers
- Agent: State machine, tunnel manager, WebSocket integration
- Security: JWT auth, session ownership, UUID validation, SQL injection prevention
- Database: tech_sessions and tunnel_audit tables with proper constraints

Testing:
- Code review: 3 iterations, all critical issues resolved
- API endpoints: All tested with proper HTTP status codes (400, 401, 403, 404)
- Database: Migration applied successfully to production
- Deployment: Server running at 172.16.3.30:3001

Commits:
- 7c467b0 Add stub migrations and test results for Phase 1 tunnel
- 178d580 Renumber tunnel migration from 006 to 010
- 9a6d67f Fix migration syntax: Use partial unique index
- 2e6d1a6 Implement GuruRMM Phase 1: Real-time tunnel infrastructure
- 9940faf Add GuruRMM real-time tunnel architecture and planning

Production Status: DEPLOYED and OPERATIONAL
Next Phase: Terminal command execution (Phase 2)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-04-14 08:21:20 -07:00
7c467b0d2c Add stub migrations and test results for Phase 1 tunnel
Stub migrations (005-008) satisfy sqlx requirement for previously
applied migrations that are missing source files in the codebase.
These migrations were applied in production but not committed.

Renumbered 005_add_missing_indexes to 009 to match production sequence.

Test results document confirms all Phase 1 tunnel API endpoints are
functioning correctly with proper error handling and HTTP status codes.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-04-14 08:20:50 -07:00
178d580190 Renumber tunnel migration from 006 to 010
Avoids conflict with migrations 5-8 that were applied to production
database but are missing from current codebase. Migration 010 will be
applied after the existing sequence (1-4, 9 for 005_add_missing_indexes).
2026-04-14 07:52:35 -07:00
9a6d67fdc5 Fix migration syntax: Use partial unique index instead of inline constraint
PostgreSQL doesn't support inline CONSTRAINT with WHERE clause.
Changed to separate CREATE UNIQUE INDEX statement for the partial
unique constraint on (tech_id, agent_id, status) WHERE status = 'active'.

This ensures only one active tunnel session per (tech, agent) pair
while allowing multiple closed sessions in history.

Migration tested and verified on PostgreSQL 14.
2026-04-14 07:39:58 -07:00
2e6d1a67dd Implement GuruRMM Phase 1: Real-time tunnel infrastructure
Complete bidirectional tunnel communication between server and agents,
enabling persistent secure channels for future command execution and
file operations. Agents transition from heartbeat mode to tunnel mode
on-demand while maintaining WebSocket connection.

Server Implementation:
- Database layer (db/tunnel.rs): Session CRUD, ownership validation,
  cleanup on disconnect (prevents orphaned sessions)
- API endpoints (api/tunnel.rs): POST /open, POST /close, GET /status
  with JWT auth, UUID validation, proper HTTP status codes
- Protocol extension (ws/mod.rs): TunnelOpen/Close/Data messages,
  agent response handlers (TunnelReady/Data/Error)
- Migration (006_tunnel_sessions.sql): tech_sessions table with
  partial unique constraint, foreign keys with CASCADE, audit table

Agent Implementation:
- State machine (tunnel/mod.rs): AgentMode (Heartbeat ↔ Tunnel),
  channel multiplexing, concurrent session prevention
- WebSocket handlers (transport/websocket.rs): Open/close tunnel,
  mode switching without dropping connection, cleanup on disconnect
- Protocol extension (transport/mod.rs): TunnelReady/Data/Error
  messages matching server definitions
- Unit tests: Lifecycle and channel management coverage

Key Features:
- Security: JWT auth, session ownership verification, SQL injection
  prevention, constraint-based duplicate session blocking
- Cleanup: Automatic session closure on agent disconnect (both sides),
  channel cleanup, graceful state transitions
- Error handling: Proper HTTP status codes (400/403/404/409/500),
  comprehensive Result types, detailed logging
- Extensibility: Channel types ready (Terminal/File/Registry/Service),
  TunnelDataPayload enum for Phase 2+ expansion

Phase 1 Scope (Implemented):
- Tunnel session lifecycle management
- Mode switching (heartbeat ↔ tunnel)
- Protocol message routing
- Database session tracking

Phase 2 Next Steps:
- Terminal command execution (tokio::process::Command)
- Client WebSocket connections for output streaming
- Command audit logging
- File transfer operations

Verification:
- Server compiles successfully (0 errors)
- Agent unit tests pass (tunnel lifecycle, channel management)
- Code review approved (protocol alignment verified)
- Database constraints enforce referential integrity
- Cleanup tested (session closure on disconnect)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-04-14 07:10:09 -07:00
9940faf34a Add GuruRMM real-time tunnel architecture and planning
Comprehensive design for transforming agents from 30s heartbeat mode to
persistent tunnel mode, enabling Claude Code to execute commands on remote
machines through secure multiplexed WebSocket channels.

Additions:
- Complete implementation plan with 5-phase roadmap (5-7 weeks to GA)
- Detailed architecture document covering protocol, security, and MCP integration
- Database migration for tech_sessions and tunnel_audit tables

Key architectural decisions:
- Hybrid lifecycle: WebSocket persistent, tunnel is operational state
- Channel multiplexing over single WebSocket (terminal, file ops, etc.)
- Three-layer security: JWT auth, session authorization, command validation
- Custom MCP server for Claude Code integration

Next: Phase 1 implementation (tunnel open/close endpoints, agent mode state machine)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-04-14 06:32:16 -07:00
9ab36352ae Session log: Tunnel expansion + WHM fix (ix. grey-cloud)
Audited all 25 proxied zone records and expanded tunnel ingress to cover
9 hostnames total (azcomputerguru + analytics + community + radio +
git + plexrequest + rmm + rmm-api + sync). All verified HTTP 200.

Reverted 3 hostnames to original A records after discovering they
require backend work, not tunnel changes:
- plex/rustdesk: NPM on Jupiter has no vhost for these (returned
  'tls: unrecognized name' when tunneled)
- secure: Jupiter can't route to its backend subnet 172.16.1.0/24

Reverted ix.azcomputerguru.com to DNS-only A record after user
reported :2087 WHM access broken. Cloudflare Tunnel is hostname-bound,
not port-bound, so non-standard admin ports can't pass through. Direct
NAT to 72.194.62.5 restored WHM/cPanel access.

Adds four new helper scripts under clients/internal-infrastructure/
scripts/cloudflared-tunnel-setup/ (audit_proxied, discover_backends,
expand_tunnel, revert_broken). All use SOPS vault / env var for creds.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 15:59:49 -07:00
5169936cfc Session log: IMC SQL move + DISM repair attempt, VWP RDWeb brute-force incident, Dataforth API planning
- IMC: document 716 GB SQL backup cleanup, retention scheduled task, DB move C:->S:, sysadmin grant via single-user recovery, parked RDS removal after KB5075999 apply rolled back on ETW manifest error
- Valleywide: document RDWeb brute-force incident on VWP-QBS, UDM port forward closure, 30-day audit showing no breach, lockout policy restoration
- Dataforth: capture Swagger API review and Hoffman Zoom call prep
2026-04-13 15:40:43 -07:00