Commit Graph

44 Commits (a21be253cb82ea7a1dbb092776f52865a135a2d2)

Author SHA1 Message Date
Konrad Fröhlich 0615093400
fix(status): /incidents showed 'no incidents' while 14 were recorded (+ mobile header, multi-region prep) (#10)
* fix(incidents): /incidents never received the incident data (P0 false statement)

/incidents got pageProps = [monitors] (2910 B) while / got
[compactedStateStr, monitors] (13119 B). The page therefore rendered only
the hand-written `maintenances` array from uptime.config.ts and, that being
empty, printed "No incidents in this month" — next to a 99.95 % uptime
figure computed from the very outages it was hiding.

Measured against the live state of 2026-07-30 16:45 UTC: 14 recorded
incidents in 2026-07 (8x api_health, 6x mcp), one of them still OPEN
(mcp, "Expected codes: [200,401,405,406], Got: 400"). The page showed zero.

Both halves are fixed, because only fixing the data path would turn the
next load failure back into a silent false statement:

- getServerSideProps now reads `state` from the store, like pages/index.tsx
  does, and the page derives incidents from it (util/incidents.ts).
  Exposure is unchanged: compactedStateStr is already public on /, and the
  monitor list stays limited to id+name (see 377a596).
- NoIncidents gained a `noData` variant, so "we could not look" (no monitor
  state at all) no longer renders as "there were no incidents".

Details of the derivation:
- reads the compacted columns directly instead of uncompact(), which would
  also decode the much larger latency series this page never renders;
- counts an incident for a month when it OVERLAPS it, so an outage across a
  month boundary or a still-open one cannot vanish from the current month;
- skips the worker's zero-length 'dummy' seed record (worker/src/index.ts:51),
  which stores the monitoring start time and is not an outage;
- keeps history of monitors that were removed from the config, under their
  raw id — silently dropping records is the failure being fixed here.

scripts/check-incidents-datapath.ts reproduces the red/green against a real
captured state:
  npx tsx scripts/check-incidents-datapath.ts live-state.json 2026-07
  -> incidents rendered: 14   (structurally 0 before this change)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(header): mobile nav overflowed the 56px header and the 360px viewport

Measured on the live page with Chromium:
  390px  nav group Rect -4.5 .. 60.5 (65px tall) against header 0 .. 56
         -> "Incidents" clipped top and bottom
  360px  document scrollWidth 371 vs clientWidth 360 -> 11px page overflow

One cause for both. The mobile nav renders `link.highlight ||
link.link.startsWith('/')`, which includes the 150px "openshopgraph.org"
entry — whose href is byte-identical to the href of the wordmark on the left
(verified in the DOM: brand href === link href). Wordmark plus two links does
not fit at 360-390px, so the Group wrapped to two 30px rows plus a 5px gap =
65px of content in a header with a *fixed* 56px height, which cannot contain
it and therefore clips it.

- Header.tsx drops nav links that point where the wordmark already points.
  The link is not lost; it is the wordmark.
- Header.module.css uses min-height instead of height on .header/.inner, so
  the next long label makes the header grow instead of silently cutting its
  content off. The Group keeps its default wrapping on purpose: contained
  vertical growth beats horizontal page overflow.

Re-measured on the live DOM with exactly this combination applied:
  360px  overflow 0px, nav 13 .. 43 inside header 0 .. 57
  390px  overflow 0px, nav 13 .. 43 inside header 0 .. 57

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore(config): prepare multi-region checks, deliberately left disabled

Requested as "prepare, do not roll out", so this commit adds no active
monitor: only a documented, commented-out block in uptime.config.ts.

Correcting the finding while preparing it: the single vantage point is real,
but it is not Frankfurt. Decoded from the live state of 2026-07-30, all 435
latency samples (145 per monitor, the 12h window) carry loc "LHR" — London.
No monitor sets `checkProxy`, so checks run in whichever colo the cron worker
happens to be scheduled in.

Also correcting the shape of the work: `checkProxy` is one value per monitor,
not a list (worker/src/monitor.ts:361-400). Multiple regions therefore mean
one monitor entry per region — still configuration, but it multiplies the
checks per minute and adds a row to the public page for each region, which is
why this is an owner decision rather than a switch to flip.

The block records the two transports ('worker://<DurableObjectLocationHint>'
and 'globalping://') and the one trap worth knowing before enabling: without
`checkProxyFallback: true` a failing probe is stored as up:false with
"Unknown check proxy error", i.e. a probe outage gets published as a service
outage.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Test User <test@example.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 00:29:27 +02:00
Konrad Fröhlich 25b57fbeda
style: match status page to openshopgraph.org design language (#2)
Re-theme the UptimeFlare fork's chrome (surfaces, borders, type, header
wordmark, footer line) to the openshopgraph.org design tokens, sourced
from openshopgraph-frontend-v2 src/styles/site-tokens.css. Monitor set,
check logic and page title/links config are untouched.

- Copy the site's self-hosted Cabinet Grotesk / Switzer / Martian Mono
  woff2 faces (~124 KB) into public/fonts and remap Mantine's CSS
  variables (--mantine-font-family[-headings/-monospace]) to the same
  stacks; drop the next/font/google Inter import (font-CDN-free, same
  rule as the main site's CSP).
- Remap Mantine surface/text/border variables per color scheme
  (--mantine-color-body/text/white/dark-6/dark-4/anchor/dimmed,
  --mantine-primary-color-filled) to --paper/--ink/--card/--hair from
  site-tokens.css; keeps following prefers-color-scheme via Mantine's
  existing defaultColorScheme="auto" script, matching the main site's
  light/dark behavior. Semantic monitor-state colors (green/red icons)
  are left alone on purpose.
- Bump --mantine-radius-{sm,md,lg} to the main site's softer values.
- Replace the generic UptimeFlare <Image> logo in Header.tsx with the
  OSG two-dot wordmark (same glyph as BaseLayout.astro's .top-brand
  mark), linking to https://openshopgraph.org.
- Set pageConfig.customFooter to a one-line footer matching the main
  site's "Verified data, not ads." tone instead of the stock UptimeFlare
  attribution line.

Co-authored-by: Test User <test@example.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 20:44:14 +02:00
lyc8503 377a5963c6 SECURITY: fix private config file leak 2026-03-04 21:39:34 +08:00
lyc8503 c4cfcc841f Merge branch 'main' of https://github.com/lyc8503/UptimeFlare 2026-01-03 23:31:57 +08:00
lyc8503 3de3640d17 feat: D1 upgrade: deployment and migration process DONE! 2026-01-03 23:06:32 +08:00
Bennet Gallein 5878fff4ba
fix: add maintenances to API response (#171) 2026-01-01 20:45:02 +08:00
lyc8503 0258ae1ddc [WIP] feat: local deployment, still need more testing, data migration & CI todo 2026-01-01 02:26:37 +08:00
lyc8503 e050065a3c [WIP] workers works! (lol) pages+migration todo 2025-12-31 22:19:29 +08:00
lyc8503 45d86424b2 [WIP] terraform cloudflare provider v5 works! more performance/migration/deployment work todo 2025-12-30 23:19:18 +08:00
lyc8503 e9d8a1c842 Add Chinese translation (Thank you copilot, and I swear I reviewed the code carefully) 2025-12-23 23:22:33 +08:00
Hyeonwoo Cho 77cdf19f7d
Add github readme badge api (#163)
* add github readme badge api

* return error on monitorId is null

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* delete duplicated boolean check

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Refactor badge endpoint to use KV store

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-10 20:46:27 +08:00
MD. ABU SAYED 64931bf3c4
Add CORS headers to API responses (#162)
The API for status is showing CORS issue: "Response body is not available to scripts (Reason: CORS Missing Allow Origin)" when using from other domain/localhost. To solve this ,CORS header is added. It also possible to specify allowed domain in Env Var in cloudflare and call them directly.
2025-12-05 15:34:59 +08:00
lyc8503 8e4fa94886 misc: new favicon~ 2025-11-05 02:20:37 +08:00
Mack f88e286b9c
Upcoming and active maintenance (#142)
* Updated with intial commit
- MaintenanceAlert.tsx now handles upcoming and active maintenance alerts.
- OverallStatus.tsx updated to include collapsible sections for ongoing and upcoming maintenance alerts.

* Updated MaintenanceAlert layout for better responsiveness

* Revert the uptime.config.ts

* fix: Added type definitions for active and upcoming maintenances

* Update components/MaintenanceAlert.tsx

Co-authored-by: Bennet Gallein <me@bennetgallein.de>

* Update: added `pageConfig.maintenances.upcomingColor` to control upcoming maintenance alert colors.

* Feature: Added a config option for the favicon.

* keep original styles

* remove collapse

* add back a different collapse for upcoming events

* css grid to align date text

* tiny css changes and cleanup

---------

Co-authored-by: Bennet Gallein <me@bennetgallein.de>
Co-authored-by: lyc8503 <me@lyc8503.net>
2025-09-27 21:30:13 +08:00
lyc8503 65408d4962 fix: incident header margin, run prettier 2025-09-21 15:28:59 +08:00
Bennet Gallein 41257c6ae9
feat: incident history (#113)
* feat: add incident history link to links in header

* fix: lower margin-bottom on header to have not that much wasted space

* chore: move footer to own component

* feat: add NoIncidents component

* feat: add incidents history page

* fix: add sorting by date

* fix: fix sorting

* feat: hash linking to individual incidents

* fix: always truthy title

* feat: remove hash

* feat: some link improvements

* feat: improve styles for alert, support mobile devices

* fix: remove unused vars, larger margin

---------

Co-authored-by: lyc8503 <me@lyc8503.net>
2025-09-21 15:18:20 +08:00
Bennet Gallein a6c8eb6e12
maintenance mode (#101)
* feat: move types

* feat: add maintenance alert

* feat: move to config/base class to have fallback values on missing exports

* fix: wrong import for types

* Revert "fix: wrong import for types"

This reverts commit ca2b2e3a68.

* Revert "feat: move to config/base class to have fallback values on missing exports"

This reverts commit 9932ea2590.

* fix: imports

* chore: formatting

* fix: handle filtering for global status

* fix: pass props

* fix: ignore active maintenances when sending notifications

* fix: mark as warning when monitor is in maintenance

* fix: title width & warning icon

* fix: remove accordeons again

* alert config/style changes, worker code improve

* update example config

* update example config

* set monitors to be optional

---------

Co-authored-by: lyc8503 <me@lyc8503.net>
2025-05-01 01:09:53 +08:00
Haoliang Gao 8a6cde7240
fix: state is null (#106)
Looks fine, thanks for contributing!

It was `undefined` in a previous version, but I forgot to change it afterwards.😂
2025-04-26 16:07:49 +08:00
lyc8503 4bcf4173ea misc: run prettier 2025-04-19 21:50:43 +08:00
lyc8503 44594ca320 remove pages check API 2025-04-13 23:04:40 +08:00
lyc8503 43890eeba6 fix: pages colo 2025-04-12 22:20:33 +08:00
lyc8503 6a7effe668 WIP: check proxy on pages 2025-04-12 22:20:33 +08:00
lyc8503 d1857502bb feat: option to hide latency chart 2025-03-25 17:41:32 +08:00
lyc8503 d8520f4ddc add JSON api 2024-07-01 00:32:31 +08:00
lyc8503 c4da5f6c15
Update index.tsx 2024-06-30 16:08:23 +08:00
Vega b232414d22
Update index.tsx
Fix #41: Compilation failure leading to unsuccessful deployment.
2024-06-22 20:23:47 +08:00
lyc8503 2670758f7a Merge branch 'main' of https://github.com/lyc8503/UptimeFlare 2024-05-12 01:57:40 +08:00
lyc8503 d791c187c8 fix #16: show single monitor 2024-05-12 01:57:28 +08:00
Cary 5053ac07da
feat: add optional chaining for monitor params 2024-05-09 14:33:36 +08:00
lyc8503 904e0bc49b ts type and ui bug fixes 2024-03-18 16:21:28 +08:00
lyc8503 3031a5a962 fix #6: style change 2024-02-04 11:46:09 +08:00
lyc8503 092140b962 fix cpu limit exceeded, update README 2024-01-30 14:06:21 +08:00
lyc8503 9bdeec90f2 better callbacks, fix config leak 2023-12-09 14:59:59 +08:00
lyc8503 87611700c3 format code and no semi 2023-11-06 00:51:41 +08:00
lyc8503 eba65bd654 format code 2023-11-06 00:38:30 +08:00
lyc8503 4817fef547 header responsive update, fix worker tcp read 2023-10-28 01:38:21 +08:00
lyc8503 7e694fd9b7 add advanced checks 2023-10-23 15:29:27 +08:00
lyc8503 1d431a649f disable ssr & dark mode & bar 2023-10-23 00:54:26 +08:00
lyc8503 93c069c419 lastIncident logic improve & index error msg 2023-10-20 02:08:56 +08:00
lyc8503 7b85b89325 almost done: more and more css 2023-10-16 12:09:48 +08:00
lyc8503 4fba030932 wip: more layout & chartjs 2023-10-15 16:44:00 +08:00
lyc8503 f9212c88a6 wip: frontend header & overall status 2023-10-15 02:00:29 +08:00
lyc8503 cdd43685f2 wip: worker & pages 2023-10-14 15:21:52 +08:00
lyc8503 c67ea1bd65 Initial commit from Create Next App 2023-10-12 22:16:16 +08:00