Diff -- /var/www/vhosts/3dshawn.com/site1/TEMPLATES/file_monitors.html
Diff
/var/www/vhosts/3dshawn.com/site1/TEMPLATES/file_monitors.html
modified on local at 2026-07-12 00:48:55
Added
+12
lines
Removed
-1
lines
Context
59
unchanged
Blobs
from e0a761b81d16
to 86412f5a12a9
to 86412f5a12a9
Unified diff
Naive LCS-based line diff. Additions in emerald, deletions in rose. Both sides decompressed live from BLOB_STORE.| 1 | 1 | <div class="page-head"> |
| 2 | 2 | <span class="page-eyebrow"><span class="dot"></span> Configure</span> |
| 3 | 3 | <h1 class="page-title">File monitors</h1> |
| 4 | 4 | <p class="page-subtitle">Filesystem paths DriftSense should watch. Each scan is captured with SHA-256 content dedup + gzip compression -- history costs single-digit MB per repo per year even for actively-developed code.</p> |
| 5 | 5 | </div> |
| 6 | 6 | |
| 7 | 7 | <div class="ds-guide"> |
| 8 | 8 | <div class="dsg-icon">i</div> |
| 9 | 9 | <div> |
| 10 | 10 | <span class="dsg-title">Getting started:</span> |
| 11 | 11 | Point one at a source directory (e.g. <code>/var/www</code>) or a config dir (<code>/etc/nginx</code>). The scanner uses an <strong>mtime-first</strong> optimization<span class="ds-help" data-help-title="What's mtime-first?" data-help-body="For each file the scanner does a cheap <code>stat()</code> and compares mtime to the last-captured version. Only files with a newer mtime get hashed. A 10 GB codebase with a hundred edits per day scans in a few seconds this way — the vast majority of files never even get opened."></span> so a 10 GB codebase scans in seconds. Set <strong>Retention (days)</strong><span class="ds-help" data-help-title="Per-monitor retention" data-help-body="Overrides the global <code>retention_days</code> config for THIS monitor's blobs. Great for "keep /etc/nginx forever, keep /tmp for 7 days". Blank / 0 = use the global default (typically 90)."></span> to override the global purge window for this scan target. |
| 12 | 12 | </div> |
| 13 | 13 | </div> |
| 14 | 14 | |
| 15 | 15 | <div class="module glow-teal" style="margin-bottom:16px"> |
| 16 | 16 | <div class="module-head"><div class="left"><div class="module-title">Add a scan target</div><span class="module-subtitle">Common presets: /var/www (web root), /etc (system configs), /etc/cron.d (scheduled jobs), /usr/local/etc (app configs)</span></div></div> |
| 17 | 17 | <div class="module-body"> |
| 18 | 18 | <form method="post" action="/file_monitors.cgi" style="display:grid;grid-template-columns:1fr 2fr 1fr 130px 120px;gap:10px;align-items:end"> |
| 19 | 19 | <input type="hidden" name="save" value="1"> |
| 20 | 20 | <div><label class="dim" style="display:block;font-size:10.5px;letter-spacing:1.4px;text-transform:uppercase;font-weight:700;margin-bottom:5px">Scan name</label><input type="text" name="scan_name" required placeholder="e.g. Web root"></div> |
| 21 | 21 | <div><label class="dim" style="display:block;font-size:10.5px;letter-spacing:1.4px;text-transform:uppercase;font-weight:700;margin-bottom:5px">Path</label><input type="text" name="scan_path" required placeholder="/var/www"></div> |
| 22 | 22 | <div><label class="dim" style="display:block;font-size:10.5px;letter-spacing:1.4px;text-transform:uppercase;font-weight:700;margin-bottom:5px">File types</label><input type="text" name="file_type_filter" placeholder=".php,.pl,.conf"></div> |
| 23 | <div><label class="dim" style="display:block;font-size:10.5px;letter-spacing:1.4px;text-transform:uppercase;font-weight:700;margin-bottom:5px">Retention (days)</label><input type="number" name="retention_days" min="0" placeholder="blank = global"></div> | |
| 23 | <div> | |
| 24 | <label class="dim" style="display:block;font-size:10.5px;letter-spacing:1.4px;text-transform:uppercase;font-weight:700;margin-bottom:5px">Retention</label> | |
| 25 | <select name="retention_days" style="background:var(--bg-1);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:8px 12px;font-size:12.5px"> | |
| 26 | <option value="">Global default</option> | |
| 27 | <option value="7">7 days</option> | |
| 28 | <option value="30">30 days</option> | |
| 29 | <option value="90">90 days</option> | |
| 30 | <option value="180">180 days</option> | |
| 31 | <option value="365">1 year</option> | |
| 32 | <option value="1825">5 years (regulated)</option> | |
| 33 | </select> | |
| 34 | </div> | |
| 24 | 35 | <button type="submit" class="btn">Add scan</button> |
| 25 | 36 | </form> |
| 26 | 37 | </div> |
| 27 | 38 | </div> |
| 28 | 39 | |
| 29 | 40 | <div class="module glow-teal"> |
| 30 | 41 | <div class="module-head"><div class="left"><div class="module-title">Configured scans</div><span class="module-subtitle">$total configured.</span></div></div> |
| 31 | 42 | <div class="module-body tight"> |
| 32 | 43 | [if:$has_rows] |
| 33 | 44 | <table class="tbl"> |
| 34 | 45 | <thead><tr><th style="width:60px">#</th><th>Name / Path</th><th>Ignore</th><th style="width:100px">Status</th><th style="width:120px">Retention</th><th style="width:150px">Last scanned</th></tr></thead> |
| 35 | 46 | <tbody> |
| 36 | 47 | [loop:@rows] |
| 37 | 48 | <tr> |
| 38 | 49 | <td class="mono dim">$id</td> |
| 39 | 50 | <td><strong>$scan_name</strong><div class="mono dim" style="font-size:11.5px">$scan_path</div></td> |
| 40 | 51 | <td class="mono dim" style="font-size:11.5px">$ignore_preview</td> |
| 41 | 52 | <td><span class="pill $status_pill">$status_lbl</span></td> |
| 42 | 53 | <td> |
| 43 | 54 | <form method="post" action="/file_monitors.cgi" style="display:flex;gap:4px;align-items:center"> |
| 44 | 55 | <input type="hidden" name="update_retention" value="1"> |
| 45 | 56 | <input type="hidden" name="mid" value="$id"> |
| 46 | 57 | <input type="number" name="retention_days" value="$retention_days" min="0" |
| 47 | 58 | title="Blank / 0 = fall back to global retention_days" |
| 48 | 59 | style="width:60px;background:var(--bg-1);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:3px 6px;font-size:11px"> |
| 49 | 60 | <button type="submit" class="tr-chip" style="padding:2px 6px;font-size:10.5px">Save</button> |
| 50 | 61 | </form> |
| 51 | 62 | </td> |
| 52 | 63 | <td class="mono dim">$last_h</td> |
| 53 | 64 | </tr> |
| 54 | 65 | [/loop] |
| 55 | 66 | </tbody> |
| 56 | 67 | </table> |
| 57 | 68 | [/if] |
| 58 | 69 | [if:!$has_rows]<div style="padding:36px 14px;text-align:center;color:var(--text-dim)">No scans configured. Add one above to start capturing file changes.</div>[/if] |
| 59 | 70 | </div> |
| 60 | 71 | </div> |