Git Product home page Git Product logo

uptimeflare's Introduction

Hi there 👋

💬 My Blog: https://blog.lyc8503.net

✔ Status Page: https://status.lyc8503.net powered by my own project UptimeFlare

  • 😄 Junior Majoring in Software Engineering(aka. 文档学院) at NJU. | 我是古希腊掌管 prompt 的神!
  • 🔭 Currently trying to operate an autonomous system.
  • ⚡ To-study/do List: Write some more blogs, maybe learn more C++ in my summer internship.
  • 🐟 Fish touching.
  • 🎮 Sometimes play Minecraft modpacks, currently playing Enigmatica 2: Expert.
  • 🔑 My GPG Pubkey [rotated 2024-06-25]

Metrics

uptimeflare's People

Contributors

lockerdown avatar lroolle avatar lyc8503 avatar pl4nty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

uptimeflare's Issues

TCP_PING模式的监控项目过多时的BUG

当TCP_PING模式的监控超过6条后,超过前6条的监控项目将无法检测出延迟
image
已经做过多次测试,最简单的复现方式就是在配置文件中创建超过6条TCP_PING模式的监控

const workerConfig = { monitors: [ { id: 'example111', name: 'Example TCP Monitor 1', tooltip: 'test', method: 'TCP_PING', target: '142.250.204.4:443', }, { id: 'example222', name: 'Example TCP Monitor 2', tooltip: 'test', method: 'TCP_PING', target: '142.251.43.4:443', }, ... ],

"Project not found."

I've tried multiple times to build & deploy, but I keep getting this error:

✘ [ERROR] A request to the Cloudflare API (/accounts/[REDACTED]/pages/projects/uptimeflare) failed.

  Project not found. The specified project name does not match any of your existing projects. [code: 8000007]
  
  If you think this is a bug, please open an issue at: https://github.com/cloudflare/workers-sdk/issues/new/choose

Every other step passes, but this one fails.

issue: 部署初始化失败

部署后网站似乎打不开,如图

image

console 显示:

2_app-f7bfd027cc9448b7.js:23 TypeError: Cannot read properties of null (reading 'overallUp')
    at OverallStatus (index-8f7a2988780303ec.js:1:611)
    at Xh (framework-0c7baedefba6b077.js:9:60990)
    at x (framework-0c7baedefba6b077.js:9:119445)
    at Vk (framework-0c7baedefba6b077.js:9:99130)
    at framework-0c7baedefba6b077.js:9:98997
    at Jk (framework-0c7baedefba6b077.js:9:99004)
    at Ok (framework-0c7baedefba6b077.js:9:95760)
    at Fk (framework-0c7baedefba6b077.js:9:96149)
    at jg (framework-0c7baedefba6b077.js:9:44899)
    at framework-0c7baedefba6b077.js:9:93661
console.error @ _app-f7bfd027cc9448b7.js:23
_app-f7bfd027cc9448b7.js:23 A client-side exception has occurred, see here for more info: https://nextjs.org/docs/messages/client-side-exception-occurred
console.error @ _app-f7bfd027cc9448b7.js:23
2_app-f7bfd027cc9448b7.js:23 TypeError: Cannot read properties of null (reading 'latency')
    at MonitorDetail (index-8f7a2988780303ec.js:1:122643)
    at Xh (framework-0c7baedefba6b077.js:9:60990)
    at x (framework-0c7baedefba6b077.js:9:119445)
    at Vk (framework-0c7baedefba6b077.js:9:99130)
    at framework-0c7baedefba6b077.js:9:98997
    at Jk (framework-0c7baedefba6b077.js:9:99004)
    at Ok (framework-0c7baedefba6b077.js:9:95760)
    at Fk (framework-0c7baedefba6b077.js:9:96149)
    at jg (framework-0c7baedefba6b077.js:9:44899)
    at framework-0c7baedefba6b077.js:9:93661
console.error @ _app-f7bfd027cc9448b7.js:23
_app-f7bfd027cc9448b7.js:23 A client-side exception has occurred, see here for more info: https://nextjs.org/docs/messages/client-side-exception-occurred
console.error @ _app-f7bfd027cc9448b7.js:23
_app-f7bfd027cc9448b7.js:23 Error rendering page:  Error: Cancel rendering route
    at _ (main-a82dbdedafde9961.js:1:13174)
    at main-a82dbdedafde9961.js:1:13126
    at new Promise (<anonymous>)
    at doRender (main-a82dbdedafde9961.js:1:13103)
    at main-a82dbdedafde9961.js:1:11240

[Feature Request] 监控目标希望可以指定解析地址

需求

如果可以,希望能在进行 HTTP Monitor 的时候可以为监控目标指定解析的地址 ,关于这个我似乎并未在现有配置项中找到这个问题的解决方案

应用场景

我现在有这么一个应用场景,我的静态博客站点,分别部署在阿里云vercel, 然后通过dns解析区分不同区域流量。根据部署的UptimeFlare请求来看,他的流量来自美国,这个时候这个的请求只会到vercel的站点上面。如果能指定解析地址,就可以解决这个问题,或者是否有其他方案解决这个问题呢。

指定地理位置后报错

未配置checkLocationWorkerRoute时没问题
我的配置是:
checkLocationWorkerRoute: 'https://hk.biliko.net/'
worker日志如下:

    {
      "message": [
        "Error calling worker: SyntaxError: Unexpected token 'e', \"error code: 522\" is not valid JSON"
      ],
      "level": "log",
      "timestamp": 1715329769280
    },

Geo-specific check: "Always Use HTTPS" setting in route zone results in "Too many redirects" error

I followed the instructions here.

If the setting (in the Cloudflare dash) "domain.name > SSL/TLS > Edge Certificates > Always Use HTTPS" is enabled for the zone used for the Workers Route, the worker will fail to check the targets with the following log. Disabling "Always Use HTTPS" completely prevents the issue.

{
  "outcome": "ok",
  "scriptName": "uptimeflare_worker",
  "diagnosticsChannelEvents": [],
  "exceptions": [],
  "logs": [
    {
      "message": [
        "Running scheduled event on DFW..."
      ],
      "level": "log",
      "timestamp": 1707379205214
    },
    {
      "message": [
        "[DFW] Checking [monitor name #1]..."
      ],
      "level": "log",
      "timestamp": 1707379205316
    },
    {
      "message": [
        "Calling worker: https://route_subdomain.domain.name/"
      ],
      "level": "log",
      "timestamp": 1707379205316
    },
    {
      "message": [
        "Error calling worker: TypeError: Too many redirects.https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/"
      ],
      "level": "log",
      "timestamp": 1707379211140
    },
    {
      "message": [
        "[DFW] Checking [monitor name #2]..."
      ],
      "level": "log",
      "timestamp": 1707379211140
    },
    {
      "message": [
        "Calling worker: https://route_subdomain.domain.name/"
      ],
      "level": "log",
      "timestamp": 1707379211140
    },
    {
      "message": [
        "Error calling worker: TypeError: Too many redirects.https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/, https://route_subdomain.domain.name/"
      ],
      "level": "log",
      "timestamp": 1707379215495
    },
    {
      "message": [
        "[DFW] Checking [monitor name #3]..."
      ],
      "level": "log",
      "timestamp": 1707379215495
    },
    {
      "message": [
        "Calling worker: https://route_subdomain.domain.name/"
      ],
      "level": "log",
      "timestamp": 1707379215495
    },
    {
      "message": [
        "Error calling worker: Error: Too many subrequests."
      ],
      "level": "log",
      "timestamp": 1707379216822
    },
    {
      "message": [
        "[DFW] Checking [monitor name #4]..."
      ],
      "level": "log",
      "timestamp": 1707379216822
    },
    {
      "message": [
        "Calling worker: https://route_subdomain.domain.name/"
      ],
      "level": "log",
      "timestamp": 1707379216822
    },
    {
      "message": [
        "Error calling worker: Error: Too many subrequests."
      ],
      "level": "log",
      "timestamp": 1707379216822
    }
  ],
  "eventTimestamp": 1707379205200,
  "event": {
    "cron": "*/2 * * * *",
    "scheduledTime": 1707379205000
  },
  "id": 3
}

Selfhost

I know this isn't the designed usecase.

But might it be possible to run this inside a docker container?

I would love to help but im not sure how Cloudflare Workers work

The program reported an error after deleting the `statusPageLink`

Recently, it was found that after deleting statusPageLink: 'https://example.com' during deployment, the program reported an error. It seems that this is a required field. Can this field be removed? I don't quite understand the purpose of statusPageLink. It seems useful for monitoring web but not for tcp_ping.

In addition to web and tcp_ping, are there other monitoring methods supported? Does it support notification channels like bark?

http服务检测非标准端口异常

http服务检测非标准端口异常,我不知道是否支持端口的配置,如果有请告诉我怎么配置,我在配置文件中没有看到配置项

image
image
image

tcp 自定义端口是正常的

image
image

Error calling worker

So, I followed the documentation here and got the following IP: 8.24.87.22

I setup the A record (PROXIED) along with the protocol as HTTP.
Using Postman I am able to make a GET request and get the following response

I looked before I posted this issue and found #19 and used the same website as in this comment to test it here and it responds to all pings.

The error logs are

  "outcome": "ok",
  "scriptVersion": {
    "id": "[REDACTED]"
  },
  "scriptName": "uptimeflare_worker",
  "diagnosticsChannelEvents": [],
  "exceptions": [],
  "logs": [
    {
      "message": [
        "Running scheduled event on LHR..."
      ],
      "level": "log",
      "timestamp": 1716778665662
    },
    {
      "message": [
        "[LHR] Checking Images Server..."
      ],
      "level": "log",
      "timestamp": 1716778665702
    },
    {
      "message": [
        "Calling worker: http://[REDACTED]"
      ],
      "level": "log",
      "timestamp": 1716778665702
    },
    {
      "message": [
        "Error calling worker: SyntaxError: Unexpected token 'e', \"error code: 521\" is not valid JSON"
      ],
      "level": "log",
      "timestamp": 1716778665833
    },
    {
      "message": [
        "Grace period (undefinedm) not met (currently down for 540s, changed false), skipping apprise DOWN notification for Images Server"
      ],
      "level": "log",
      "timestamp": 1716778665833
    },
    {
      "message": [
        "Calling config onIncident callback..."
      ],
      "level": "log",
      "timestamp": 1716778665833
    },
    {
      "message": [
        "statusChanged: false, lastUpdate: 1716778606, currentTime: 1716778666"
      ],
      "level": "log",
      "timestamp": 1716778665833
    },
    {
      "message": [
        "Skipping state update due to cooldown period."
      ],
      "level": "log",
      "timestamp": 1716778665833
    }
  ],
  "eventTimestamp": 1716778665648,
  "event": {
    "cron": "* * * * *",
    "scheduledTime": 1716778665000
  },
  "id": 2
}```

Feature Request: Custom Notifications

In the docker container version (I'm working on it rn), I would love to add a volume where you can mount custom “scripts” which then can be used as notification service.

What I am achieving with this?
Well more notifications and some customization options. My main goal is to make ntfy, discord and that stuff available as notification service. Well anything to be honest would be supported by that.

My Idea for mounting those files would be in /app/custom_notifications/. I know this ain't an option for Cloudflare workers. But I strongly believe this is a viable option because a lot of people would rather run a docker container then a Cloudflare Worker (just my opinion).

So now my question is would this be a good idea @lyc8503?

There were response time data record, but still showed 0%

Because my website has IP access restriction on specific countries, so I set specific region routing according to Geo specific checks setup

Before creating the specific region, no response time data could be collected, and the percentage was also 0% (this is normal)

However, after the creation of the routing to the specific region was completed, though response time data could be collected, the percentage was still 0%

Any suggestions? Thanks.

CleanShot 2024-05-10 at 14 34 28@2x

HTTP GET 方式没有响应

你好,lyc8503:我按照你的例子来配置uptimeconfig文件,但是一直没有解决http get网站请求的失败的问题。
配置如下,请给予帮助。谢谢!
1

monitors: [
// Example HTTP Monitor
{
// id should be unique, history will be kept if the id remains constant
id: 'foo_monitor',
// name is used at status page and callback message
name: 'My API Monitor',
method: 'GET',
target: 'http://www.resmtech.com/',
tooltip: 'This is a tooltip for this monitor',
statusPageLink: 'http://www.resmtech.com/',
expectedCodes: [200],
timeout: 10000,
headers: {
'User-Agent': 'Uptimeflare',
Authorization: 'e861ff9e-8c97-4b12-b9c2-8bef3b27ff0d',
},
checkLocationWorkerRoute: 'http://jp.yankeey.top/',
},

新功能建议

非常感谢开发如此功能的服务。提2个新功能建议:

  1. 建议增加分组功能。
  2. 另外每个监控能单独设置 DetailBar和DetailChart的显示与否。

[Feature Request] Grouping

UptimeFlare monitoring is great and very simple,

However, one thing that seems to need to be added is the group feature.
so we can group multiple monitors. so the screen is not full.
imagine if I had 20 monitoring, it would be very long down.

expected :
example expand/collapse for grouping
image

IPv6 support for workers

Hey there 👋,

since most of my sites are only reachable via IPv6 I wanted to ask how to add this to the app. When adding tcp checks on IPv6 addresses the services are always shown as down

为什么一直是百分之0

屏幕截图 2024-05-23 011054
const pageConfig = {
// Title for your status page
title: "CFuptime",
// Links shown at the header of your status page, could set highlight to true
links: [
{ link: 'https://github.com/lyc8503', label: 'GitHub' },
{ link: 'https://blog.lyc8503.site/', label: 'Blog' },
{ link: 'mailto:[email protected]', label: 'Email Me', highlight: true },
],
}

const workerConfig = {
// Write KV at most every 3 minutes unless the status changed.
kvWriteCooldownMinutes: 3,
// Define all your monitors here
monitors: [
// Example HTTP Monitor
{
// id should be unique, history will be kept if the id remains constant
id: 'Serv00Alist',
// name is used at status page and callback message
name: 'serv00的Alist',
// method should be a valid HTTP Method
method: 'GET',
// target is a valid URL
target: 'httpowobaba.rocks/',
statusPageLink: 'hocks/',
expectedCodes: [200-299],
timeout: 5000,
},
{
id: 'uptime',
name: 'colocrossing的Uptime',
method: 'GET',
target: 'https://uptimcluhboard/',
statusPageLink: 'https:zboard/',
expectedCodes: [200-299],
timeout: 5000
},
{
id: 'tiebayunqian',
name: '贴吧云签到',
method: 'GET',
target: 'https://tmsl.h/',
statusPageLink: 'httn-msh/',
expectedCodes: [200-299],
timeout: 5000
},
{
id: 'Serv00nezha',
name: 'Serv00的nezha',
method: 'GET',
target: 'https://nme/',
statusPageLink: 'https://asil.me/',
expectedCodes: [200-299],
timeout: 5000
},
{
id: 'Serv00tgState',
name: 'Serv00的tgState',
method: 'GET',
target: 'htt',
statusPageLink: 'httks/',
expectedCodes: [200-299],
timeout: 5000
},
{
id: 'U2',
name: 'U2动漫花园',
method: 'GET',
target: 'https://u2.dmhy.org/',
statusPageLink: 'https://u2.dmhy.org/',
expectedCodes: [200-299],
timeout: 5000
},
// Example TCP Monitor
{
id: 'test_tcp_monitor',
name: 'colocrossing',
// method should be TCP_PING for tcp monitors
method: 'TCP_PING',
// target should be host:port for tcp monitors
target: '10:22',
tooltip: 'My production server SSH',
timeout: 5000,
},
],
notification: {
// [Optional] apprise API server URL
// if not specified, no notification will be sent
appriseApiServer: "https://apprise.example.com/notify",
// [Optional] recipient URL for apprise, refer to https://github.com/caronc/apprise
// if not specified, no notification will be sent
recipientUrl: "tgram://bottoken/ChatID",
// [Optional] timezone used in notification messages, default to "Etc/GMT"
timeZone: "Asia/Shanghai",
// [Optional] grace period in minutes before sending a notification
// notification will be sent only if the monitor is down for N continuous checks after the initial failure
// if not specified, notification will be sent immediately
gracePeriod: 5,
},
callbacks: {
onStatusChange: async (
env: any,
monitor: any,
isUp: boolean,
timeIncidentStart: number,
timeNow: number,
reason: string
) => {
// This callback will be called when there's a status change for any monitor
// Write any Typescript code here

  // This will not follow the grace period settings and will be called immediately when the status changes
  // You need to handle the grace period manually if you want to implement it
},
onIncident: async (
  env: any,
  monitor: any,
  timeIncidentStart: number,
  timeNow: number,
  reason: string
) => {
  // This callback will be called EVERY 1 MINTUE if there's an on-going incident for any monitor
  // Write any Typescript code here
},

},
}

// Don't forget this, otherwise compilation fails.
export { pageConfig, workerConfig }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.