fixed the server

This commit is contained in:
miles committed 2026-11-25 00:32:16 -06:00
1 parent 559d3ef89c
commit 4175ad5be6
10 files changed
+446 -125

No files matched your search

+4 -2
View File
@@ -28,12 +28,12 @@ can remain on its current host.
| Area | What it does | | Area | What it does |
| --- | --- | | --- | --- |
| Infrastructure | ICMP ping checks for `10.0.0.87` and `10.0.0.119`, HTTP health checks for five sites, uptime history, and honest network context | | Infrastructure | ICMP ping checks for Main Server (`192.168.50.102`) and Debian Server (`192.168.50.103`), HTTP health checks for five sites, uptime history, and honest network context |
| GitHub | Official REST API data for `mileswolfallen2` with server-side caching, ETags, rate-limit handling, and no token exposure | | GitHub | Official REST API data for `mileswolfallen2` with server-side caching, ETags, rate-limit handling, and no token exposure |
| FEDL | Real data from `https://server.fedl.site/fedl/api/list` and `/runs`, with snapshot diffs for additions, removals, and rank changes | | FEDL | Real data from `https://server.fedl.site/fedl/api/list` and `/runs`, with snapshot diffs for additions, removals, and rank changes |
| Analytics | Cookieless, IP-hash-only pageviews with bot filtering, deduplication, path normalization, and 30-day retention | | Analytics | Cookieless, IP-hash-only pageviews with bot filtering, deduplication, path normalization, and 30-day retention |
| Moon Vault | Argon2id passphrase verification, signed HttpOnly sessions, login rate limiting, logout, and server-gated content | | Moon Vault | Argon2id passphrase verification, signed HttpOnly sessions, login rate limiting, logout, and server-gated content |
| Dashboard | `/dashboard.html` renders every panel from the local API and labels unavailable data instead of inventing values | | Dashboard | `/dashboard.html` renders every panel from the local API, shows an outage page when a monitored server or the status API is offline, and supports a `#offline` preview |
## Requirements ## Requirements
@@ -76,6 +76,8 @@ npm run dev
Open <http://127.0.0.1:8787>. The dashboard is at Open <http://127.0.0.1:8787>. The dashboard is at
<http://127.0.0.1:8787/dashboard.html> and the vault lock page is at <http://127.0.0.1:8787/dashboard.html> and the vault lock page is at
<http://127.0.0.1:8787/moon-vault.html>. <http://127.0.0.1:8787/moon-vault.html>.
Preview the dashboard outage page at
<http://127.0.0.1:8787/dashboard.html#offline>.
For local development, use these overrides in `.env` so cookies work over For local development, use these overrides in `.env` so cookies work over
plain HTTP: plain HTTP:
+124
View File
@@ -326,6 +326,130 @@ button { font: inherit; }
.footer a { color: var(--muted); text-decoration: none; } .footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--accent); } .footer a:hover { color: var(--accent); }
.offline-page {
min-height: 100vh;
display: grid;
place-items: center;
padding: clamp(20px, 5vw, 64px);
background:
radial-gradient(ellipse at 50% 40%, rgba(255,77,109,.11), transparent 38%),
linear-gradient(145deg, rgba(255,255,255,.015), transparent 55%);
}
.offline-page[hidden] { display: none; }
.offline-shell { width: min(840px, 100%); }
.offline-topline, .offline-bottomline {
display: flex;
justify-content: space-between;
align-items: center;
gap: 18px;
font-family: var(--font-mono);
font-size: 9px;
letter-spacing: .1em;
text-transform: uppercase;
}
.offline-topline { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.offline-code { color: var(--red); }
.offline-content { max-width: 660px; margin: 0 auto; padding: clamp(44px, 8vw, 86px) 0 64px; }
.offline-art {
width: 76px;
height: 76px;
position: relative;
display: grid;
place-items: center;
margin-bottom: 34px;
}
.offline-art-orbit {
position: absolute;
inset: 3px;
border: 1px solid rgba(255,77,109,.42);
border-radius: 50%;
box-shadow: 0 0 34px rgba(255,77,109,.13), inset 0 0 28px rgba(255,77,109,.08);
}
.offline-art-core {
display: grid;
place-items: center;
width: 38px;
height: 38px;
border: 1px solid rgba(255,77,109,.65);
border-radius: 50%;
color: var(--red);
font: 700 22px var(--font-mono);
background: #100b10;
}
.offline-art-signal {
position: absolute;
width: 4px;
height: 4px;
border-radius: 50%;
background: var(--red);
box-shadow: 0 0 10px var(--red);
}
.signal-one { top: 5px; left: 36px; }
.signal-two { right: 7px; bottom: 20px; opacity: .6; }
.signal-three { left: 8px; bottom: 18px; opacity: .35; }
.offline-content .eyebrow { color: var(--red); }
.offline-content h1 {
font-family: var(--font-pixel);
font-size: clamp(25px, 5vw, 48px);
line-height: 1.45;
letter-spacing: -.04em;
}
.offline-content h1 span { color: var(--red); text-shadow: 3px 3px 0 rgba(255,77,109,.16); }
.offline-message { max-width: 570px; color: var(--muted); font-size: 15px; line-height: 1.8; margin-top: 18px; }
.offline-status-card {
display: flex;
align-items: flex-start;
gap: 15px;
margin-top: 32px;
padding: 18px 20px;
border: 1px solid rgba(255,77,109,.2);
background: linear-gradient(110deg, rgba(255,77,109,.075), rgba(12,12,19,.78) 65%);
}
.offline-status-card .status-dot { margin-top: 5px; }
.offline-status-card strong { display: block; font-size: 12px; }
.offline-status-card p { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.offline-status-code {
margin-left: auto;
color: var(--dim);
font: 9px/1.6 var(--font-mono);
letter-spacing: .08em;
text-align: right;
white-space: nowrap;
}
.offline-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.offline-button {
display: inline-flex;
min-height: 44px;
align-items: center;
justify-content: center;
padding: 0 18px;
border: 1px solid var(--line-strong);
color: var(--text);
font: 10px var(--font-mono);
letter-spacing: .08em;
text-decoration: none;
text-transform: uppercase;
transition: background .2s, border-color .2s, transform .2s;
}
.offline-button:hover { border-color: var(--red); transform: translateY(-2px); }
.offline-button.primary { border-color: var(--red); background: var(--red); color: #09070a; font-weight: 700; }
.offline-button.primary:hover { background: #ff7188; }
.offline-foot { margin-top: 20px; color: var(--dim); font: 9px/1.8 var(--font-mono); }
.offline-foot code { color: var(--muted); }
.offline-bottomline { padding-top: 16px; border-top: 1px solid var(--line); color: var(--dim); }
.offline-ellipsis { display: inline-block; width: 14px; overflow: hidden; vertical-align: bottom; animation: offline-dots 1.3s steps(4, end) infinite; }
@keyframes offline-dots { to { width: 0; } }
body.offline-mode { overflow-x: hidden; }
body.offline-mode .topbar { display: none; }
body.offline-mode .offline-page { position: relative; z-index: 1; }
@media (max-width: 600px) {
.offline-page { padding: 24px; }
.offline-content { padding: 48px 0; }
.offline-content h1 { font-size: clamp(23px, 8vw, 38px); }
.offline-status-code { display: none; }
.offline-bottomline { align-items: flex-start; flex-direction: column; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) { @media (prefers-reduced-motion: reduce) {
* { animation: none !important; transition: none !important; } * { animation: none !important; transition: none !important; }
html { scroll-behavior: auto; } html { scroll-behavior: auto; }
+238 -102
View File
@@ -3,86 +3,15 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Home Lab Maintenance | Miles Allen</title> <title>System Console | Miles Allen</title>
<meta name="description" content="Home server maintenance while a new router is set up in the home lab."> <meta name="description" content="Live infrastructure, GitHub, FEDL, analytics, and project status for milesallen.site.">
<meta name="robots" content="noindex, follow"> <meta name="robots" content="index, follow">
<link rel="icon" type="image/png" href="favicon.png"> <link rel="icon" type="image/png" href="favicon.png">
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Space+Mono:wght@400;700&family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Space+Mono:wght@400;700&family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<link rel="stylesheet" href="dashboard.css"> <link rel="stylesheet" href="dashboard.css">
<style> <script src="site-config.js"></script>
.maintenance-card {
max-width: 760px;
border: 1px solid var(--line);
border-left: 3px solid var(--amber);
background: var(--panel);
padding: clamp(24px, 5vw, 40px);
}
.maintenance-card .eyebrow {
color: var(--amber);
margin-bottom: 14px;
}
.maintenance-card h2 {
font-family: var(--font-pixel);
font-size: clamp(16px, 3vw, 22px);
line-height: 1.5;
margin-bottom: 16px;
}
.maintenance-card p,
.faq-card p {
color: var(--muted);
font-size: 14px;
line-height: 1.8;
}
.maintenance-details {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
gap: 12px;
max-width: 760px;
margin-top: 16px;
}
.maintenance-detail {
border: 1px solid var(--line);
background: rgba(255, 255, 255, .02);
padding: 18px 20px;
}
.maintenance-detail span {
display: block;
color: var(--dim);
font: 10px var(--font-mono);
letter-spacing: .1em;
text-transform: uppercase;
margin-bottom: 8px;
}
.maintenance-detail strong {
font-size: 13px;
font-weight: 500;
}
.faq-section {
max-width: 760px;
padding: 56px 0 0;
}
.faq-section h2 {
font-family: var(--font-pixel);
font-size: clamp(16px, 3vw, 22px);
margin-bottom: 18px;
}
.faq-card {
border: 1px solid var(--line);
background: var(--panel);
padding: 22px;
}
.faq-card h3 {
font-family: var(--font-mono);
font-size: 14px;
line-height: 1.7;
margin-bottom: 10px;
}
@media (max-width: 720px) {
.hero { padding-top: 42px; }
}
</style>
</head> </head>
<body> <body>
<div class="scanlines" aria-hidden="true"></div> <div class="scanlines" aria-hidden="true"></div>
@@ -94,49 +23,256 @@
<nav class="topnav" aria-label="Main navigation"> <nav class="topnav" aria-label="Main navigation">
<a href="index.html">Home</a> <a href="index.html">Home</a>
<a href="index.html#projects">Projects</a> <a href="index.html#projects">Projects</a>
<a href="https://github.com/mileswolfallen2" target="_blank" rel="noopener">GitHub</a>
<a href="#offline">Offline preview</a>
<button type="button" class="refresh-btn" id="refreshBtn" title="Refresh data">Refresh</button>
</nav> </nav>
</header> </header>
<main class="wrap"> <main class="wrap" id="dashboardMain">
<section class="hero"> <section class="hero">
<div class="hero-copy"> <div class="hero-copy">
<div class="eyebrow">// home lab / maintenance window</div> <div class="eyebrow">// live telemetry</div>
<h1>Home Server Maintenance</h1> <h1>System Console</h1>
<p class="hero-sub">I'm setting up a new router in my home lab. Some network-hosted services may be briefly unavailable while I get everything connected.</p> <p class="hero-sub">Infrastructure, development activity, FEDL, and traffic for milesallen.site. Everything on this page comes from the local backend API.</p>
</div>
<div class="hero-status">
<div class="overall-pill unknown" id="overallPill">
<span class="pulse" aria-hidden="true"></span>
<span id="overallText">Connecting</span>
</div>
<div class="hero-meta">
<span id="lastUpdated">Waiting for first check</span>
<span class="meta-sep">·</span>
<span id="refreshCountdown">auto-refresh 60s</span>
</div>
</div> </div>
</section> </section>
<section class="maintenance-card" aria-labelledby="maintenanceTitle"> <section class="stat-strip" aria-label="Key metrics">
<div class="eyebrow">Router setup in progress</div> <div class="stat-cell">
<h2 id="maintenanceTitle">A quick tune-up for the home network</h2> <div class="stat-label">Services up</div>
<p>The system dashboard is taking a break while I configure the new router. Thanks for your patience while the home lab gets settled.</p> <div class="stat-value" id="statServices">--</div>
<div class="stat-note" id="statServicesNote">website checks</div>
</div>
<div class="stat-cell">
<div class="stat-label">Servers up</div>
<div class="stat-value" id="statServers">--</div>
<div class="stat-note" id="statServersNote">home network</div>
</div>
<div class="stat-cell">
<div class="stat-label">GitHub stars</div>
<div class="stat-value" id="statStars">--</div>
<div class="stat-note" id="statStarsNote">tracked repos</div>
</div>
<div class="stat-cell">
<div class="stat-label">FEDL levels</div>
<div class="stat-value" id="statLevels">--</div>
<div class="stat-note" id="statLevelsNote">ranked</div>
</div>
<div class="stat-cell">
<div class="stat-label">Pageviews today</div>
<div class="stat-value" id="statViews">--</div>
<div class="stat-note" id="statViewsNote">privacy-friendly</div>
</div>
<div class="stat-cell">
<div class="stat-label">Visitors 30d</div>
<div class="stat-value" id="statVisitors">--</div>
<div class="stat-note" id="statVisitorsNote">daily hashes</div>
</div>
</section> </section>
<div class="maintenance-details" aria-label="Maintenance details"> <div class="notice" id="networkNotice" hidden></div>
<div class="maintenance-detail">
<span>Current task</span> <div class="grid">
<strong>Setting up a new router</strong> <section class="panel span-7" aria-labelledby="infraTitle">
</div> <div class="panel-head">
<div class="maintenance-detail"> <div>
<span>Possible impact</span> <div class="panel-kicker">01 / infrastructure</div>
<strong>Brief interruptions to home-hosted services</strong> <h2 id="infraTitle">Home servers</h2>
</div> </div>
<span class="panel-tag" id="networkTag">network unknown</span>
</div>
<div class="rows" id="serverRows">
<div class="skeleton-row"></div>
<div class="skeleton-row"></div>
</div>
</section>
<section class="panel span-5" aria-labelledby="servicesTitle">
<div class="panel-head">
<div>
<div class="panel-kicker">02 / websites</div>
<h2 id="servicesTitle">Service health</h2>
</div>
<a class="panel-link" href="#analytics">traffic →</a>
</div>
<div class="rows" id="serviceRows">
<div class="skeleton-row"></div>
<div class="skeleton-row"></div>
<div class="skeleton-row"></div>
</div>
</section>
<section class="panel span-7" aria-labelledby="githubTitle">
<div class="panel-head">
<div>
<div class="panel-kicker">03 / development</div>
<h2 id="githubTitle">GitHub activity</h2>
</div>
<a class="panel-link" id="githubProfileLink" href="https://github.com/mileswolfallen2" target="_blank" rel="noopener">profile →</a>
</div>
<div class="github-meta" id="githubMeta">
<div class="gh-stat"><span class="gh-num" id="ghPublicRepos">--</span><span class="gh-label">public repos</span></div>
<div class="gh-stat"><span class="gh-num" id="ghTracked">--</span><span class="gh-label">tracked</span></div>
<div class="gh-stat"><span class="gh-num" id="ghStars">--</span><span class="gh-label">stars</span></div>
<div class="gh-stat"><span class="gh-num" id="ghForks">--</span><span class="gh-label">forks</span></div>
</div>
<div class="chart-wrap">
<div class="chart-head"><span>30-day event activity</span><span id="githubRate"></span></div>
<div class="bar-chart" id="githubChart" role="img" aria-label="GitHub events over the last 30 days"></div>
</div>
<div class="split">
<div>
<h3 class="mini-title">Recent commits</h3>
<ul class="feed" id="commitFeed"><li class="empty">Loading GitHub data…</li></ul>
</div>
<div>
<h3 class="mini-title">Most active</h3>
<ul class="feed" id="repoActivity"><li class="empty">Loading repositories…</li></ul>
<h3 class="mini-title spaced">Languages</h3>
<div class="chips" id="languageChips"><span class="chip muted">—</span></div>
</div>
</div>
<p class="panel-foot" id="githubFoot">Data is cached server-side; the GitHub token never reaches the browser.</p>
</section>
<section class="panel featured" aria-labelledby="fedlTitle">
<div class="panel-head">
<div>
<div class="panel-kicker">04 / featured project</div>
<h2 id="fedlTitle">FEDL</h2>
</div>
<a class="panel-link" href="https://fedl.site" target="_blank" rel="noopener">fedl.site →</a>
</div>
<div class="fedl-hero">
<div class="fedl-big"><span id="fedlLevels">--</span><span class="fedl-unit">levels</span></div>
<div class="fedl-side">
<div><strong id="fedlRecords">--</strong><span>approved runs</span></div>
<div><strong id="fedlPlayers">--</strong><span>players</span></div>
<div><strong id="fedlSubmissions">--</strong><span>submissions</span></div>
</div>
</div>
<h3 class="mini-title">Top ranked</h3>
<ol class="rank-list" id="fedlTop"><li class="empty">Loading FEDL list…</li></ol>
<h3 class="mini-title spaced">Latest changes</h3>
<ul class="feed" id="fedlChanges"><li class="empty">No snapshot comparison yet.</li></ul>
<p class="panel-foot" id="fedlFoot">Source: the public FEDL API (/list and /runs).</p>
</section>
<section class="panel span-7" id="analytics" aria-labelledby="analyticsTitle">
<div class="panel-head">
<div>
<div class="panel-kicker">05 / traffic</div>
<h2 id="analyticsTitle">Analytics</h2>
</div>
<span class="panel-tag" id="analyticsRetention">30-day retention</span>
</div>
<div class="analytics-meta">
<div><strong id="viewsTotal">--</strong><span>total pageviews</span></div>
<div><strong id="viewsToday">--</strong><span>today</span></div>
<div><strong id="views7d">--</strong><span>7 days</span></div>
<div><strong id="visitors30d">--</strong><span>unique 30d</span></div>
</div>
<div class="chart-wrap">
<div class="chart-head"><span>Daily pageviews · 30 days</span><span id="analyticsPeak"></span></div>
<div class="bar-chart" id="analyticsChart" role="img" aria-label="Daily pageviews over the last 30 days"></div>
</div>
<div class="split">
<div>
<h3 class="mini-title">Most visited</h3>
<ul class="feed" id="topPages"><li class="empty">Loading analytics…</li></ul>
</div>
<div>
<h3 class="mini-title">Recent hits</h3>
<ul class="feed" id="recentHits"><li class="empty">Loading analytics…</li></ul>
</div>
</div>
<p class="panel-foot">No cookies, no raw IP addresses. Daily salted hashes only.</p>
</section>
<section class="panel span-5" aria-labelledby="projectsTitle">
<div class="panel-head">
<div>
<div class="panel-kicker">06 / registry</div>
<h2 id="projectsTitle">Project registry</h2>
</div>
<span class="panel-tag" id="projectCount">—</span>
</div>
<div class="project-grid" id="projectGrid">
<div class="skeleton-row"></div>
<div class="skeleton-row"></div>
<div class="skeleton-row"></div>
</div>
</section>
</div> </div>
<section class="faq-section" aria-labelledby="faqTitle">
<div class="eyebrow">A useful check</div>
<h2 id="faqTitle">FAQ</h2>
<div class="faq-card">
<h3>How do I know if the server is running?</h3>
<p>If you can reach this website, which runs on my home server, then the server is up. Most of my other services should be up too, though individual services can still have issues.</p>
</div>
</section>
<footer class="footer"> <footer class="footer">
<span>milesallen.site system console</span>
<span class="meta-sep">·</span>
<a href="index.html">back home</a> <a href="index.html">back home</a>
<span class="meta-sep">·</span> <span class="meta-sep">·</span>
<span>Home lab maintenance in progress</span> <a href="moon-vault.html">moon vault</a>
<span class="meta-sep">·</span>
<span>API status is honest: unknown means unknown.</span>
</footer> </footer>
</main> </main>
<main class="offline-page" id="offlinePage" hidden>
<div class="offline-shell">
<div class="offline-topline">
<a class="brand" href="index.html">
<span class="brand-mark" aria-hidden="true"></span>
<span class="brand-text">milesallen<span class="brand-dim">.site</span></span>
</a>
<span class="offline-code" id="offlineState">SERVER OFFLINE</span>
</div>
<section class="offline-content" aria-labelledby="offlineTitle" role="status" aria-live="polite">
<div class="offline-art" aria-hidden="true">
<span class="offline-art-orbit"></span>
<span class="offline-art-core">!</span>
<span class="offline-art-signal signal-one"></span>
<span class="offline-art-signal signal-two"></span>
<span class="offline-art-signal signal-three"></span>
</div>
<p class="eyebrow">connection interrupted / 503</p>
<h1 id="offlineTitle">The server is<br><span>taking a breather.</span></h1>
<p class="offline-message" id="offlineMessage">The status service can't be reached right now. It may be restarting or temporarily offline.</p>
<div class="offline-status-card">
<span class="status-dot bad" aria-hidden="true"></span>
<div>
<strong id="offlineStatusTitle">We’ll be back shortly</strong>
<p id="offlineStatusDetails">This page will check again automatically. Your visit and saved data are not affected.</p>
</div>
<span class="offline-status-code">SYSTEM<br>PAUSED</span>
</div>
<div class="offline-actions">
<button class="offline-button primary" id="offlineRetry" type="button">Try again</button>
<a class="offline-button" href="index.html">Back to home</a>
</div>
<p class="offline-foot">You can return to this preview any time with <code>#offline</code>.</p>
</section>
<div class="offline-bottomline">
<span>milesallen.site · system status</span>
<span>checking for a signal<span class="offline-ellipsis">...</span></span>
</div>
</div>
</main>
<script src="dashboard.js" defer></script>
</body> </body>
</html> </html>
+59 -3
View File
@@ -12,9 +12,37 @@
var countdown = REFRESH_SECONDS; var countdown = REFRESH_SECONDS;
var refreshing = false; var refreshing = false;
var hasLoaded = false; var hasLoaded = false;
var manualOfflinePreview = window.location.hash.toLowerCase() === '#offline';
var offlineReason = '';
var offlineMessage = '';
var $ = function (id) { return document.getElementById(id); }; var $ = function (id) { return document.getElementById(id); };
function syncOfflinePage() {
var offline = manualOfflinePreview || Boolean(offlineReason);
document.body.classList.toggle('offline-mode', offline);
$('dashboardMain').hidden = offline;
$('offlinePage').hidden = !offline;
var state = manualOfflinePreview
? 'PREVIEW MODE'
: offlineReason === 'server' ? 'SERVER OFFLINE' : 'API UNREACHABLE';
$('offlineState').textContent = state;
$('offlineMessage').textContent = manualOfflinePreview
? 'Preview mode is active. The server may be online; this page is here so you can check the outage design.'
: offlineMessage;
$('offlineStatusTitle').textContent = manualOfflinePreview ? 'Preview mode only' : 'We’ll be back shortly';
$('offlineStatusDetails').textContent = manualOfflinePreview
? 'This view is forced by #offline and will not change until you try again.'
: 'This page will check again automatically. Your visit and saved data are not affected.';
}
function setOfflineState(reason, message) {
offlineReason = reason;
offlineMessage = message;
syncOfflinePage();
}
function el(tag, className, text) { function el(tag, className, text) {
var node = document.createElement(tag); var node = document.createElement(tag);
if (className) node.className = className; if (className) node.className = className;
@@ -248,6 +276,13 @@
var status = await get('/status'); var status = await get('/status');
var servers = status.servers || []; var servers = status.servers || [];
var services = status.services || []; var services = status.services || [];
var offlineServers = servers.filter(function (server) { return server.status === 'offline'; });
if (offlineServers.length) {
var names = offlineServers.map(function (server) { return server.name; }).join(', ');
setOfflineState('server', names + (offlineServers.length === 1 ? ' is' : ' are') + ' not responding to recent health checks.');
} else {
setOfflineState('', '');
}
var overall = status.overall || {}; var overall = status.overall || {};
var tone = toneFor(overall.status === 'operational' ? 'operational' : overall.status); var tone = toneFor(overall.status === 'operational' ? 'operational' : overall.status);
var pill = $('overallPill'); var pill = $('overallPill');
@@ -282,6 +317,7 @@
notice.hidden = true; notice.hidden = true;
} }
} catch (err) { } catch (err) {
setOfflineState('api', 'The dashboard status service could not be reached. It may be restarting or temporarily offline.');
renderRowsError($('serverRows'), 'Status API unavailable: ' + err.message); renderRowsError($('serverRows'), 'Status API unavailable: ' + err.message);
renderRowsError($('serviceRows'), 'Status API unavailable: ' + err.message); renderRowsError($('serviceRows'), 'Status API unavailable: ' + err.message);
$('overallPill').className = 'overall-pill bad'; $('overallPill').className = 'overall-pill bad';
@@ -562,9 +598,28 @@
} }
$('refreshBtn').addEventListener('click', loadAll); $('refreshBtn').addEventListener('click', loadAll);
$('offlineRetry').addEventListener('click', function () {
manualOfflinePreview = false;
if (window.location.hash) {
window.history.replaceState(null, '', window.location.pathname + window.location.search);
}
countdown = REFRESH_SECONDS;
syncOfflinePage();
loadAll();
});
window.addEventListener('hashchange', function () {
var wasOfflinePreview = manualOfflinePreview;
manualOfflinePreview = window.location.hash.toLowerCase() === '#offline';
syncOfflinePage();
if (wasOfflinePreview && !manualOfflinePreview) {
countdown = REFRESH_SECONDS;
loadAll();
}
});
setInterval(function () { setInterval(function () {
if (document.hidden) return; if (document.hidden || manualOfflinePreview) return;
countdown -= 1; countdown -= 1;
if (countdown <= 0) { if (countdown <= 0) {
countdown = REFRESH_SECONDS; countdown = REFRESH_SECONDS;
@@ -577,9 +632,10 @@
document.addEventListener('visibilitychange', function () { document.addEventListener('visibilitychange', function () {
if (!document.hidden) { if (!document.hidden) {
countdown = REFRESH_SECONDS; countdown = REFRESH_SECONDS;
if (!hasLoaded) loadAll(); if (!hasLoaded && !manualOfflinePreview) loadAll();
} }
}); });
loadAll(); syncOfflinePage();
if (!manualOfflinePreview) loadAll();
})(); })();
+1 -1
View File
@@ -147,7 +147,7 @@ Combined snapshot used by the dashboard.
}, },
"network": { "network": {
"onHomeNetwork": true, "onHomeNetwork": true,
"monitoredSubnet": "10.0.0.0/24" "monitoredSubnet": "192.168.50.0/24"
}, },
"servers": [ "servers": [
{ {
+6 -4
View File
@@ -48,7 +48,8 @@ Check `ping` exists:
```bash ```bash
command -v ping command -v ping
ping -c 1 10.0.0.87 ping -c 1 192.168.50.102
ping -c 1 192.168.50.103
``` ```
### Node.js 20 or newer ### Node.js 20 or newer
@@ -382,7 +383,7 @@ lines before the catch-all and route DNS for them:
Do not expose port 8787 in the firewall. In the split-origin layout, the main Do not expose port 8787 in the firewall. In the split-origin layout, the main
static host must publish the updated `site-config.js`, `dashboard.js`, static host must publish the updated `site-config.js`, `dashboard.js`,
`dashboard.html`, `analytics.js`, and `moon-vault.html` from this repository. `dashboard.html`, `dashboard.css`, `analytics.js`, and `moon-vault.html` from this repository.
## 9. Persistence, backups, and restore ## 9. Persistence, backups, and restore
@@ -528,7 +529,8 @@ The monitor could not run `ping`. Check:
```bash ```bash
command -v ping command -v ping
ping -c 1 10.0.0.87 ping -c 1 192.168.50.102
ping -c 1 192.168.50.103
getcap "$(command -v ping)" 2>/dev/null || true getcap "$(command -v ping)" 2>/dev/null || true
sysctl net.ipv4.ping_group_range sysctl net.ipv4.ping_group_range
``` ```
@@ -547,7 +549,7 @@ Never make the Node process run as root just to ping two hosts.
### Servers show `unknown` with `not_on_home_network` ### Servers show `unknown` with `not_on_home_network`
The host's local addresses do not match `HOME_SUBNET`. Set it to the real The host's local addresses do not match `HOME_SUBNET`. Set it to the real
subnet (for example `HOME_SUBNET=10.0.0.0/24`) and restart. This is intentional: subnet (for example `HOME_SUBNET=192.168.50.0/24`) and restart. This is intentional:
a failed ping from a remote network is not reported as a home-server outage. a failed ping from a remote network is not reported as a home-server outage.
### Website checks all fail ### Website checks all fail
+6 -6
View File
@@ -97,7 +97,7 @@ Generate a hash with `npm run hash-password`; generate the secret with
| Setting | Default | Range / format | What it does | Change | | Setting | Default | Range / format | What it does | Change |
| --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- |
| `HOME_SUBNET` | empty | CIDR, e.g. `10.0.0.0/24` | Subnet used to decide "on home network". When off-network, failed pings report `unknown` instead of `offline` | `.env`, restart | | `HOME_SUBNET` | empty | CIDR, e.g. `192.168.50.0/24` | Subnet used to decide "on home network". When off-network, failed pings report `unknown` instead of `offline` | `.env`, restart |
| `SERVER_CHECK_INTERVAL_MS` | `60000` | 10000–86400000 | Ping loop interval | `.env`, restart | | `SERVER_CHECK_INTERVAL_MS` | `60000` | 10000–86400000 | Ping loop interval | `.env`, restart |
| `SERVICE_CHECK_INTERVAL_MS` | `120000` | 15000–86400000 | Website check loop interval | `.env`, restart | | `SERVICE_CHECK_INTERVAL_MS` | `120000` | 15000–86400000 | Website check loop interval | `.env`, restart |
| `PING_TIMEOUT_MS` | `2000` | 200–30000 | Ping timeout | `.env`, restart | | `PING_TIMEOUT_MS` | `2000` | 200–30000 | Ping timeout | `.env`, restart |
@@ -120,10 +120,10 @@ Environment overrides use the **1-based position in the file**:
```dotenv ```dotenv
SERVER_1_NAME=Main Server SERVER_1_NAME=Main Server
SERVER_1_IP=10.0.0.87 SERVER_1_IP=192.168.50.102
SERVER_1_ENABLED=true SERVER_1_ENABLED=true
SERVER_2_NAME=FEDL Server SERVER_2_NAME=Debian Server
SERVER_2_IP=10.0.0.119 SERVER_2_IP=192.168.50.103
SERVER_2_ENABLED=true SERVER_2_ENABLED=true
``` ```
@@ -225,8 +225,8 @@ These run on the visitor's machine and are independent of `.env`.
| Dashboard refresh | `dashboard.js` (`REFRESH_SECONDS`) | `60` | Auto-refresh interval in seconds | Code edit + deploy | | Dashboard refresh | `dashboard.js` (`REFRESH_SECONDS`) | `60` | Auto-refresh interval in seconds | Code edit + deploy |
| Analytics loader | `projects/script.js` | `/analytics.js` | Injects the beacon on every page | Code edit + deploy | | Analytics loader | `projects/script.js` | `/analytics.js` | Injects the beacon on every page | Code edit + deploy |
The static host must publish `site-config.js`, `dashboard.html`, `dashboard.js`, The static host must publish `site-config.js`, `dashboard.html`, `dashboard.css`,
`analytics.js`, and `moon-vault.html` whenever they change. Purge Cloudflare or `dashboard.js`, `analytics.js`, and `moon-vault.html` whenever they change. Purge Cloudflare or
hard-refresh, because static responses are cached for 4 hours. hard-refresh, because static responses are cached for 4 hours.
--- ---
+2 -2
View File
@@ -1311,7 +1311,7 @@
<span class="line2" id="heroLetters" data-text="MILES"><span class="hl">M</span><span class="hl">I</span><span class="hl">L</span><span class="hl">E</span><span class="hl">S</span></span> <span class="line2" id="heroLetters" data-text="MILES"><span class="hl">M</span><span class="hl">I</span><span class="hl">L</span><span class="hl">E</span><span class="hl">S</span></span>
</div> </div>
<p class="hero-sub">I make games, tools, and websites. I'm still in school and building a full Electron replacement — send help. i also work at Diskette Labs.</p> <p class="hero-sub">I make games, tools, and websites. I'm still in school and building a full Electron replacement — send help. i also work at Diskette Labs.</p>
<div class="hero-status"><span class="status-dot"></span> usually online</div> <a class="hero-status" href="dashboard.html" aria-label="View current system status"><span class="status-dot"></span> view system status</a>
<div class="hero-links"> <div class="hero-links">
<a class="term-btn" href="https://github.com/mileswolfallen2" target="_blank">GitHub</a> <a class="term-btn" href="https://github.com/mileswolfallen2" target="_blank">GitHub</a>
<a class="term-btn" href="https://replit.com/@MilesAllen1" target="_blank">Replit</a> <a class="term-btn" href="https://replit.com/@MilesAllen1" target="_blank">Replit</a>
@@ -1620,7 +1620,7 @@
<div class="footer-links" style="margin-bottom: 12px;"> <div class="footer-links" style="margin-bottom: 12px;">
<a href="uses.html" style="color:var(--muted);text-decoration:none;">Uses</a> <a href="uses.html" style="color:var(--muted);text-decoration:none;">Uses</a>
<span style="color:var(--muted);margin:0 8px;">·</span> <span style="color:var(--muted);margin:0 8px;">·</span>
<a href="dashboard.html" style="color:var(--accent);text-decoration:none;">Home Lab Maintenance</a> <a href="dashboard.html" style="color:var(--accent);text-decoration:none;">System Dashboard</a>
<span style="color:var(--muted);margin:0 8px;">·</span> <span style="color:var(--muted);margin:0 8px;">·</span>
<a href="now.html" style="color:var(--muted);text-decoration:none;">Now</a> <a href="now.html" style="color:var(--muted);text-decoration:none;">Now</a>
<span style="color:var(--muted);margin:0 8px;">·</span> <span style="color:var(--muted);margin:0 8px;">·</span>
+3 -3
View File
@@ -3,14 +3,14 @@
{ {
"id": "home-1", "id": "home-1",
"name": "Main Server", "name": "Main Server",
"ip": "10.0.0.87", "ip": "192.168.50.102",
"order": 1, "order": 1,
"enabled": true "enabled": true
}, },
{ {
"id": "home-2", "id": "home-2",
"name": "FEDL Server", "name": "Debian Server",
"ip": "10.0.0.119", "ip": "192.168.50.103",
"order": 2, "order": 2,
"enabled": true "enabled": true
} }
+3 -2
View File
@@ -19,9 +19,10 @@ test('config loads local defaults and project registry', () => {
assert.ok(config.projects.length > 5); assert.ok(config.projects.length > 5);
assert.equal(config.projects.find((p) => p.id === 'fedl').featured, true); assert.equal(config.projects.find((p) => p.id === 'fedl').featured, true);
assert.equal(config.services.length, 5); assert.equal(config.services.length, 5);
assert.equal(config.servers[0].ip, '10.0.0.87'); assert.equal(config.servers[0].ip, '192.168.50.102');
assert.equal(config.servers[0].name, 'Main Server'); assert.equal(config.servers[0].name, 'Main Server');
assert.equal(config.servers[1].name, 'FEDL Server'); assert.equal(config.servers[1].ip, '192.168.50.103');
assert.equal(config.servers[1].name, 'Debian Server');
}); });
test('config honors environment overrides without changing code', () => { test('config honors environment overrides without changing code', () => {