Configure OSG public status monitors (website, API, MCP)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
pull/210/head
k55f97 2026-07-12 03:50:47 +02:00
parent a5670e51cb
commit 3c7d8eca14
1 changed files with 52 additions and 110 deletions

View File

@ -1,134 +1,76 @@
// This is a simplified example config file for quickstart // OpenShopGraph public status page configuration (UptimeFlare)
// Some not frequently used features are omitted/commented out here // Governance: PUBLIC page — component states + uptime only.
// For a full-featured example, please refer to `uptime.config.full.ts` // No internal IPs/ports, vendor names, SHAs, quotas or percentages here.
// Don't edit this line // Don't edit this line
import { MaintenanceConfig, PageConfig, WorkerConfig } from './types/config' import { MaintenanceConfig, PageConfig, WorkerConfig } from './types/config'
const pageConfig: PageConfig = { const pageConfig: PageConfig = {
// Title for your status page title: 'OpenShopGraph Status',
title: "lyc8503's Status Page",
// Links shown at the header of your status page, could set `highlight` to `true`
links: [ links: [
{ link: 'https://github.com/lyc8503', label: 'GitHub' }, { link: 'https://openshopgraph.org', label: 'openshopgraph.org', highlight: true },
{ link: 'https://blog.lyc8503.net/', label: 'Blog' },
{ link: 'mailto:me@lyc8503.net', label: 'Email Me', highlight: true },
], ],
} }
const workerConfig: WorkerConfig = { const workerConfig: WorkerConfig = {
// Define all your monitors here // Reduce D1 write frequency (free-tier friendly); checks still run every minute.
kvWriteCooldownMinutes: 3,
monitors: [ monitors: [
// Example HTTP Monitor
{ {
// `id` should be unique, history will be kept if the `id` remains constant id: 'website',
id: 'foo_monitor', name: 'Website',
// `name` is used at status page and callback message
name: 'My API Monitor',
// `method` should be a valid HTTP Method
method: 'GET', method: 'GET',
// `target` is a valid URL target: 'https://openshopgraph.org/en/',
target: 'https://example.com', tooltip: 'Public website (external HTTPS check)',
// [OPTIONAL] `tooltip` is ONLY used at status page to show a tooltip statusPageLink: 'https://openshopgraph.org',
tooltip: 'This is a tooltip for this monitor',
// [OPTIONAL] `statusPageLink` is ONLY used for clickable link at status page
statusPageLink: 'https://example.com',
// [OPTIONAL] `expectedCodes` is an array of acceptable HTTP response codes, if not specified, default to 2xx
expectedCodes: [200], expectedCodes: [200],
// [OPTIONAL] `timeout` in millisecond, if not specified, default to 10000
timeout: 10000, timeout: 10000,
// [OPTIONAL] headers to be sent headers: { 'User-Agent': 'OSG-StatusCheck/1.0 (UptimeFlare)' },
headers: {
'User-Agent': 'Uptimeflare',
Authorization: 'Bearer YOUR_TOKEN_HERE',
},
// [OPTIONAL] body to be sent (require POST/PUT/PATCH method)
// body: 'Hello, world!',
// [OPTIONAL] if specified, the response must contains the keyword to be considered as operational.
// responseKeyword: 'success',
// [OPTIONAL] if specified, the response must NOT contains the keyword to be considered as operational.
// responseForbiddenKeyword: 'bad gateway',
// [OPTIONAL] if specified, will call the check proxy to check the monitor, mainly for geo-specific checks
// refer to docs https://github.com/lyc8503/UptimeFlare/wiki/Check-proxy-setup before setting this value
// currently supports `worker://`, `globalping://` and `http(s)://` proxies
// checkProxy: 'worker://weur',
// [OPTIONAL] if true, the check will fallback to local if the specified proxy is down
// checkProxyFallback: true,
}, },
// Example TCP Monitor
{ {
id: 'test_tcp_monitor', id: 'api_health',
name: 'Example TCP Monitor', name: 'API',
// `method` should be `TCP_PING` for tcp monitors method: 'GET',
method: 'TCP_PING', target: 'https://api.openshopgraph.org/health',
// `target` should be `host:port` for tcp monitors tooltip: 'Public API health endpoint',
target: '1.2.3.4:22', expectedCodes: [200],
tooltip: 'My production server SSH',
statusPageLink: 'https://example.com',
timeout: 5000,
},
],
// [Optional] Notification settings
notification: {
// [Optional] Notification webhook settings, if not specified, no notification will be sent
// More info at Wiki: https://github.com/lyc8503/UptimeFlare/wiki/Setup-notification
webhook: {
// [Required] webhook URL (example: Telegram Bot API)
url: 'https://api.telegram.org/bot123456:ABCDEF/sendMessage',
// [Optional] HTTP method, default to 'GET' for payloadType=param, 'POST' otherwise
// method: 'POST',
// [Optional] headers to be sent
// headers: {
// foo: 'bar',
// },
// [Required] Specify how to encode the payload
// Should be one of 'param', 'json' or 'x-www-form-urlencoded'
// 'param': append url-encoded payload to URL search parameters
// 'json': POST json payload as body, set content-type header to 'application/json'
// 'x-www-form-urlencoded': POST url-encoded payload as body, set content-type header to 'x-www-form-urlencoded'
payloadType: 'x-www-form-urlencoded',
// [Required] payload to be sent
// $MSG will be replaced with the human-readable notification message
payload: {
chat_id: 12345678,
text: '$MSG',
},
// [Optional] timeout calling this webhook, in millisecond, default to 5000
timeout: 10000, timeout: 10000,
headers: { 'User-Agent': 'OSG-StatusCheck/1.0 (UptimeFlare)' },
}, },
// [Optional] timezone used in notification messages, default to "Etc/GMT" {
timeZone: 'Asia/Shanghai', id: 'mcp',
// [Optional] grace period in minutes before sending a notification name: 'AI Agent Interface (MCP)',
// notification will be sent only if the monitor is down for N continuous checks after the initial failure method: 'GET',
// if not specified, notification will be sent immediately target: 'https://api.openshopgraph.org/mcp',
gracePeriod: 5, tooltip: 'MCP endpoint reachability (auth required, 401 = alive)',
// Endpoint requires auth; a 401 proves the service is up and routing.
expectedCodes: [200, 401, 405, 406],
timeout: 10000,
headers: { 'User-Agent': 'OSG-StatusCheck/1.0 (UptimeFlare)' },
},
// NOTE (internal, not a leak — this comment is only in the repo):
// Enrichment worker / database / deploy pipeline have no public endpoints.
// They stay on the internal admin view (public-admin behind Cloudflare
// Access) fed by the Mini collectors. If a stable tunnel hostname for
// Mini health is created later, add it here as an HTTP monitor.
],
notification: {
// Wire Pushover here (same account as ops/minimax-usage.sh) — needs the
// owner's Pushover token/user key; do not commit real keys, use the
// full-config option of reading from env if desired.
// webhook: {
// url: 'https://api.pushover.net/1/messages.json',
// payloadType: 'x-www-form-urlencoded',
// payload: { token: 'APP_TOKEN', user: 'USER_KEY', message: '$MSG' },
// },
timeZone: 'Europe/Berlin',
// Avoid flapping alerts: notify only after 3 consecutive failed checks.
gracePeriod: 3,
}, },
} }
// You can define multiple maintenances here // No scheduled maintenances currently.
// During maintenance, an alert will be shown at status page const maintenances: MaintenanceConfig[] = []
// Also, related downtime notifications will be skipped (if any)
// Of course, you can leave it empty if you don't need this feature
// const maintenances: MaintenanceConfig[] = []
const maintenances: MaintenanceConfig[] = [
{
// [Optional] Monitor IDs to be affected by this maintenance
monitors: ['foo_monitor', 'bar_monitor'],
// [Optional] default to "Scheduled Maintenance" if not specified
title: 'Test Maintenance',
// Description of the maintenance, will be shown at status page
body: 'This is a test maintenance, server software upgrade',
// Start time of the maintenance, in UNIX timestamp or ISO 8601 format
start: '2020-01-01T00:00:00+08:00',
// [Optional] end time of the maintenance, in UNIX timestamp or ISO 8601 format
// if not specified, the maintenance will be considered as on-going
end: '2050-01-01T00:00:00+08:00',
// [Optional] color of the maintenance alert at status page, default to "yellow"
color: 'blue',
},
]
// Don't edit this line // Don't edit this line
export { maintenances, pageConfig, workerConfig } export { pageConfig, workerConfig, maintenances }