The webhook address is private: uptime.config.ts names it as secret:MATTERMOST_WEBHOOK and the worker reads the Worker secret of that name (bound in deploy.tf from the GitHub Actions secret). The address is kept out of the logs. Alerts wait 3 minutes before saying something is down.
90 lines
3.6 KiB
TypeScript
90 lines
3.6 KiB
TypeScript
// Cottage's status page: what we check and what we've posted.
|
||
// A push to main deploys it (see README.md). Field reference: uptime.config.full.ts.
|
||
//
|
||
// Don't edit this line
|
||
import { MaintenanceConfig, PageConfig, WorkerConfig } from './types/config'
|
||
|
||
const pageConfig: PageConfig = {
|
||
title: 'Cottage status',
|
||
// Buttons on the right of the header.
|
||
links: [
|
||
{ link: 'https://cottage.host', label: 'cottage.host' },
|
||
{ link: 'https://cottage.host/apps', label: 'Your dashboard', highlight: true },
|
||
],
|
||
// Sections, in order. Every monitor below should appear in exactly one.
|
||
group: {
|
||
Cottage: ['website', 'dashboard'],
|
||
'Apps by region': ['apps-us-east'],
|
||
},
|
||
}
|
||
|
||
const workerConfig: WorkerConfig = {
|
||
// Checks run every minute from Cloudflare's network (the location nearest the worker).
|
||
monitors: [
|
||
{
|
||
id: 'website',
|
||
name: 'Website',
|
||
tooltip: 'cottage.host: pricing, the app catalog and docs',
|
||
method: 'GET',
|
||
target: 'https://cottage.host',
|
||
statusPageLink: 'https://cottage.host',
|
||
timeout: 10000,
|
||
headers: { 'User-Agent': 'cottage-status (+https://status.cottage.host)' },
|
||
},
|
||
{
|
||
id: 'dashboard',
|
||
name: 'Dashboard and billing',
|
||
tooltip: 'Signing in, deploying and managing apps, and top-ups',
|
||
method: 'GET',
|
||
target: 'https://cottage.host/healthz',
|
||
statusPageLink: 'https://cottage.host',
|
||
expectedCodes: [200],
|
||
timeout: 10000,
|
||
headers: { 'User-Agent': 'cottage-status (+https://status.cottage.host)' },
|
||
},
|
||
{
|
||
// A real app running on the region's servers (on Cottage's own internal account), so this
|
||
// checks the whole path a customer's app takes: Cloudflare, the node's proxy, Harbor and a
|
||
// running container. Its address is private: the worker reads it from the Worker secret
|
||
// APPS_US_EAST_TARGET (GitHub Actions secret of the same name, bound in deploy.tf).
|
||
id: 'apps-us-east',
|
||
name: 'Apps in US East',
|
||
tooltip: 'Customer apps hosted in Virginia',
|
||
method: 'GET',
|
||
target: 'secret:APPS_US_EAST_TARGET',
|
||
expectedCodes: [200],
|
||
timeout: 10000,
|
||
headers: { 'User-Agent': 'cottage-status (+https://status.cottage.host)' },
|
||
},
|
||
],
|
||
// Down and back-up messages go to the founder's Mattermost (channel "alerts"). The webhook address
|
||
// is private: the worker reads it from the Worker secret MATTERMOST_WEBHOOK (GitHub Actions secret of
|
||
// the same name, bound in deploy.tf). Grafana Cloud (hearth infra/monitoring) alerts there too.
|
||
notification: {
|
||
webhook: {
|
||
url: 'secret:MATTERMOST_WEBHOOK',
|
||
payloadType: 'json',
|
||
payload: { text: '$MSG', username: 'Status' },
|
||
},
|
||
timeZone: 'Etc/UTC',
|
||
// Wait a few minutes before saying something is down, so a single failed check doesn't page.
|
||
gracePeriod: 3,
|
||
},
|
||
}
|
||
|
||
// Notices shown on the page: incident updates and planned maintenance. Newest last.
|
||
// Write them in Cottage's voice: say what happened, who it affects and what to expect,
|
||
// e.g. title 'Apps in US East were slow for 18 minutes'.
|
||
// {
|
||
// title: 'Some apps in US East aren’t loading',
|
||
// body: 'We’re looking into it now. Next update within 30 minutes.',
|
||
// monitors: ['apps-us-east'], // listed as "Affects: ..." and their status follows the colour
|
||
// start: '2026-12-01T14:05:00Z',
|
||
// end: '2026-12-01T14:40:00Z', // leave out while it's ongoing
|
||
// color: 'red', // red = outage, yellow = degraded (default), blue = maintenance, green = resolved
|
||
// },
|
||
const maintenances: MaintenanceConfig[] = []
|
||
|
||
// Don't edit this line
|
||
export { maintenances, pageConfig, workerConfig }
|