Repository navigation
Push the status dashboard's verdict to a Statuspage component #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e62a69d
Push the dashboard verdict to a Statuspage component
claude 21ab489
Harden the Statuspage pusher: timer cap, request timeout, redact-first
claude f6247a9
Key the major-outage verdict on availability checks only
claude 9b64c90
Cancel the Statuspage response body after each push
claude 3f25245
Accept any 2xx from the Statuspage API
claude 4dcb51b
Keep the periodic pusher from minting OAuth clients
claude e3105b8
Isolate the dashboard's UID and fix the redaction test boundary
claude f4a4504
Share the log sanitiser and tighten the pusher's report reuse
claude 7bdd6ef
Run the dashboard from a root-owned copy of its source
claude 378fe89
Diagnose a Statuspage config that sets only optional variables
claude da197b6
Provision /etc/imcp-status during deployment
claude ad3dc71
Skip both registration probes in non-mutating runs
claude d600d57
Update two comments stale since the allow-list skip
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // Shared log sanitisation for the IMCP status dashboard. | ||
| // | ||
| // Extracted from server.js so statuspage.js can reuse it instead of carrying | ||
| // a near-identical copy. | ||
|
|
||
| /** | ||
| * Reduce a value (an Error or anything else) to a single safe log line: | ||
| * message only (no stack), capped in length, with control characters replaced | ||
| * by spaces so that a logged error message can never forge or inject | ||
| * additional log entries. Covers C0 controls + DEL, the C1 controls | ||
| * (U+0080–U+009F, incl. U+009B the 8-bit CSI), and the Unicode line/paragraph | ||
| * separators (U+2028/U+2029). Implemented with a codepoint filter to avoid | ||
| * embedding control-char literals. | ||
| * | ||
| * @param {unknown} value | ||
| * @returns {string} | ||
| */ | ||
| export const sanitizeForLog = (value) => { | ||
| const input = String( | ||
| (value && /** @type {any} */ (value).message) || value, | ||
| ).slice(0, 300); | ||
| let out = ""; | ||
| for (const ch of input) { | ||
| const code = /** @type {number} */ (ch.codePointAt(0)); | ||
| const dangerous = | ||
| code < 0x20 || | ||
| code === 0x7f || | ||
| (code >= 0x80 && code <= 0x9f) || | ||
| code === 0x2028 || | ||
| code === 0x2029; | ||
| out += dangerous ? " " : ch; | ||
| } | ||
| return out; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // Unit tests for the shared log sanitiser. | ||
| // Run with: node --test monitoring/mcp-status/log.test.js | ||
| // or: cd monitoring/mcp-status && npm test | ||
|
|
||
| import { test } from "node:test"; | ||
| import assert from "node:assert/strict"; | ||
| import { sanitizeForLog } from "./log.js"; | ||
|
|
||
| test("sanitizeForLog strips control characters and separators", () => { | ||
| // C0 (LF, CR, ESC), DEL, a C1 control (the 8-bit CSI), and the Unicode line | ||
| // and paragraph separators - each must become a plain space. Built from | ||
| // codepoints so the test source embeds no control-char literals (same | ||
| // rationale as the implementation). | ||
| const ctl = (cp) => String.fromCodePoint(cp); | ||
| const input = [ | ||
| "a", | ||
| ctl(0x0a), | ||
| "b", | ||
| ctl(0x0d), | ||
| "c", | ||
| ctl(0x1b), | ||
| "d", | ||
| ctl(0x7f), | ||
| "e", | ||
| ctl(0x9b), | ||
| "f", | ||
| ctl(0x2028), | ||
| "g", | ||
| ctl(0x2029), | ||
| "h", | ||
| ].join(""); | ||
| assert.equal(sanitizeForLog(input), "a b c d e f g h"); | ||
| }); | ||
|
|
||
| test("sanitizeForLog caps the length at 300 characters", () => { | ||
| assert.equal(sanitizeForLog("x".repeat(500)).length, 300); | ||
| }); | ||
|
|
||
| test("sanitizeForLog prefers an Error's message and never its stack", () => { | ||
| assert.equal(sanitizeForLog(new Error("boom")), "boom"); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.