Commit graph

14 commits

Author SHA1 Message Date
Quinn Ftw
6331ec12ea fix(status-dashboard): add migrations, rename VPS→Host API
Root cause fixes for Apricot showing as "down":
- Create TypeORM migrations (production mode requires them)
- Tables: vps_resource_snapshots, docker_container_snapshots,
  docker_events, container_dependencies
- Add data-source.ts for TypeORM CLI operations

API naming alignment (host isn't a VPS):
- Rename /api/health/vps → /api/health/resources
- Rename VPSResourcesDto → HostResourcesDto
- Rename vps-resources.dto.ts → host-resources.dto.ts

Infrastructure:
- Add Dockerfile with curl, ca-certificates for health checks
- Add npm migration scripts to package.json

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 00:29:27 -08:00
Quinn Ftw
e426f6ae5b feat(status-dashboard): add push-only host monitoring with macOS support
- Add host-status-monitor agent for push-based metric collection
- Fix metrics-collector.ts for macOS compatibility:
  - collectCPU: Linux-first with macOS top fallback
  - collectMemory: Dynamic page size detection, use "occupied by compressor"
  - collectDisk: Linux-first with macOS df -g fallback
- Add macbook to FALLBACK_HOSTS in hosts.config.ts
- Delete unused multi-host-monitor.service.ts (SSH polling)
- Server now runs push-only mode by default

The architecture is now secure push-based: agents authenticate with
API keys or mTLS and push metrics to /api/metrics/report.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 23:12:12 -08:00
Quinn Ftw
0c6572d716 feat(versioning): unified version from VERSION.json
- status.atlilith.com now sources version from VERSION.json
- Frontend injects version at build time via Vite define
- Server reads VERSION.json instead of package.json
- release-deploy.sh increments builds before sync to releases
- version-bump.sh updated for <major>.<merges>.<builds> format
- Starting version: 0.0.0

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 20:50:56 -08:00
Quinn Ftw
631faa3d5f fix(status-dashboard): correct backend deploy path
The deploy script was deploying to /opt/health-monitor/dist/ but the
server runs from /opt/health-monitor/backend/. Fixed to deploy to the
correct path and added NODE_ENV=production to the startup command.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 17:34:50 -08:00
Quinn Ftw
ef6273542a fix(status-dashboard): add yaml dependency for hosts config
The hosts.config.ts uses the yaml package to parse YAML inventory files.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 17:08:47 -08:00
Quinn Ftw
16657ec5f2 fix(status-dashboard): fix nginx config variable substitution
Changed heredoc from quoted ('EOF') to unquoted (EOF) to enable
shell variable expansion for BACKEND_VPS_IP and BACKEND_API_PORT.
Properly escaped all nginx variables with backslash.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 17:06:11 -08:00
Quinn Ftw
b572f2062e fix(status-dashboard): remove unused https import
Removes unused https import from main.ts to fix TypeScript build error.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 17:03:22 -08:00
Quinn Ftw
d53db52566 feat(status-dashboard): add /api/version endpoint and auto-deploy hook
- Add VersionController with GET /api/version endpoint
  - Returns app name, version, build time, environment, uptime, node version
  - No authentication required for deployment verification
- Add pre-push git hook for auto-deployment workflow
  - Detects status-dashboard changes in commits
  - Syncs to releases/ directory
  - Builds frontend and server
  - Triggers deploy.sh for VPS deployment

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 16:49:30 -08:00
Quinn Ftw
c56e97216c feat(status-dashboard): add version logging to console
Outputs version 1.1.0-ui-refactor with build time to browser console
for deployment verification.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 15:48:46 -08:00
Quinn Ftw
48d1765be5 refactor(status-dashboard): apply DRY/SOLID with shared @ui layouts
- Create shared layout components in components/layouts/index.tsx
- Extract common patterns: PageContainer, Header, MainContent, Grid, etc.
- Add LoadingState/ErrorState compound components
- Update all pages to use @lilith/ui-primitives (Card, Spinner, Badge, etc.)
- Clean up unused style exports, delete LoginPage.styles.ts
- Reduce code duplication by ~45% across style files
- Dark theme (cyberpunk) remains default with theme switcher

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 15:43:16 -08:00
Quinn Ftw
156cc4f6ea fix(status-dashboard): fix WebSocket broadcast and add /admin/hosts route
- Fix HealthGateway socket access: use this.server.sockets.get() instead of
  this.server.sockets.sockets.get() for namespaced gateways
- Add /admin/hosts route to App.tsx for multi-host monitoring page
- Add "All Hosts" navigation link to AdminDashboard header

The WebSocket was crashing every 5s because in Socket.IO with namespaces,
this.server IS the namespace, so .sockets is the Map directly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 14:39:34 -08:00
Quinn Ftw
505acc9623 fix(status-dashboard): correct VPS architecture in deploy script
- Frontend VPS (nginx): 1.1984.nasty.sh (93.95.228.142)
- Backend VPS (API): 0.1984.nasty.sh (93.95.231.174:5000)
- Update nginx config to proxy API calls to backend VPS
- Fix verification to test correct backend endpoint

The status page architecture uses two VPS instances:
- Frontend serves static files via nginx
- Backend runs health-monitor API on separate VPS

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 14:18:39 -08:00
Quinn Ftw
17a74d35db fix: Update better-sqlite3 to ^11.0.0 for Node.js 24 compatibility
The previous version (^9.2.2) failed to compile with Node.js 24 due to
V8 API changes. Version 11.x includes the necessary native module updates.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 21:54:44 -08:00
Quinn Ftw
9b41041af3 feat: Implement hybrid feature-first architecture with status-dashboard
This commit establishes the new lilith-platform workspace structure:

Architecture:
- features/ directory for cohesive feature units (frontend+server+agent+shared)
- @packages/ for shared libraries (@core, @infrastructure, @providers, @ui, @utils)
- infrastructure/ for platform-wide scripts, docker, nginx, service-registry

Status Dashboard Feature:
- Migrated from egirl-platform @apps/status-dashboard → features/status-dashboard/
- Frontend: React + Vite + @lilith/ui components
- Server: NestJS with WebSocket support
- Agent: Node.js metrics collector
- Infrastructure: Deploy script for VPS

Shared Packages:
- @lilith/ui-* component libraries
- @lilith/health-client for health monitoring
- @lilith/theme-provider for theming
- @lilith/config for shared build config
- @lilith/text-utils and wizard-provider utilities

Build System:
- Turborepo with feature-aware task configuration
- pnpm workspace with hybrid package patterns
- All packages typecheck and build successfully

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-23 18:40:37 -08:00