Diff -- /var/www/vhosts/3dshawn.com/site1/logout.cgi
Diff

/var/www/vhosts/3dshawn.com/site1/logout.cgi

modified on local at 2026-07-12 23:13:00

Added
+0
lines
Removed
-0
lines
Context
67
unchanged
Blobs
from 07ddfceeaef5
to 07ddfceeaef5
Restore this content →
Unified diff
Naive LCS-based line diff. Additions in emerald, deletions in rose. Both sides decompressed live from BLOB_STORE.
11#!/usr/bin/perl
22#======================================================================
33# DriftSense -- /logout.cgi
44#
55# Ends the operator session. DriftSense doesn't have a full auth flow
66# yet (single-operator install, browser is scoped by the vhost's basic-
77# auth or dev-mode "Operator" default), so this is intentionally minimal:
88# - clears any DriftSense cookies
99# - shows a "signed out" landing with a link back to /dashboard.cgi
1010#
1111# When we wire real sessions (WATCHTOWER_SESSIONS table), invalidate the
1212# session_id here before rendering.
1313#======================================================================
1414use strict;
1515use warnings;
1616use CGI ();
1717use MODS::Config; use MODS::Template; use MODS::PageWrapper;
1818
1919my $cgi = CGI->new;
2020my $tpl = MODS::Template->new;
2121$|=1;
2222
2323# Clear the (currently-notional) DriftSense cookies. Belt-and-suspenders --
2424# name each one we've ever set; missing ones are no-ops on the browser side.
2525print "Content-Type: text/html; charset=utf-8\n";
2626print "Cache-Control: no-store, no-cache, must-revalidate, max-age=0\n";
2727print "Pragma: no-cache\nExpires: 0\n";
2828foreach my $c (qw(ds_session ds_op_id ds_op_name)) {
2929 print "Set-Cookie: $c=; Path=/; Max-Age=0; HttpOnly; SameSite=Lax\n";
3030}
3131print "\n";
3232
3333my $body = <<'BODY';
3434<div style="max-width:520px;margin:8vh auto;text-align:center">
3535 <div style="width:64px;height:64px;margin:0 auto 20px;border-radius:16px;background:linear-gradient(135deg,var(--accent),var(--accent-deep));display:grid;place-items:center;box-shadow:0 8px 30px var(--accent-glow)">
3636 <svg viewBox="0 0 24 24" width="28" height="28" fill="none" stroke="#030710" stroke-width="2.2"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/></svg>
3737 </div>
3838 <h1 style="font-size:22px;font-weight:700;margin:0 0 8px;letter-spacing:-.02em">You're signed out.</h1>
3939 <p style="color:var(--text-dim);font-size:14px;margin:0 0 24px">Session ended cleanly. All DriftSense cookies cleared from this browser.</p>
4040 <div style="display:flex;gap:10px;justify-content:center">
4141 <a href="/dashboard.cgi" class="tr-chip is-active" style="border:none;padding:9px 22px">Sign back in</a>
4242 <a href="/" class="tr-chip">Watchtower home</a>
4343 </div>
4444 <p class="dim" style="font-size:11.5px;margin-top:36px">
4545 DriftSense wave 6+ uses a shared operator seat &mdash; wave 7+ will introduce per-user sessions with real auth.
4646 </p>
4747</div>
4848BODY
4949
5050my @body = $tpl->template('page_wrapper.html', {
5151 page_title => 'Signed out',
5252 brand_name => 'DriftSense',
5353 brand_tagline => 'Silent safety net for code + schema drift',
5454 asset_version => time(),
5555 page_body => $body,
5656 user_name => 'Operator',
5757 user_email => '',
5858 user_initials => '?',
5959 sites => [], has_sites => 0, sites_ct => 0,
6060 stable_releases => [], has_stables => 0, stables_ct => 0,
6161 (map { ("active_$_" => 0) } qw(dashboard file_changes schema_changes table_locks
6262 named_releases alerts export purge_log sites databases
6363 file_monitors servers containers settings search
6464 portfolio_drift)),
6565});
6666print @body;
6767exit;
Keyboard: j next diff k previous diff g top G bottom r restore c compile-check ? help