Diff -- /var/www/vhosts/3dshawn.com/site1/TEMPLATES/broadcast.html
Diff

/var/www/vhosts/3dshawn.com/site1/TEMPLATES/broadcast.html

added on local at 2026-07-13 19:47:07

Added
+173
lines
Removed
-0
lines
Context
0
unchanged
Blobs
from
to e2ed52da06da
Restore this content →
Unified diff
Naive LCS-based line diff. Additions in emerald, deletions in rose. Both sides decompressed live from BLOB_STORE.
1<div class="page-head">
2 <span class="page-eyebrow"><span class="dot"></span> Cross-portfolio</span>
3 <h1 class="page-title">Broadcast a captured file to other sites</h1>
4 <p class="page-subtitle">Take one file that DriftSense already captured on one site and write those exact bytes to the same path on any set of your other monitored sites. Turns "there's drift" into "there's a fix" in one click.</p>
5</div>
6
7[if:!$did_broadcast][if:!$has_error]
8<div class="ds-guide">
9 <div class="dsg-icon">i</div>
10 <div>
11 <span class="dsg-title">New here? What Broadcast does + when to use it</span>
12 <p style="margin:6px 0 10px;color:var(--text-dim);font-size:12.5px;line-height:1.6">
13 Every file DriftSense has ever captured lives in <code>BLOB_STORE</code> keyed by SHA-256. <strong>Broadcast</strong> lets you grab one of those captured versions and write those exact bytes to the same file path on other sites you monitor. It's the fastest way to <em>sync a fix across your whole portfolio</em> when the same file lives on multiple sites and one of them has the "canonical" version.
14 </p>
15
16 <div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(240px, 1fr));gap:10px;margin:12px 0">
17 <div style="padding:10px 12px;background:var(--bg-2);border:1px solid var(--border);border-radius:8px">
18 <div style="font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--accent-hi);font-weight:700;margin-bottom:4px">Common use cases</div>
19 <ul style="margin:0;padding-left:18px;font-size:12px;color:var(--text-dim);line-height:1.55">
20 <li>Divergence spotted on <a href="/portfolio_drift.cgi">Portfolio drift</a> &mdash; push the good copy to the drifted sites</li>
21 <li>Fixed a bug on Site A, need the same fix on Sites B/C/D that share the file</li>
22 <li>Rolled out a new <code>.htaccess</code>, config, or template across the portfolio</li>
23 <li>Onboarding a new site: copy shared config from an established sibling</li>
24 </ul>
25 </div>
26 <div style="padding:10px 12px;background:var(--bg-2);border:1px solid var(--border);border-radius:8px">
27 <div style="font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--accent-hi);font-weight:700;margin-bottom:4px">How it works &mdash; 3 steps</div>
28 <ol style="margin:0;padding-left:18px;font-size:12px;color:var(--text-dim);line-height:1.55">
29 <li><strong>Pick a source</strong> &mdash; any captured file. Click "Use as source" in the list below, or jump from any <a href="/file_changes.cgi">file changes</a> row.</li>
30 <li><strong>Pick targets</strong> &mdash; tick the monitored sites you want to receive the file. Target path defaults to same basename inside each site's scan_path, override per row if needed.</li>
31 <li><strong>Confirm</strong> &mdash; DriftSense runs a compile-check on the shared bytes, backs up the current file on each target, writes, verifies the SHA post-write, and logs everything to <code>RESTORE_LOG</code>.</li>
32 </ol>
33 </div>
34 <div style="padding:10px 12px;background:rgba(52,211,153,.05);border:1px solid rgba(52,211,153,.25);border-radius:8px">
35 <div style="font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--accent-ok);font-weight:700;margin-bottom:4px">Safety guardrails</div>
36 <ul style="margin:0;padding-left:18px;font-size:12px;color:var(--text-dim);line-height:1.55">
37 <li><strong>Compile-check preflight</strong> once on the shared bytes &mdash; blocks the whole batch if the source has a syntax error, unless you tick "force override"</li>
38 <li><strong>Path safety</strong>: target must sit under the target monitor's <code>scan_path</code> &mdash; can't broadcast into <code>/etc/passwd</code></li>
39 <li><strong>Per-target backup file</strong> written before overwrite: <code>&lt;path&gt;.drift_restore_backup_&lt;epoch&gt;</code></li>
40 <li><strong>SHA verify</strong> post-write on every target; mismatches fail the row (backup still safe)</li>
41 <li>Every attempt &mdash; success or fail &mdash; lands in <a href="/purge_log.cgi">RESTORE_LOG</a> for the audit trail</li>
42 </ul>
43 </div>
44 </div>
45
46 <p style="margin:0;font-size:11.5px;color:var(--text-muted);line-height:1.5">
47 <strong style="color:var(--text-dim)">Not what you want?</strong>
48 To restore a file to an <em>earlier version on the same site</em>, use <a href="/file_bio.cgi">File biography</a> &rarr; pick a moment &rarr; Restore.
49 To push an entire <em>named release</em> back to production, use <a href="/named_releases.cgi">Named releases</a> &rarr; "Restore all pinned to this stable version".
50 </p>
51 </div>
52</div>
53[/if][/if]
54
55[if:$has_error]
56<div class="module glow-rose">
57 <div class="module-head"><div class="left">
58 <div class="module-title">Broadcast blocked</div>
59 <span class="module-subtitle">Nothing was written.</span>
60 </div></div>
61 <div class="module-body">$error_msg</div>
62</div>
63[/if]
64
65[if:$did_broadcast]
66<div class="module [if:$fail_count]glow-warn[/if][if:!$fail_count]glow-emerald[/if]">
67 <div class="module-head"><div class="left">
68 <div class="module-title">Broadcast complete &mdash; $ok_count success[if:$fail_count], $fail_count failed[/if]</div>
69 <span class="module-subtitle">Source: <code>$source_file</code> from <strong>$source_scan</strong>, SHA <code>$source_sha</code></span>
70 </div></div>
71 <div class="module-body tight">
72 <table class="tbl">
73 <thead><tr><th>Target monitor</th><th>Target path</th><th>Status</th><th>Detail</th></tr></thead>
74 <tbody>
75 [loop:@results]
76 <tr>
77 <td><strong>$mname</strong></td>
78 <td class="mono dim" style="font-size:11.5px">$tgt</td>
79 <td>[if:$ok]<span class="pill pill-ok">success</span>[/if][if:!$ok]<span class="pill pill-bad">failed</span>[/if]</td>
80 <td class="mono dim" style="font-size:11px">$message</td>
81 </tr>
82 [/loop]
83 </tbody>
84 </table>
85 <div style="margin-top:14px">
86 <a href="/broadcast.cgi" class="tr-chip">Another broadcast</a>
87 <a href="/portfolio_drift.cgi" class="tr-chip">Check drift status</a>
88 </div>
89 </div>
90</div>
91[/if]
92
93[if:!$did_broadcast][if:!$has_error]
94
95[if:!$has_src]
96<div class="module glow-teal">
97 <div class="module-head"><div class="left">
98 <div class="module-title">Pick a source</div>
99 <span class="module-subtitle">The bytes you want to broadcast. Usually the "canonical" site's copy of a file that's now divergent elsewhere. Recent captures below, or paste a source ID: <code>?src_id=N</code>.</span>
100 </div></div>
101 <div class="module-body tight">
102 [if:$has_recent]
103 <table class="tbl">
104 <thead><tr><th>File</th><th>Site</th><th style="width:100px">Captured</th><th style="width:100px"></th></tr></thead>
105 <tbody>
106 [loop:@recent]
107 <tr>
108 <td class="mono" style="font-size:11.5px">$file_name_h</td>
109 <td>$scan_name <span class="dim">on $server_name</span></td>
110 <td class="mono dim" style="font-size:11px"><span class="ts" data-ts="$ts_epoch" data-fmt="relative"></span></td>
111 <td><a href="$pick_url" class="tr-chip">Use as source</a></td>
112 </tr>
113 [/loop]
114 </tbody>
115 </table>
116 [/if]
117 [if:!$has_recent]<p class="dim" style="padding:12px 0">No captures available. Configure a file monitor first.</p>[/if]
118 </div>
119</div>
120[/if]
121
122[if:$has_src]
123<div class="module glow-teal" style="margin-bottom:16px">
124 <div class="module-head"><div class="left">
125 <div class="module-title">Source: <code>$src_file</code></div>
126 <span class="module-subtitle">From <strong>$src_scan</strong> on $src_server &middot; blob SHA <code>$src_sha_full</code></span>
127 </div></div>
128</div>
129
130<form method="post" action="/broadcast.cgi">
131 <input type="hidden" name="src_id" value="$src_id">
132 <input type="hidden" name="confirm" value="1">
133
134 <div class="module">
135 <div class="module-head"><div class="left">
136 <div class="module-title">Targets</div>
137 <span class="module-subtitle">Pick the monitors that should receive this file. Target path defaults to the source basename inside each monitor's scan_path &mdash; override per-row if needed. The source monitor is excluded by default (broadcasting to yourself is a no-op).</span>
138 </div></div>
139 <div class="module-body tight">
140 <table class="tbl">
141 <thead><tr><th style="width:40px">&nbsp;</th><th>Monitor</th><th style="width:120px">Kind</th><th>Target path</th></tr></thead>
142 <tbody>
143 [loop:@monitors]
144 <tr>
145 <td><input type="checkbox" name="target_mid" value="$mid" [if:!$is_source]checked[/if] [if:$is_source]disabled[/if]></td>
146 <td><strong>$scan_name</strong> <span class="dim">on $server_name</span>[if:$is_source] <span class="pill pill-mute" style="font-size:10px">source</span>[/if]</td>
147 <td class="mono dim">$server_kind</td>
148 <td><input type="text" name="target_path_$mid" value="$default_target" [if:$is_source]disabled[/if]
149 style="width:100%;background:var(--bg-1);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:5px 8px;font-family:var(--mono);font-size:11.5px"></td>
150 </tr>
151 [/loop]
152 </tbody>
153 </table>
154 </div>
155 </div>
156
157 <div class="module glow-rose" style="margin-top:16px">
158 <div class="module-head"><div class="left">
159 <div class="module-title">Confirm broadcast</div>
160 <span class="module-subtitle">Preflight compile-check runs once on the source bytes before any write. If it fails, tick "force override" to broadcast anyway.</span>
161 </div></div>
162 <div class="module-body" style="display:flex;gap:12px;align-items:center;flex-wrap:wrap">
163 <button type="submit" class="tr-chip is-active" style="border:none;padding:9px 22px;background:var(--accent-danger);border-color:var(--accent-danger);color:#fff">Broadcast to selected sites</button>
164 <a href="/broadcast.cgi" class="tr-chip">Cancel</a>
165 <label style="display:flex;gap:6px;align-items:center;color:var(--accent-danger-hi);font-size:12.5px;cursor:pointer">
166 <input type="checkbox" name="force_override" value="1"> Force override preflight
167 </label>
168 </div>
169 </div>
170</form>
171[/if]
172
173[/if][/if]
Keyboard: j next diff k previous diff g top G bottom r restore c compile-check ? help