Repository navigation
v2.0.0
uptime is now an npm package, @joshghent/uptime, instead of a repository you
fork. A status page is a repository of its own with four files in it —
status.yaml, a three-line worker.js, wrangler.jsonc and a workflow — and
updates reach it as Dependabot pull requests that prove themselves against your
config and merge themselves. No token, no secret, no merging upstream.
Action required if you run a fork. Move it onto the package once; after
that there is nothing to do for minor and patch releases. It keeps the same
Worker, the same database and the same history, and the same repository, so
Cloudflare Workers Builds stays connected. In your fork:
git switch -c move-to-package
# Keep your monitors, drop everything else.
git rm -rq . && git checkout HEAD -- status.yaml
# Bring in the template, then put your status.yaml back over its example.
npm create uptime@2 ../uptime-template
cp -r ../uptime-template/. . && rm -rf ../uptime-template
git checkout HEAD -- status.yamlThen copy three things from your old wrangler.jsonc (git show HEAD:wrangler.jsonc) into the new one: your database_id, your routes if
you set one, and your name if you changed it from uptime. A different name
deploys a different Worker.
npm install
npm run check # your config, the build, and the Worker booted locally
git add -A && git commit -m "Move onto @joshghent/uptime"Open that as a pull request and merge it; Workers Builds deploys it as usual.
- If you set the Workers Builds deploy command to
pnpm run deployfor 1.1.0,
set it back to the default,npx wrangler deploy. Migrations no longer run
there. - The database needs nothing. Its
d1_migrationstable already lists both
migrations, and the Worker reads the same table. - Delete the
SYNC_TOKENsecret and the token behind it, and theupstream
remote if you added one.
Added
createWorker(source), the whole Worker around the text of astatus.yaml.- The Worker applies its own migrations, on the first request or cron run in
each isolate, into wrangler's ownd1_migrationstable. A release that adds
a migration needs nothing from you. status.yamltakes aversion:(missing means 1). A release that changes
the shape of the file upgrades older ones in memory, so an update never needs
your config edited.- The
uptimecommand:uptime lint,uptime check(lint, a dry-run build,
then the Worker booted against an empty local database and its page and
/healthloaded) anduptime init.npm create uptimerunsuptime init. - A template deployment with a Dependabot config and a workflow that runs
uptime checkon every pull request and merges minor and patch updates of
the package when it passes. - Releases publish both packages to npm, with provenance.
Changed
/healthanswers503when the Worker could not bring the database up to
date, rather than when a migration was not run by hand.status.example.yamlis nowtemplate/status.yaml, andpnpm lint:config
in a status page isnpm run lint.
Removed
- The upstream sync workflow and its
SYNC_TOKEN, the Actions deploy job and
DEPLOY_VIA_ACTIONS, and thedeployanddb:*scripts.wrangler d1 migrations applystill works against a deployment's database, but nothing
needs it.