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 23:13:08

Added
+13
lines
Removed
-1
lines
Context
70
unchanged
Blobs
from 86412f5a12a9
to f0d3fd00cca5
Restore this content →
Unified diff
Naive LCS-based line diff. Additions in emerald, deletions in rose. Both sides decompressed live from BLOB_STORE.
11<div class="page-head">
22 <span class="page-eyebrow"><span class="dot"></span> Configure</span>
33 <h1 class="page-title">File monitors</h1>
44 <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>
55</div>
66
77<div class="ds-guide">
88 <div class="dsg-icon">i</div>
99 <div>
1010 <span class="dsg-title">Getting started:</span>
1111 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 &mdash; 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 &quot;keep /etc/nginx forever, keep /tmp for 7 days&quot;. Blank / 0 = use the global default (typically 90)."></span> to override the global purge window for this scan target.
1212 </div>
1313</div>
1414
1515<div class="module glow-teal" style="margin-bottom:16px">
1616 <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>
1717 <div class="module-body">
1818 <form method="post" action="/file_monitors.cgi" style="display:grid;grid-template-columns:1fr 2fr 1fr 130px 120px;gap:10px;align-items:end">
1919 <input type="hidden" name="save" value="1">
2020 <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>
2121 <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>
2222 <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>
2323 <div>
2424 <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>
2525 <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">
2626 <option value="">Global default</option>
2727 <option value="7">7 days</option>
2828 <option value="30">30 days</option>
2929 <option value="90">90 days</option>
3030 <option value="180">180 days</option>
3131 <option value="365">1 year</option>
3232 <option value="1825">5 years (regulated)</option>
3333 </select>
3434 </div>
3535 <button type="submit" class="btn">Add scan</button>
3636 </form>
3737 </div>
3838</div>
3939
4040<div class="module glow-teal">
4141 <div class="module-head"><div class="left"><div class="module-title">Configured scans</div><span class="module-subtitle">$total configured.</span></div></div>
4242 <div class="module-body tight">
4343 [if:$has_rows]
4444 <table class="tbl">
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>
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:200px">Quiet hours <span class="ds-help" data-help-title="Quiet hours" data-help-body="Alert dispatch skips this monitor during the configured window. Useful for known deploy times when file drift is expected and you don't want the page. Blank = never quiet."></span></th><th style="width:150px">Last scanned</th></tr></thead>
4646 <tbody>
4747 [loop:@rows]
4848 <tr>
4949 <td class="mono dim">$id</td>
5050 <td><strong>$scan_name</strong><div class="mono dim" style="font-size:11.5px">$scan_path</div></td>
5151 <td class="mono dim" style="font-size:11.5px">$ignore_preview</td>
5252 <td><span class="pill $status_pill">$status_lbl</span></td>
5353 <td>
5454 <form method="post" action="/file_monitors.cgi" style="display:flex;gap:4px;align-items:center">
5555 <input type="hidden" name="update_retention" value="1">
5656 <input type="hidden" name="mid" value="$id">
5757 <input type="number" name="retention_days" value="$retention_days" min="0"
5858 title="Blank / 0 = fall back to global retention_days"
5959 style="width:60px;background:var(--bg-1);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:3px 6px;font-size:11px">
60 <button type="submit" class="tr-chip" style="padding:2px 6px;font-size:10.5px">Save</button>
61 </form>
62 </td>
63 <td>
64 <form method="post" action="/file_monitors.cgi" style="display:flex;gap:3px;align-items:center">
65 <input type="hidden" name="update_quiet_hours" value="1">
66 <input type="hidden" name="mid" value="$id">
67 <input type="time" name="quiet_hours_start" value="$quiet_hours_start" title="Start"
68 style="width:70px;background:var(--bg-1);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:3px 4px;font-size:11px">
69 <span class="dim" style="font-size:10px">-</span>
70 <input type="time" name="quiet_hours_end" value="$quiet_hours_end" title="End"
71 style="width:70px;background:var(--bg-1);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:3px 4px;font-size:11px">
6072 <button type="submit" class="tr-chip" style="padding:2px 6px;font-size:10.5px">Save</button>
6173 </form>
6274 </td>
6375 <td class="mono dim">$last_h</td>
6476 </tr>
6577 [/loop]
6678 </tbody>
6779 </table>
6880 [/if]
6981 [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]
7082 </div>
7183</div>
Keyboard: j next diff k previous diff g top G bottom r restore c compile-check ? help