Diff -- /var/www/vhosts/3dshawn.com/site1/README.md

O Operator
Diff

/var/www/vhosts/3dshawn.com/site1/README.md

modified on local at 2026-07-11 19:38:28

Added
+1
lines
Removed
-0
lines
Context
169
unchanged
Blobs
from 3fdb8f6a2875
to b7628512be54
Restore this content →
Unified diff
Naive LCS-based line diff. Additions in emerald, deletions in rose. Both sides decompressed live from BLOB_STORE.
11# DriftSense
22
33**Silent safety net for code + schema drift.** Automatic change capture across files, database schemas, and containers -- no workflow discipline required, no commits ahead of time, restorable to any moment.
44
55---
66
77## What it does
88
99- Watches configured filesystem paths, captures every change as a diff + full-file snapshot
1010- Watches configured MySQL/MariaDB databases, captures every DDL change (schema drift)
1111- Watches Docker containers via host-side OverlayFS inspection -- no in-container agent
1212- Deduplicates and gzip-compresses all snapshots (content-addressable storage)
1313- Lets the operator retroactively **name a moment** ("before the schema refactor") and pin its snapshots forever
1414- Restore any file or schema back to any captured moment
1515- Emails when things change in a way the operator flagged as noteworthy
1616
1717## Positioning
1818
1919Not competing with git. Aimed at teams and solos that **don't have git discipline** or where changes happen outside version control:
2020
2121- WordPress / PHP / Perl shops editing files directly on prod
2222- Agencies inheriting client codebases with no VCS at all
2323- Sysadmins protecting `/etc/` configs across a fleet
2424- Small teams where junior devs sometimes forget to commit
2525- Compliance-driven orgs needing audit trails of *all* changes, not just intentional commits
2626
2727The pitch: *"You don't have to change how your team works. It watches. It captures. It's there when you need it."*
2828
2929## Business model
3030
3131**Install-and-run, self-hosted.** One-time license + optional update sub. Never SaaS -- customer code + DB schemas + file contents stay entirely on customer infrastructure. Zero data on our servers, zero liability, deployable to air-gapped environments.
3232
3333- v1: $99-499 license (single server) + $10-25/mo optional update sub
3434- v2: Team tier (multi-server + K8s DaemonSet) at higher price
3535- v3: Enterprise tier (compliance reporting bundle) six-figure territory
3636
3737## Architecture
3838
3939```
4040Single-server: [ agent | storage | web UI ] <- one tarball, customer's box
4141 |
4242 v
4343 customer's MariaDB (or SQLite fallback)
4444
4545Multi-server: [ agent ] --HMAC HTTP--> [ central: storage | web UI ]
4646 [ agent ] --HMAC HTTP--> |
4747 [ agent ] --HMAC HTTP--> customer's MariaDB
4848 (customer-owned central node)
4949```
5050
5151HMAC-signed HTTP ingest between agents and central node (same pattern as the portfolio's `support_meta_send.cgi`). All traffic stays inside customer's private network.
5252
5353**Container awareness (Tier 2, v1):**
5454- Host-side OverlayFS reader (`/var/lib/docker/overlay2/<id>/diff/`)
5555- Docker API for container enumeration + name mapping
5656- Zero agent-in-container, zero container privilege escalation
5757
5858## Project layout
5959
6060```
6161_Claude_DriftSense/
6262 _config/
6363 drift_sense.conf.example # installer template, key=value pairs
6464 _schema/
6565 drift_sense_v2_schema.sql # fresh install DDL
6666 MODS/
6767 Config.pm # reads /etc/drift_sense/drift_sense.conf + defaults
6868 DBConnect.pm # unified portfolio version, MySQL or SQLite
6969 Template.pm # portfolio's current template engine
7070 PageWrapper.pm # page shell (sidebar + topbar + body injection)
7171 Urls.pm # URL registry
7272 Mail.pm # SMTP alerts (v1 stub, upgraded in migration)
7373 RandCode.pm # random alphanumeric helper
7474 TEMPLATES/
7575 page_wrapper.html # app shell (sidebar, topbar)
7676 dashboard.html # dashboard content
7777 ... (per-page templates)
7878 assets/
7979 styles/
8080 drift_sense.css # design system (midnight navy + teal + amber)
8181 dashboard.cgi # modernized proof-of-concept
8282 _schema_monitor.cgi # DB schema polling daemon (v1 name: httpd)
8383 _file_monitor.cgi # filesystem walker daemon (v1 name: bash)
8484 ... (per-page CGIs)
8585```
8686
8787## Palette (design language)
8888
8989- **Backgrounds**: deep midnight navy (`#030710` -> `#131e30`)
9090- **Primary accent**: teal (`#14b8a6`) -- "sense" color, precision instrument feel
9191- **Amber**: drift alerts (`#f59e0b`)
9292- **Rose**: critical / danger (`#f43f5e`)
9393- **Emerald**: clean baseline / OK (`#34d399`)
9494- **Sky-blue**: info notices (`#38bdf8`)
9595
9696Distinct from every portfolio site (Meta-Admin wine, CF cyan, PT burgundy, etc.) so nobody confuses this product with an internal tool.
9797
9898## Roadmap
9999
100100### v1 -- Foundation (in progress)
101101- [x] Standalone workspace copied out of `system_monitor`
102102- [x] `MODS::Config` reads external conf file with code defaults
103103- [x] `MODS::DBConnect` unified version (`$sth->finish`, timezone, utf8mb4, MySQL + SQLite)
104104- [x] `MODS::Template` copied from portfolio (current 571-line version)
105105- [x] `MODS::PageWrapper` modernized
106106- [x] `MODS::Urls` refactored for product install paths
107107- [x] v2 schema draft: BLOB_STORE, NAMED_RELEASES, SERVERS, AGENT_UPLOADS, CONTAINER_TARGETS, CONFIG_DRIFT_BASELINES + FILE_CHANGES/SCHEMA_CHANGE column adds
108108- [x] Palette (midnight navy + teal + amber) as reusable CSS
109109- [x] `TEMPLATES/page_wrapper.html` -- new sidebar + topbar
110110- [x] `dashboard.cgi` + `dashboard.html` -- modernized proof-of-concept
111111- [ ] Rewrite remaining CGIs (file_changes, schema_changes, table_locks, databases, file_monitors, servers, containers, settings)
112112- [ ] Rewrite daemons (`_schema_monitor.cgi`, `_file_monitor.cgi`) to use unified DBConnect + write to BLOB_STORE with content-addressable dedup
113113- [ ] Implement **named releases** feature (bookmark + auto-purge exemption)
114114- [ ] Implement **point-in-time restore** UI (pick date, download file / restore schema DDL)
115115- [ ] Implement **auto-purge past N days** cron
116116- [ ] Implement **timestamp-only change suppression**
117117- [ ] Implement **missing-INT PK gap detection** (Shawn's own note -- detect table deletes)
118118- [ ] Diff viewer with syntax highlighting
119119- [ ] SMTP alerts on rule-matching changes
120120
121121### v1 packaging
122122- [ ] `install.sh` -- interactive installer (asks for MySQL creds or falls back to SQLite)
123123- [ ] systemd unit files for the two daemons
124124- [ ] `/etc/cron.d/` entry for auto-purge
125125- [ ] Landing page
126126- [ ] Documentation site
127127
128128### v2 -- Container awareness
129129- [ ] Docker API integration (enumerate containers, map to overlay2 dirs)
130130- [ ] OverlayFS `upper` reader -- captures inside-container file changes from host
131131- [ ] Container drift baselines + alerts
132132- [ ] Docker Compose config monitoring
133133- [ ] `docker-compose.yml` and `Dockerfile` change capture
134134
135135### v2 -- Multi-server
136136- [ ] Agent binary (lightweight, calls the same OverlayFS + FS walker)
137137- [ ] Agent registration flow (installer generates HMAC secret + agent config)
138138- [ ] `/api/ingest_file.cgi`, `/api/ingest_sql.cgi`, `/api/heartbeat.cgi` -- HMAC-signed endpoints
139139- [ ] Central dashboard filters by server / container / cluster
140140
141141### v3 -- Kubernetes + Enterprise
142142- [ ] K8s DaemonSet install (one pod per node, reads that node's overlay2)
143143- [ ] K8s API integration (watch ConfigMaps, Secrets, Deployments as first-class objects)
144144- [ ] Cross-environment aggregation ("this config changed in staging AND prod within 24h")
145145- [ ] Compliance reporting bundle (SOX/HIPAA/PCI-DSS/SOC 2 audit trail exports)
146146
147147## Install (targeted UX)
148148
149149```sh
150150$ curl -sSL https://driftsense.com/install.sh | sudo bash
151151[?] MySQL detected. Use existing MariaDB at localhost? [Y/n]
152152[?] MySQL user for DriftSense (will be created if missing): drift_sense
153153[?] Web UI port: [8080]
154154[?] Auto-configure common watch paths (/var/www, /etc, /etc/cron.d)? [Y/n]
155155
156156Installing systemd units... done
157157Applying schema... done
158158Starting drift_sense_schema.service... done
159159Starting drift_sense_files.service... done
160160
161161DriftSense is running.
162162UI: http://localhost:8080/
163163Log: journalctl -u drift_sense_* -f
164164
165165First captured change should appear in the UI within 60 seconds.
166166```
167167
168168Target: `install.sh -> first captured change visible in the UI < 5 minutes.`
169169# canary
170# canary again