diff --git a/README.md b/README.md index cb6aad7..88a0790 100644 --- a/README.md +++ b/README.md @@ -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 . The dashboard is at and the vault lock page is at . +Preview the dashboard outage page at +. For local development, use these overrides in `.env` so cookies work over plain HTTP: diff --git a/dashboard.css b/dashboard.css index 8a1095f..dc8d5c6 100644 --- a/dashboard.css +++ b/dashboard.css @@ -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; } diff --git a/dashboard.html b/dashboard.html index a71a0e2..ee00861 100644 --- a/dashboard.html +++ b/dashboard.html @@ -3,86 +3,15 @@ - Home Lab Maintenance | Miles Allen - - + System Console | Miles Allen + + - + @@ -94,49 +23,256 @@ -
+
-
// home lab / maintenance window
-

Home Server Maintenance

-

I'm setting up a new router in my home lab. Some network-hosted services may be briefly unavailable while I get everything connected.

+
// live telemetry
+

System Console

+

Infrastructure, development activity, FEDL, and traffic for milesallen.site. Everything on this page comes from the local backend API.

+
+
+
+ + Connecting +
+
+ Waiting for first check + · + auto-refresh 60s +
-
-
Router setup in progress
-

A quick tune-up for the home network

-

The system dashboard is taking a break while I configure the new router. Thanks for your patience while the home lab gets settled.

+
+
+
Services up
+
--
+
website checks
+
+
+
Servers up
+
--
+
home network
+
+
+
GitHub stars
+
--
+
tracked repos
+
+
+
FEDL levels
+
--
+
ranked
+
+
+
Pageviews today
+
--
+
privacy-friendly
+
+
+
Visitors 30d
+
--
+
daily hashes
+
-
-
- Current task - Setting up a new router -
-
- Possible impact - Brief interruptions to home-hosted services -
+ + +
+
+
+
+
01 / infrastructure
+

Home servers

+
+ network unknown +
+
+
+
+
+
+ +
+
+
+
02 / websites
+

Service health

+
+ traffic → +
+
+
+
+
+
+
+ +
+
+
+
03 / development
+

GitHub activity

+
+ profile → +
+
+
--public repos
+
--tracked
+
--stars
+
--forks
+
+
+
30-day event activity
+ +
+
+
+

Recent commits

+
  • Loading GitHub data…
+
+
+

Most active

+
  • Loading repositories…
+

Languages

+
—
+
+
+

Data is cached server-side; the GitHub token never reaches the browser.

+
+ + + +
+
+
+
05 / traffic
+

Analytics

+
+ 30-day retention +
+
+
--total pageviews
+
--today
+
--7 days
+
--unique 30d
+
+
+
Daily pageviews · 30 days
+ +
+
+
+

Most visited

+
  • Loading analytics…
+
+
+

Recent hits

+
  • Loading analytics…
+
+
+

No cookies, no raw IP addresses. Daily salted hashes only.

+
+ +
+
+
+
06 / registry
+

Project registry

+
+ — +
+
+
+
+
+
+
-
-
A useful check
-

FAQ

-
-

How do I know if the server is running?

-

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.

-
-
-
+ milesallen.site system console + · back home · - Home lab maintenance in progress + moon vault + · + API status is honest: unknown means unknown.
+ +
+
+
+ + + milesallen.site + + SERVER OFFLINE +
+ +
+ +

connection interrupted / 503

+

The server is
taking a breather.

+

The status service can't be reached right now. It may be restarting or temporarily offline.

+ +
+ +
+ We’ll be back shortly +

This page will check again automatically. Your visit and saved data are not affected.

+
+ SYSTEM
PAUSED
+
+ +
+ + Back to home +
+

You can return to this preview any time with #offline.

+
+ +
+ milesallen.site · system status + checking for a signal... +
+
+
+ + diff --git a/dashboard.js b/dashboard.js index 3743140..cfb5f25 100644 --- a/dashboard.js +++ b/dashboard.js @@ -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(); })(); diff --git a/docs/API.md b/docs/API.md index cc160dd..322467f 100644 --- a/docs/API.md +++ b/docs/API.md @@ -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": [ { diff --git a/docs/DEPLOYMENT.md b/docs/DEPLOYMENT.md index 73f5ad6..d06cf4b 100644 --- a/docs/DEPLOYMENT.md +++ b/docs/DEPLOYMENT.md @@ -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 diff --git a/docs/SETTINGS.md b/docs/SETTINGS.md index fc189bd..a18f2f6 100644 --- a/docs/SETTINGS.md +++ b/docs/SETTINGS.md @@ -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. --- diff --git a/index.html b/index.html index 0920dc4..ca11a29 100644 --- a/index.html +++ b/index.html @@ -1311,7 +1311,7 @@ MILES

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.

-
usually online
+ view system status