# PIL Dashboards · windows-pil

The office's read-only dashboards at windows-pil.navonsimon.com: the data-store inventory (PostgreSQL, RustFS, SQL Server, legacy Barak) and the database-and-PC health view. A collector on win01 reads the local sources and pushes snapshots to the cluster, which keeps the last snapshot and serves the pages behind an access key.

**Status:** Live · Projects · 2026

- **Local checkout:** `/Users/simon/Developer/pil/office-refresh/inventory`
- **Live:** https://windows-pil.navonsimon.com/
- **Where it runs:** The cluster holds no SSH keys or DB passwords; DB and RustFS credentials stay on win01 (C:\windows-pil\config.json, C:\rustfs\credentials).
- **Note:** Read-only · access-key gate · collector on win01, cluster keeps the last snapshot

## Stack

Python 3.12 (collector on win01, stdlib only), FastAPI + uvicorn (cluster app), Kubernetes (namespace data-inventory, NodePort 30125), PostgreSQL 17 (barak_ro, SELECT-only), RustFS / S3-compatible bucket, MCP server (read-only), Windows Scheduled Task, Read-only

## Start here

- `README.md` — the whole shape: win01 collector -> cluster store -> pages/API/MCP/CLI, plus the deploy steps
- `win01/agent.py` — the collector that runs ON win01: local psql/PowerShell/RustFS (no SSH), loops live 10s / inventory 300s / security 600s with backoff, polls for refresh requests, pushes to the cluster ingest API
- `win01/install.ps1` — registers + starts the Scheduled Task windows-pil-collector (at logon, restart on failure)
- `win01/config.json` — on win01 only: ingest URL + token, barak_ro password, paths (ACL-restricted to SYSTEM+user)
- `deploy/proxy_app.py` — cluster app: POST /ingest/* (X-Ingest-Token) stores the snapshot on a PVC; serves /, /db-health and /api/* behind the access key; /api/pull for the collector
- `deploy/app.yaml` — namespace data-inventory: PVC + Deployment + NodePort 30125
- `mcp_server.py` — read-only MCP over the cluster API: health, inventory, section, live, security, refresh
- `../data-inventory.html` — the data-stores page (served at /)
- `../db-health.html` — the database-and-PC health page (served at /db-health)
- `~/.local/bin/windows-pil` — CLI: health | inventory | pg | rustfs | mssql | legacy | machine | security | live | refresh

## Commands

- **Deploy the cluster app:** `cd ~/Developer/pil/office-refresh/inventory && ./deploy/deploy.sh`
- **One-shot re-push from win01:** `ssh win01 'cd /d C:\windows-pil && python agent.py --once'`
- **Collector log:** `ssh win01 'powershell -NoProfile -Command "Get-Content C:\windows-pil\agent.log -Tail 20"'`
- **Collector task:** `ssh win01 'powershell -NoProfile -Command "(Get-ScheduledTask windows-pil-collector).State"'`
- **Freshness:** `windows-pil health`
- **MCP self-check:** `cd ~/Developer/pil/office-refresh/inventory && ../barak360/.venv/bin/python mcp_server.py --check`

## Deploy and where it runs

- Kubernetes namespace data-inventory (NodePort 30125) behind Cloudflare Tunnel via the edge nginx on ubuntu01; the collector runs on win01 as Scheduled Task windows-pil-collector.

## Current state

Built 2026-11-07: collector moved onto win01, the cluster keeps the last snapshot on a PVC and serves the pages and API; refresh round-trip verified; the site still serves the last snapshot with the win01 collector stopped. The old Mac collector + its launchd keeper are retired (collect.py/run.sh kept as manual fallback).

## Watch out

- The collector runs at logon on win01, so a reboot without login leaves it idle; the cluster serves the last snapshot until it returns.
- Live can lag ~30s while the inventory collect runs on the same loop.
- The cluster proxies nothing to the Mac; there is no Mac dependency in the live path.
- The data-inventory.html body still carries some pre-migration copy (the connections panel describes the old SSH path).

## Secrets — locations only, never print values

- deploy/.env (gitignored): ACCESS_KEY (read gate) + INGEST_TOKEN (ingest write token)
- win01 C:\windows-pil\config.json: ingest token + barak_ro password
- ~/.config/windows-pil/key (CLI/MCP)

## Links

- [Inventory README](file:///Users/simon/Developer/pil/office-refresh/inventory/README.md)
- [Decisions log](file:///Users/simon/Developer/pil/docs/decisions.md)
- [Open](https://windows-pil.navonsimon.com/)

## Tags

FastAPI, Kubernetes, PostgreSQL, RustFS, MCP, Read-only

---

Brief generated 2026-11-08 from `~/Developer/my-projects/context/`. Canonical URL: https://projects.navonsimon.com/context/windows-pil.md
