Repository navigation
UF1: the monitor on Workers - #2
Merged
Merged
Conversation
UptimeFlare's status page and its checker, one Cloudflare Worker: - apps/web: upstream's pages, components, locales, styles and config (Next.js pages router, Mantine 7, Chart.js, i18next), on Next 16 and @opennextjs/cloudflare instead of @cloudflare/next-on-pages. The edge runtime exports are gone (OpenNext runs the Node runtime), the two API routes are Node API routes with the same headers and bodies, and the pages read the D1 binding through getCloudflareContext() instead of process.env. - monitor/: upstream's worker/src, its loop unchanged; the binding is DB and the table monitor_state (the lowercase slug is this repository's identity, which the rename engine rewrites). The Durable Object remote checker is left out: a worker:// check proxy reports the monitor down, or checks it locally under checkProxyFallback. - worker.ts: the custom entry (cron-starter's shape) — OpenNext's fetch plus the checker's scheduled handler on ONE Cron Trigger, every minute. - proxy.ts: upstream's Basic-auth middleware, its password the optional Orun secret STATUS_PAGE_PASSWORD handed to the Worker as a secret by the build, never a string in the committed config. - the wrangler template (the trigger, the DB token) and its fixture, the committed fixture render, and component.yaml (dev verifies; stage and prod deploy on main, smoke-tested on a check the trigger recorded). - tests/web: the compacted state, the scheduled loop against real SQLite with every check kind and the webhook, the API routes, the password gate, and the props the page hands the browser (CVE-2026-29779). Mantine's react-textarea-autosize resolves an edge-light build under the workerd condition that Next's tracing never copies; next.config.mjs traces it in. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019PcpNVpFBcbeiX3EHdXfmn
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
UptimeFlare's status page and its checker as ONE Cloudflare Worker.
@opennextjs/cloudflareinstead of@cloudflare/next-on-pages. Edge-runtime exports dropped; the two API routes are Node API routes with the same headers and bodies; bindings come fromgetCloudflareContext().worker/src, loop unchanged. BindingDB, tablemonitor_state(the lowercase slug is this repo's identity, which the rename engine rewrites). The Durable Object remote checker is left out: aworker://proxy reports the monitor down, or checks locally withcheckProxyFallback.fetch+ the checker'sscheduledon one every-minute Cron Trigger.STATUS_PAGE_PASSWORD, handed to the Worker as a secret, never committed.component.yaml(smoke:/api/data'supdatedAtno older than 10 minutes).worker://, fallback, webhook), the API routes, the password gate, the props handed to the browser (CVE-2026-29779).Verified locally:
pnpm install,wire:fixture(no diff),typecheck,lint,test,build;wrangler dev --test-scheduled— a fired trigger checked every monitor,/api/dataread the state back, the component's own smoke passed (and with a password, refused without it); the client bundle carries no monitor config.Generated by Claude Code