Louis Lam
3 years ago
42 changed files with 1377 additions and 514 deletions
@ -1,21 +0,0 @@ |
|||
--- |
|||
name: Ask for help |
|||
about: You can ask any question related to Uptime Kuma. |
|||
title: '' |
|||
labels: help |
|||
assignees: '' |
|||
|
|||
--- |
|||
**Is it a duplicated question?** |
|||
Please search in Issues without filters: https://github.com/louislam/uptime-kuma/issues?q= |
|||
|
|||
**Describe your problem** |
|||
Please describe what you are asking for |
|||
|
|||
**Info** |
|||
Uptime Kuma Version: |
|||
Using Docker?: Yes/No |
|||
Docker Version: |
|||
Node.js Version (Without Docker only): |
|||
OS: |
|||
Browser: |
@ -0,0 +1,76 @@ |
|||
name: "❓ Ask for help" |
|||
description: "Submit any question related to Uptime Kuma" |
|||
title: "[Help]: <title>" |
|||
labels: [help] |
|||
body: |
|||
- type: textarea |
|||
id: steps-to-reproduce |
|||
validations: |
|||
required: true |
|||
attributes: |
|||
label: "📝 Describe your problem" |
|||
description: "Please walk us through it step by step." |
|||
placeholder: "Describe what are you asking for..." |
|||
- type: input |
|||
id: uptime-kuma-version |
|||
attributes: |
|||
label: "🐻 Uptime-Kuma version" |
|||
description: "Which version of Uptime-Kuma are you running?" |
|||
placeholder: "Ex. 1.9.x" |
|||
validations: |
|||
required: true |
|||
- type: input |
|||
id: operating-system |
|||
attributes: |
|||
label: "💻 Operating System" |
|||
description: "Which OS is your server/device running on?" |
|||
placeholder: "Ex. Ubuntu 20.04" |
|||
validations: |
|||
required: true |
|||
- type: input |
|||
id: browser-vendor |
|||
attributes: |
|||
label: "🌐 Browser" |
|||
description: "Which browser are you running on?" |
|||
placeholder: "Ex. Firefox" |
|||
validations: |
|||
required: true |
|||
- type: input |
|||
id: docker-version |
|||
attributes: |
|||
label: "🐋 Docker" |
|||
description: "If running with Docker, which version are you running?" |
|||
placeholder: "Ex. 20.10.9" |
|||
validations: |
|||
required: false |
|||
- type: input |
|||
id: docker-image-tag |
|||
attributes: |
|||
label: "🏷️ Docker Image Tag" |
|||
description: "Which Docker image tag are you using? If running '1' or 'latest', please specify image hash." |
|||
placeholder: "Ex. 1.9.1" |
|||
validations: |
|||
required: false |
|||
- type: input |
|||
id: nodejs-version |
|||
attributes: |
|||
label: "🟩 NodeJS Version" |
|||
description: "If running with Node.js? which version are you running?" |
|||
placeholder: "14.x" |
|||
validations: |
|||
required: false |
|||
- type: checkboxes |
|||
id: no-duplicate-issues |
|||
attributes: |
|||
label: "👀 Have you spent some time to check if this question has been raised before?" |
|||
description: "Please search in the issues without filters [here](https://github.com/louislam/uptime-kuma/issues?q=)" |
|||
options: |
|||
- label: "I checked and didn't find similar question" |
|||
required: true |
|||
- type: checkboxes |
|||
attributes: |
|||
label: "🛡️ Security Policy" |
|||
description: Please review the security policy before reporting security related issues/bugs. |
|||
options: |
|||
- label: I agree to have read this project [Security Policy](https://github.com/louislam/uptime-kuma/security/policy) |
|||
required: true |
@ -1,42 +0,0 @@ |
|||
--- |
|||
name: Bug report |
|||
about: Create a report to help us improve |
|||
title: '' |
|||
labels: bug |
|||
assignees: '' |
|||
|
|||
--- |
|||
|
|||
**Is it a duplicated question?** |
|||
Please search in Issues without filters: https://github.com/louislam/uptime-kuma/issues?q= |
|||
|
|||
**Describe the bug** |
|||
A clear and concise description of what the bug is. |
|||
|
|||
**To Reproduce** |
|||
Steps to reproduce the behavior: |
|||
|
|||
1. Go to '...' |
|||
2. Click on '....' |
|||
3. Scroll down to '....' |
|||
4. See error |
|||
|
|||
**Expected behavior** |
|||
A clear and concise description of what you expected to happen. |
|||
|
|||
**Info** |
|||
Uptime Kuma Version: |
|||
Using Docker?: Yes/No |
|||
Docker Version: |
|||
Node.js Version (Without Docker only): |
|||
OS: |
|||
Browser: |
|||
|
|||
**Screenshots** |
|||
If applicable, add screenshots to help explain your problem. |
|||
|
|||
**Error Log** |
|||
It is easier for us to find out the problem. |
|||
|
|||
Docker: `docker logs <container id>` |
|||
PM2: `~/.pm2/logs/` (e.g. `/home/ubuntu/.pm2/logs`) |
@ -0,0 +1,100 @@ |
|||
name: "🐛 Bug Report" |
|||
description: "Submit a bug report to help us improve" |
|||
title: "[Bug]: <title>" |
|||
labels: [bug] |
|||
body: |
|||
- type: textarea |
|||
id: steps-to-reproduce |
|||
validations: |
|||
required: true |
|||
attributes: |
|||
label: "👟 Reproduction steps" |
|||
description: "How do you trigger this bug? Please walk us through it step by step." |
|||
placeholder: "..." |
|||
- type: textarea |
|||
id: expected-behavior |
|||
validations: |
|||
required: true |
|||
attributes: |
|||
label: "👍 Expected behavior" |
|||
description: "What did you think would happen?" |
|||
placeholder: "..." |
|||
- type: textarea |
|||
id: actual-behavior |
|||
validations: |
|||
required: true |
|||
attributes: |
|||
label: "👎 Actual Behavior" |
|||
description: "What actually happen?" |
|||
placeholder: "..." |
|||
- type: input |
|||
id: uptime-kuma-version |
|||
attributes: |
|||
label: "🐻 Uptime-Kuma version" |
|||
description: "Which version of Uptime-Kuma are you running?" |
|||
placeholder: "Ex. 1.9.x" |
|||
validations: |
|||
required: true |
|||
- type: input |
|||
id: operating-system |
|||
attributes: |
|||
label: "💻 Operating System" |
|||
description: "Which OS is your server/device running on?" |
|||
placeholder: "Ex. Ubuntu 20.04" |
|||
validations: |
|||
required: true |
|||
- type: input |
|||
id: browser-vendor |
|||
attributes: |
|||
label: "🌐 Browser" |
|||
description: "Which browser are you running on?" |
|||
placeholder: "Ex. Firefox" |
|||
validations: |
|||
required: true |
|||
- type: input |
|||
id: docker-version |
|||
attributes: |
|||
label: "🐋 Docker" |
|||
description: "If running with Docker, which version are you running?" |
|||
placeholder: "Ex. 20.10.9" |
|||
validations: |
|||
required: false |
|||
- type: input |
|||
id: docker-image-tag |
|||
attributes: |
|||
label: "🏷️ Docker Image Tag" |
|||
description: "Which Docker image tag are you using? If running '1' or 'latest', please specify image hash." |
|||
placeholder: "Ex. 1.9.1" |
|||
validations: |
|||
required: false |
|||
- type: input |
|||
id: nodejs-version |
|||
attributes: |
|||
label: "🟩 NodeJS Version" |
|||
description: "If running with Node.js? which version are you running?" |
|||
placeholder: "14.x" |
|||
validations: |
|||
required: false |
|||
- type: textarea |
|||
id: logs |
|||
attributes: |
|||
label: "📝 Relevant log output" |
|||
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. |
|||
render: shell |
|||
validations: |
|||
required: false |
|||
- type: checkboxes |
|||
id: no-duplicate-issues |
|||
attributes: |
|||
label: "👀 Have you spent some time to check if this issue has been raised before?" |
|||
description: "Please search in the issues without filters [here](https://github.com/louislam/uptime-kuma/issues?q=)" |
|||
options: |
|||
- label: "I checked and didn't find similar issue" |
|||
required: true |
|||
- type: checkboxes |
|||
attributes: |
|||
label: "🛡️ Security Policy" |
|||
description: Please review the security policy before reporting security related issues/bugs. |
|||
options: |
|||
- label: I agree to have read this project [Security Policy](https://github.com/louislam/uptime-kuma/security/policy) |
|||
required: true |
@ -1,22 +0,0 @@ |
|||
--- |
|||
name: Feature request |
|||
about: Suggest an idea for this project |
|||
title: '' |
|||
labels: enhancement |
|||
assignees: '' |
|||
|
|||
--- |
|||
**Is it a duplicated question?** |
|||
Please search in Issues without filters: https://github.com/louislam/uptime-kuma/issues?q= |
|||
|
|||
**Is your feature request related to a problem? Please describe.** |
|||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] |
|||
|
|||
**Describe the solution you'd like** |
|||
A clear and concise description of what you want to happen. |
|||
|
|||
**Describe alternatives you've considered** |
|||
A clear and concise description of any alternative solutions or features you've considered. |
|||
|
|||
**Additional context** |
|||
Add any other context or screenshots about the feature request here. |
@ -0,0 +1,59 @@ |
|||
name: 🚀 Feature Request |
|||
description: "Submit a proposal for a new feature" |
|||
title: "[Feature]: <title>" |
|||
labels: [enhancement] |
|||
body: |
|||
- type: dropdown |
|||
id: feature-area |
|||
attributes: |
|||
label: "🏷️ Feature Request Type" |
|||
description: "What kind of feature request is this?" |
|||
multiple: true |
|||
options: |
|||
- API |
|||
- New Notification |
|||
- New Monitor |
|||
- UI Feature |
|||
- Other |
|||
validations: |
|||
required: true |
|||
- type: textarea |
|||
id: feature-description |
|||
validations: |
|||
required: true |
|||
attributes: |
|||
label: "🔖 Feature description" |
|||
description: "A clear and concise description of what the feature request is." |
|||
placeholder: "You should add ..." |
|||
- type: textarea |
|||
id: solution |
|||
validations: |
|||
required: true |
|||
attributes: |
|||
label: "✔️ Solution" |
|||
description: "A clear and concise description of what you want to happen." |
|||
placeholder: "In my use-case, ..." |
|||
- type: textarea |
|||
id: alternatives |
|||
validations: |
|||
required: false |
|||
attributes: |
|||
label: "❓ Alternatives" |
|||
description: "A clear and concise description of any alternative solutions or features you've considered." |
|||
placeholder: "I have considered ..." |
|||
- type: textarea |
|||
id: additional-context |
|||
validations: |
|||
required: false |
|||
attributes: |
|||
label: "📝 Additional Context" |
|||
description: "Add any other context or screenshots about the feature request here." |
|||
placeholder: "..." |
|||
- type: checkboxes |
|||
id: no-duplicate-issues |
|||
attributes: |
|||
label: "👀 Have you spent some time to check if this feature request has been raised before?" |
|||
description: "Please search in the issues without filters [here](https://github.com/louislam/uptime-kuma/issues?q=)" |
|||
options: |
|||
- label: "I checked and didn't find similar feature request" |
|||
required: true |
@ -0,0 +1,26 @@ |
|||
# Description |
|||
|
|||
Fixes #(issue) |
|||
|
|||
## Type of change |
|||
|
|||
Please delete options that are not relevant. |
|||
|
|||
- Bug fix (non-breaking change which fixes an issue) |
|||
- User Interface |
|||
- New feature (non-breaking change which adds functionality) |
|||
- Breaking change (fix or feature that would cause existing functionality to not work as expected) |
|||
- Translation update |
|||
- Other |
|||
- This change requires a documentation update |
|||
|
|||
## Checklist |
|||
|
|||
- [ ] My code follows the style guidelines of this project |
|||
- [ ] I ran ESLint and other linters for modified files |
|||
- [ ] I have performed a self-review of my own code and test it |
|||
- [ ] I have commented my code, particularly in hard-to-understand areas |
|||
- [ ] My changes generate no new warnings |
|||
- [ ] My code needed automated testing. I have added them (this is optional task) |
|||
|
|||
## Screenshots (if any) |
@ -0,0 +1,89 @@ |
|||
//
|
|||
// bark.js
|
|||
// UptimeKuma
|
|||
//
|
|||
// Created by Lakr Aream on 2021/10/24.
|
|||
// Copyright © 2021 Lakr Aream. All rights reserved.
|
|||
//
|
|||
|
|||
const NotificationProvider = require("./notification-provider"); |
|||
const { DOWN, UP } = require("../../src/util"); |
|||
const { default: axios } = require("axios"); |
|||
|
|||
// bark is an APN bridge that sends notifications to Apple devices.
|
|||
|
|||
const barkNotificationGroup = "UptimeKuma"; |
|||
const barkNotificationAvatar = "https://github.com/louislam/uptime-kuma/raw/master/public/icon.png"; |
|||
const barkNotificationSound = "telegraph"; |
|||
const successMessage = "Successes!"; |
|||
|
|||
class Bark extends NotificationProvider { |
|||
name = "Bark"; |
|||
|
|||
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { |
|||
try { |
|||
var barkEndpoint = notification.barkEndpoint; |
|||
|
|||
// check if the endpoint has a "/" suffix, if so, delete it first
|
|||
if (barkEndpoint.endsWith("/")) { |
|||
barkEndpoint = barkEndpoint.substring(0, barkEndpoint.length - 1); |
|||
} |
|||
|
|||
if (msg != null && heartbeatJSON != null && heartbeatJSON["status"] == UP) { |
|||
let title = "UptimeKuma Monitor Up"; |
|||
return await this.postNotification(title, msg, barkEndpoint); |
|||
} |
|||
|
|||
if (msg != null && heartbeatJSON != null && heartbeatJSON["status"] == DOWN) { |
|||
let title = "UptimeKuma Monitor Down"; |
|||
return await this.postNotification(title, msg, barkEndpoint); |
|||
} |
|||
|
|||
if (msg != null) { |
|||
let title = "UptimeKuma Message"; |
|||
return await this.postNotification(title, msg, barkEndpoint); |
|||
} |
|||
|
|||
} catch (error) { |
|||
throw error; |
|||
} |
|||
} |
|||
|
|||
// add additional parameter for better on device styles (iOS 15 optimized)
|
|||
appendAdditionalParameters(postUrl) { |
|||
// grouping all our notifications
|
|||
postUrl += "?group=" + barkNotificationGroup; |
|||
// set icon to uptime kuma icon, 11kb should be fine
|
|||
postUrl += "&icon=" + barkNotificationAvatar; |
|||
// picked a sound, this should follow system's mute status when arrival
|
|||
postUrl += "&sound=" + barkNotificationSound; |
|||
return postUrl; |
|||
} |
|||
|
|||
// thrown if failed to check result, result code should be in range 2xx
|
|||
checkResult(result) { |
|||
if (result.status == null) { |
|||
throw new Error("Bark notification failed with invalid response!"); |
|||
} |
|||
if (result.status < 200 || result.status >= 300) { |
|||
throw new Error("Bark notification failed with status code " + result.status); |
|||
} |
|||
} |
|||
|
|||
async postNotification(title, subtitle, endpoint) { |
|||
// url encode title and subtitle
|
|||
title = encodeURIComponent(title); |
|||
subtitle = encodeURIComponent(subtitle); |
|||
let postUrl = endpoint + "/" + title + "/" + subtitle; |
|||
postUrl = this.appendAdditionalParameters(postUrl); |
|||
let result = await axios.get(postUrl); |
|||
this.checkResult(result); |
|||
if (result.statusText != null) { |
|||
return "Bark notification succeed: " + result.statusText; |
|||
} |
|||
// because returned in range 200 ..< 300
|
|||
return successMessage; |
|||
} |
|||
} |
|||
|
|||
module.exports = Bark; |
@ -0,0 +1,42 @@ |
|||
const NotificationProvider = require("./notification-provider"); |
|||
const axios = require("axios"); |
|||
|
|||
class ClickSendSMS extends NotificationProvider { |
|||
|
|||
name = "clicksendsms"; |
|||
|
|||
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { |
|||
let okMsg = "Sent Successfully."; |
|||
try { |
|||
console.log({ notification }); |
|||
let config = { |
|||
headers: { |
|||
"Content-Type": "application/json", |
|||
"Authorization": "Basic " + Buffer.from(notification.clicksendsmsLogin + ":" + notification.clicksendsmsPassword).toString('base64'), |
|||
"Accept": "text/json", |
|||
} |
|||
}; |
|||
let data = { |
|||
messages: [ |
|||
{ |
|||
"body": msg.replace(/[^\x00-\x7F]/g, ""), |
|||
"to": notification.clicksendsmsToNumber, |
|||
"source": "uptime-kuma", |
|||
"from": notification.clicksendsmsSenderName, |
|||
} |
|||
] |
|||
}; |
|||
let resp = await axios.post("https://rest.clicksend.com/v3/sms/send", data, config); |
|||
if (resp.data.data.messages[0].status !== "SUCCESS") { |
|||
let error = "Something gone wrong. Api returned " + resp.data.data.messages[0].status + "."; |
|||
this.throwGeneralAxiosError(error); |
|||
} |
|||
|
|||
return okMsg; |
|||
} catch (error) { |
|||
this.throwGeneralAxiosError(error); |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = ClickSendSMS; |
@ -0,0 +1,37 @@ |
|||
const { checkLogin } = require("../util-server"); |
|||
const Database = require("../database"); |
|||
|
|||
module.exports = (socket) => { |
|||
|
|||
// Post or edit incident
|
|||
socket.on("getDatabaseSize", async (callback) => { |
|||
try { |
|||
checkLogin(socket); |
|||
callback({ |
|||
ok: true, |
|||
size: Database.getSize(), |
|||
}); |
|||
} catch (error) { |
|||
callback({ |
|||
ok: false, |
|||
msg: error.message, |
|||
}); |
|||
} |
|||
}); |
|||
|
|||
socket.on("shrinkDatabase", async (callback) => { |
|||
try { |
|||
checkLogin(socket); |
|||
Database.shrink(); |
|||
callback({ |
|||
ok: true, |
|||
}); |
|||
} catch (error) { |
|||
callback({ |
|||
ok: false, |
|||
msg: error.message, |
|||
}); |
|||
} |
|||
}); |
|||
|
|||
}; |
@ -0,0 +1,15 @@ |
|||
<template> |
|||
<div class="mb-3"> |
|||
<label for="Bark Endpoint" class="form-label">{{ $t("Bark Endpoint") }}<span style="color: red;"><sup>*</sup></span></label> |
|||
<input id="Bark Endpoint" v-model="$parent.notification.barkEndpoint" type="text" class="form-control" required> |
|||
<div class="form-text"> |
|||
<p><span style="color: red;"><sup>*</sup></span>{{ $t("Required") }}</p> |
|||
</div> |
|||
<i18n-t tag="div" keypath="wayToGetTeamsURL" class="form-text"> |
|||
<a |
|||
href="https://github.com/Finb/Bark" |
|||
target="_blank" |
|||
>{{ $t("here") }}</a> |
|||
</i18n-t> |
|||
</div> |
|||
</template> |
@ -0,0 +1,38 @@ |
|||
<template> |
|||
<div class="mb-3"> |
|||
<label for="clicksendsms-login" class="form-label">API Username</label> |
|||
<div class="form-text"> |
|||
{{ $t("apiCredentials") }} |
|||
<a href="http://dashboard.clicksend.com/account/subaccounts" target="_blank">here</a> |
|||
</div> |
|||
<input id="clicksendsms-login" v-model="$parent.notification.clicksendsmsLogin" type="text" class="form-control" required> |
|||
<label for="clicksendsms-key" class="form-label">API Key</label> |
|||
<HiddenInput id="clicksendsms-key" v-model="$parent.notification.clicksendsmsPassword" :required="true" autocomplete="one-time-code"></HiddenInput> |
|||
</div> |
|||
<div class="mb-3"> |
|||
<div class="form-text"> |
|||
{{ $t("checkPrice", [$t("clicksendsms")]) }} |
|||
<a href="https://www.clicksend.com/us/pricing" target="_blank">https://clicksend.com/us/pricing</a> |
|||
</div> |
|||
</div> |
|||
<div class="mb-3"> |
|||
<label for="clicksendsms-to-number" class="form-label">Recipient Number</label> |
|||
<input id="clicksendsms-to-number" v-model="$parent.notification.clicksendsmsToNumber" type="text" minlength="8" maxlength="14" class="form-control" required> |
|||
</div> |
|||
<div class="mb-3"> |
|||
<label for="clicksendsms-sender-name" class="form-label">From Name/Number - |
|||
<a href="https://help.clicksend.com/article/4kgj7krx00-what-is-a-sender-id-or-sender-number" target="_blank">More Info</a> |
|||
</label> |
|||
<input id="clicksendsms-sender-name" v-model="$parent.notification.clicksendsmsSenderName" type="text" minlength="3" maxlength="11" class="form-control"> |
|||
<div class="form-text">Leave blank to use a shared sender number.</div> |
|||
</div> |
|||
</template> |
|||
<script> |
|||
import HiddenInput from "../HiddenInput.vue"; |
|||
|
|||
export default { |
|||
components: { |
|||
HiddenInput, |
|||
}, |
|||
}; |
|||
</script> |
Loading…
Reference in new issue