Compare commits

..
3 Commits
Author SHA1 Message Date
miles 4175ad5be6 fixed the server 2026-11-25 00:32:16 -06:00
miles 559d3ef89c update dashboard and navigation links for home lab maintenance 2026-11-24 23:57:50 -06:00
miles 21ff87a966 yesy 2026-11-24 20:36:45 -06:00
13 changed files with 256 additions and 27 deletions

No files matched your search

+4 -2
View File
@@ -28,12 +28,12 @@ can remain on its current host.
| 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 |
| 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 |
| 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
@@ -76,6 +76,8 @@ npm run dev
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/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
plain HTTP:
+1
View File
@@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Avengers: Doomsday Watchlist</title>
<style>
:root {
--bg-color: #0d0f12;
--card-bg: #15171c;
+124
View File
@@ -326,6 +326,130 @@ button { font: inherit; }
.footer a { color: var(--muted); text-decoration: none; }
.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) {
* { animation: none !important; transition: none !important; }
html { scroll-behavior: auto; }
+47 -1
View File
@@ -24,11 +24,12 @@
<a href="index.html">Home</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>
</header>
<main class="wrap">
<main class="wrap" id="dashboardMain">
<section class="hero">
<div class="hero-copy">
<div class="eyebrow">// live telemetry</div>
@@ -227,6 +228,51 @@
</footer>
</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>
</html>
+59 -3
View File
@@ -12,9 +12,37 @@
var countdown = REFRESH_SECONDS;
var refreshing = false;
var hasLoaded = false;
var manualOfflinePreview = window.location.hash.toLowerCase() === '#offline';
var offlineReason = '';
var offlineMessage = '';
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) {
var node = document.createElement(tag);
if (className) node.className = className;
@@ -248,6 +276,13 @@
var status = await get('/status');
var servers = status.servers || [];
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 tone = toneFor(overall.status === 'operational' ? 'operational' : overall.status);
var pill = $('overallPill');
@@ -282,6 +317,7 @@
notice.hidden = true;
}
} 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($('serviceRows'), 'Status API unavailable: ' + err.message);
$('overallPill').className = 'overall-pill bad';
@@ -562,9 +598,28 @@
}
$('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 () {
if (document.hidden) return;
if (document.hidden || manualOfflinePreview) return;
countdown -= 1;
if (countdown <= 0) {
countdown = REFRESH_SECONDS;
@@ -577,9 +632,10 @@
document.addEventListener('visibilitychange', function () {
if (!document.hidden) {
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": {
"onHomeNetwork": true,
"monitoredSubnet": "10.0.0.0/24"
"monitoredSubnet": "192.168.50.0/24"
},
"servers": [
{
+6 -4
View File
@@ -48,7 +48,8 @@ Check `ping` exists:
```bash
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
@@ -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
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
@@ -528,7 +529,8 @@ The monitor could not run `ping`. Check:
```bash
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
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`
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.
### 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 |
| --- | --- | --- | --- | --- |
| `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 |
| `SERVICE_CHECK_INTERVAL_MS` | `120000` | 15000–86400000 | Website check loop interval | `.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
SERVER_1_NAME=Main Server
SERVER_1_IP=10.0.0.87
SERVER_1_IP=192.168.50.102
SERVER_1_ENABLED=true
SERVER_2_NAME=FEDL Server
SERVER_2_IP=10.0.0.119
SERVER_2_NAME=Debian Server
SERVER_2_IP=192.168.50.103
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 |
| 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`,
`analytics.js`, and `moon-vault.html` whenever they change. Purge Cloudflare or
The static host must publish `site-config.js`, `dashboard.html`, `dashboard.css`,
`dashboard.js`, `analytics.js`, and `moon-vault.html` whenever they change. Purge Cloudflare or
hard-refresh, because static responses are cached for 4 hours.
---
+2 -3
View File
@@ -331,7 +331,6 @@
.contact-row:last-child{border-bottom:none;}
.contact-row span.k{color:var(--muted);font-weight:400;text-transform:uppercase;font-size:10px;}
.contact-row:hover{padding-left:16px;color:var(--accent);}
footer{text-align:center;padding:40px 24px 60px;font-family:var(--font-mono);font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;}
@@ -1312,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>
</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>
<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">
<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>
@@ -1621,7 +1620,7 @@
<div class="footer-links" style="margin-bottom: 12px;">
<a href="uses.html" style="color:var(--muted);text-decoration:none;">Uses</a>
<span style="color:var(--muted);margin:0 8px;">·</span>
<a href="dashboard.html" style="color:var(--accent);text-decoration:none;">System Console</a>
<a href="dashboard.html" style="color:var(--accent);text-decoration:none;">System Dashboard</a>
<span style="color:var(--muted);margin:0 8px;">·</span>
<a href="now.html" style="color:var(--muted);text-decoration:none;">Now</a>
<span style="color:var(--muted);margin:0 8px;">·</span>
-1
View File
@@ -47,7 +47,6 @@ nav{position:fixed;top:0;left:0;right:0;z-index:100;background:rgba(7,7,12,0.9);
<a href="index.html" class="nav-logo"><span class="logo-dot"></span> milesallen</a>
<div class="nav-links">
<a href="index.html#projects">Projects</a>
<a href="dashboard.html">Dashboard</a>
</div>
</nav>
+3 -3
View File
@@ -3,14 +3,14 @@
{
"id": "home-1",
"name": "Main Server",
"ip": "10.0.0.87",
"ip": "192.168.50.102",
"order": 1,
"enabled": true
},
{
"id": "home-2",
"name": "FEDL Server",
"ip": "10.0.0.119",
"name": "Debian Server",
"ip": "192.168.50.103",
"order": 2,
"enabled": true
}
-1
View File
@@ -67,7 +67,6 @@ footer .ft{font-family:var(--font-mono);font-size:10px;color:#666;line-height:1.
<a href="/index.html" class="nav-logo"><span class="logo-dot"></span> milesallen</a>
<div class="nav-links">
<a href="/index.html#projects">Projects</a>
<a href="/dashboard.html">Dashboard</a>
<button type="button" id="vaultLogout">Lock vault</button>
</div>
</nav>
+3 -2
View File
@@ -19,9 +19,10 @@ test('config loads local defaults and project registry', () => {
assert.ok(config.projects.length > 5);
assert.equal(config.projects.find((p) => p.id === 'fedl').featured, true);
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[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', () => {