1
0
mirror of https://github.com/tormachris/cf-workers-status-page.git synced 2025-09-21 16:35:15 +02:00

2 Commits

Author SHA1 Message Date
66bab8d9c7 fix: config indentation 2022-02-06 12:20:45 +01:00
81b35546c3 updated 2022-02-06 19:32:57 +13:00
4 changed files with 28 additions and 18 deletions

View File

@ -4,7 +4,6 @@ on:
push: push:
branches: branches:
- main - main
- e/w2
repository_dispatch: repository_dispatch:
schedule: schedule:
- cron: '0 0 1 * *' - cron: '0 0 1 * *'
@ -23,13 +22,11 @@ jobs:
env: env:
NODE_ENV: production NODE_ENV: production
- name: Publish - name: Publish
uses: WalshyDev/wrangler-action@walshy/pages-996-support-wrangler2 uses: cloudflare/wrangler-action@1.3.0
with: with:
apiToken: ${{ secrets.CF_API_TOKEN }} apiToken: ${{ secrets.CF_API_TOKEN }}
command: publish --env production
wranglerVersion: beta
preCommands: | preCommands: |
wrangler kv:namespace create KV_STATUS_PAGE || echo "KV namespace already exists" wrangler kv:namespace create KV_STATUS_PAGE
apt-get update && apt-get install -y jq apt-get update && apt-get install -y jq
export KV_NAMESPACE_ID=$(wrangler kv:namespace list | jq -c 'map(select(.title | contains("KV_STATUS_PAGE")))' | jq -r ".[0].id") export KV_NAMESPACE_ID=$(wrangler kv:namespace list | jq -c 'map(select(.title | contains("KV_STATUS_PAGE")))' | jq -r ".[0].id")
echo "[env.production]" >> wrangler.toml echo "[env.production]" >> wrangler.toml
@ -45,6 +42,7 @@ jobs:
SECRET_TELEGRAM_API_TOKEN SECRET_TELEGRAM_API_TOKEN
SECRET_TELEGRAM_CHAT_ID SECRET_TELEGRAM_CHAT_ID
SECRET_DISCORD_WEBHOOK_URL SECRET_DISCORD_WEBHOOK_URL
environment: production
env: env:
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
SECRET_SLACK_WEBHOOK_URL: ${{secrets.SECRET_SLACK_WEBHOOK_URL}} SECRET_SLACK_WEBHOOK_URL: ${{secrets.SECRET_SLACK_WEBHOOK_URL}}

View File

@ -1,5 +1,5 @@
settings: settings:
title: 'Status Page' title: 'Killzone Gaming Status'
url: 'https://status-page.eidam.dev' # used for Slack messages url: 'https://status-page.eidam.dev' # used for Slack messages
logo: logo-192x192.png # image in ./public/ folder logo: logo-192x192.png # image in ./public/ folder
daysInHistogram: 90 # number of days you want to display in histogram daysInHistogram: 90 # number of days you want to display in histogram
@ -15,25 +15,37 @@ settings:
dayInHistogramNotOperational: ' incident(s)' # xx incident(s) recorded dayInHistogramNotOperational: ' incident(s)' # xx incident(s) recorded
monitors: monitors:
- id: workers-cloudflare-com # unique identifier - id: www-kzg-gg # unique identifier
name: workers.cloudflare.com name: kzg.gg | Killzone Gaming Forums
description: 'You write code. They handle the rest.' # default=empty description: '' # default=empty
url: 'https://workers.cloudflare.com/' # URL to fetch url: 'https://kzg.gg' # URL to fetch
method: GET # default=GET method: GET # default=GET
expectStatus: 200 # operational status, default=200 expectStatus: 200 # operational status, default=200
followRedirect: false # should fetch follow redirects, default=false followRedirect: false # should fetch follow redirects, default=false
linkable: false # allows the title to be a link, default=true linkable: false # allows the title to be a link, default=true
- id: www-cloudflare-com - id: www-bans-kzg-gg
name: www.cloudflare.com name: bans.kzg.gg | Killzone Gaming SourceBans
description: 'Built for anything connected to the Internet.' description: 'Built for anything connected to the Internet.'
url: 'https://www.cloudflare.com' url: 'https://stats.kzg.gg'
method: GET method: GET
expectStatus: 200 expectStatus: 200
linkable: true # allows the title to be a link, default=true linkable: true # allows the title to be a link, default=true
- id: blog-cloudflare-com - id: stats-kzg-gg
name: The Cloudflare Blog name: stats.kzg.gg | Killzone Gaming Statistics
url: 'https://blog.cloudflare.com/' url: 'https://stats.kzg.gg'
method: GET
expectStatus: 200
- id: steamid-kzg-gg
name: steamid.kzg.gg | Killzone Gaming SteamID
url: 'https://steamid.kzg.gg'
method: GET
expectStatus: 200
- id: shorturl-kzg-gg
name: kzg.link | Killzone Gaming URL Shortner
url: 'https://kzg.link'
method: GET method: GET
expectStatus: 200 expectStatus: 200

View File

@ -64,7 +64,7 @@ export async function notifySlack(monitor, operational) {
} }
export async function notifyTelegram(monitor, operational) { export async function notifyTelegram(monitor, operational) {
const text = `Monitor *${monitor.name.replaceAll( const text = `Monitor *${monitor.name.replace(
'-', '-',
'\\-', '\\-',
)}* changed status to *${getOperationalLabel(operational)}* )}* changed status to *${getOperationalLabel(operational)}*

View File

@ -6,7 +6,7 @@ webpack_config = "node_modules/flareact/webpack"
compatibility_date = "2021-07-23" compatibility_date = "2021-07-23"
[triggers] [triggers]
crons = ["* * * * *"] crons = ["*/2 * * * *"]
[site] [site]
bucket = "out" bucket = "out"