Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yunsii/cf-worker-status-page-pro
Monitor your websites, showcase status including daily history, and get notification whenever your website status changes. Using Cloudflare Workers, CRON Triggers, and KV storage.
https://github.com/yunsii/cf-worker-status-page-pro
cloudflare-workers cloudflare-workers-cron cloudflare-workers-kv discord eslint iconify monitoring slack-notifications status-page tailwindcss telegram-notification typescript vike wrangler
Last synced: about 2 months ago
JSON representation
Monitor your websites, showcase status including daily history, and get notification whenever your website status changes. Using Cloudflare Workers, CRON Triggers, and KV storage.
- Host: GitHub
- URL: https://github.com/yunsii/cf-worker-status-page-pro
- Owner: yunsii
- Created: 2024-03-09T13:52:06.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-09-08T04:22:17.000Z (4 months ago)
- Last Synced: 2024-09-08T12:03:11.711Z (4 months ago)
- Topics: cloudflare-workers, cloudflare-workers-cron, cloudflare-workers-kv, discord, eslint, iconify, monitoring, slack-notifications, status-page, tailwindcss, telegram-notification, typescript, vike, wrangler
- Language: TypeScript
- Homepage: https://cf-worker-status-page-pro-production.yunsii.workers.dev/
- Size: 533 KB
- Stars: 14
- Watchers: 1
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cloudflare Worker - Status Page Pro
[![](https://dcbadge.vercel.app/api/server/gE39mt6WXd)](https://discord.gg/gE39mt6WXd)
Monitor your websites, showcase status including daily history, and get Slack notification whenever your website status changes. Using **Cloudflare Workers**, **CRON Triggers,** and **KV storage**. Check [my status page](https://cf-worker-status-page-pro-production.yunsii.workers.dev/) out! 🚀
## Features
- 🦄 Written in TypeScript
- ✨ Support [remote csv monitors](#remote-csv-monitors)
- 🚀 No limit for max monitors of cron task, even with workers KV free tier
- 🪁 [Auto GC](./src/worker/_helpers/store.ts#L77) for KV value size
- 💎 More DX/UX detail you want## Pre-requisites
You'll need a [Cloudflare Workers account](https://dash.cloudflare.com/sign-up/workers) with
- A workers domain set up
- The Workers Bundled subscription \($5/mo\)
- [It works with Workers Free!](https://blog.cloudflare.com/workers-kv-free-tier/) Check [more info](#workers-kv-free-tier) on how to run on Workers Free.
- Some websites/APIs to watch 🙂Also, prepare the following secrets
- Cloudflare API token with `Edit Cloudflare Workers` permissions
- Slack incoming webhook \(optional\)
- Discord incoming webhook \(optional\)## Getting started
You can use GitHub Actions to deploy on your own.
1. You should use this template to create a new repository
2. Navigate to your new **GitHub repository > Settings > Secrets and variables > Actions** and add the following secrets:```yaml
- Name: CLOUDFLARE_API_TOKEN- Name: SECRET_SLACK_WEBHOOK_URL (optional)
- Value: your-slack-webhook-url- Name: SECRET_DISCORD_WEBHOOK_URL (optional)
- Value: your-discord-webhook-url
```3. Edit [config.ts](./src/config.ts) to adjust configuration and list all of your websites/APIs you want to monitor
4. Push to `master` branch to trigger the deployment
5. 🎉
6. _\(optional\)_ Go to [Cloudflare Workers settings](https://dash.cloudflare.com/?to=/workers) and assign custom domain/route
7. _\(optional\)_ Edit [wrangler.toml](./wrangler.toml) to adjust Worker settings or CRON Trigger schedule, especially if you are on [Workers Free plan](#workers-kv-free-tier)## Workers KV free tier
The Workers Free plan includes limited KV usage, but the quota is sufficient for 2-minute checks only
- Change the CRON trigger to 2 minutes interval (`crons = ["*/2 * * * *"]`) in [wrangler.toml](./wrangler.toml)
## Known issues
- **KV replication lag** - You might get Slack notification instantly, however it may take couple of more seconds to see the change on your status page as [Cron Triggers are usually running on underutilized quiet hours machines](https://blog.cloudflare.com/introducing-cron-triggers-for-cloudflare-workers/#how-are-you-able-to-offer-this-feature-at-no-additional-cost).
- **Initial delay (no data)** - It takes couple of minutes to schedule and run CRON Triggers for the first time
## Running project locally
**Requirements**
- Pnpm (`npm i -g pnpm`)
### Steps to get server up and running
**Install dependencies**
```
pnpm i
```**Login With Wrangler to Cloudflare**
```
npx wrangler login
```**Create your KV namespace in cloudflare**
```
On the workers page navigate to KV, and create a namespace
```**Update your wrangler.toml with**
```
kv-namespaces = [{binding="KV_STORE", id="", preview_id=""}]
```_Note: you may need to change `kv-namespaces` to `kv_namespaces`_
**Run**
```
pnpm run dev
```## Remote CSV Monitors
You can use remote CSV monitors like [this template](https://docs.google.com/spreadsheets/d/1eNhgeS0ElQGFeaVLNJwFWI8JW-Ppv158necdqASJ6TY/edit?usp=sharing). You can get the URL by **File > Share > Publish to web** and select specific sheet and Comma-separated values (.csv).
## Credits
- [eidam/cf-workers-status-page](https://github.com/eidam/cf-workers-status-page)
- [Vike](https://vike.dev/)