Merge branch 'master' into feature/locale_on_status_page

This commit is contained in:
Wampie Driessen 2025-06-03 22:20:10 +02:00 committed by GitHub
commit 41a6b1f40f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
148 changed files with 10895 additions and 3622 deletions

View file

@ -32,7 +32,6 @@ tsconfig.json
/extra/healthcheck.exe /extra/healthcheck.exe
/extra/healthcheck /extra/healthcheck
/extra/exe-builder /extra/exe-builder
/extra/push-examples
/extra/uptime-kuma-push /extra/uptime-kuma-push
# Comment the following line if you want to rebuild the healthcheck binary # Comment the following line if you want to rebuild the healthcheck binary

View file

@ -1,75 +0,0 @@
name: "❓ Ask for help"
description: "Submit any question related to Uptime Kuma"
#title: "[Help] "
labels: [help]
body:
- type: checkboxes
id: no-duplicate-issues
attributes:
label: "⚠️ Please verify that this question has NOT been raised before."
description: "Search in the issues sections by clicking [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
- type: textarea
id: steps-to-reproduce
validations:
required: true
attributes:
label: "📝 Describe your problem"
description: "Please walk us through it step by step. Include all important details and add screenshots where appropriate"
placeholder: "Describe what are you asking for..."
- type: textarea
id: error-msg
validations:
required: false
attributes:
label: "📝 Error Message(s) or Log"
- type: input
id: uptime-kuma-version
attributes:
label: "🐻 Uptime-Kuma Version"
description: "Which version of Uptime-Kuma are you running? Please do NOT provide the docker tag such as latest or 1"
placeholder: "Ex. 1.10.0"
validations:
required: true
- type: input
id: operating-system
attributes:
label: "💻 Operating System and Arch"
description: "Which OS is your server/device running on? (For Replit, please do not report this bug)"
placeholder: "Ex. Ubuntu 20.04 x86"
validations:
required: true
- type: input
id: browser-vendor
attributes:
label: "🌐 Browser"
description: "Which browser are you running on? (For Replit, please do not report this bug)"
placeholder: "Ex. Google Chrome 95.0.4638.69"
validations:
required: true
- type: textarea
id: deployment-info
attributes:
label: "🖥️ Deployment Environment"
description: |
examples:
- **Runtime**: Docker 20.10.9 / nodejs 14.18.0 / K8S via ... v1.3.3 / ..
- **Database**: sqlite/embedded mariadb/external mariadb
- **Filesystem used to store the database on**: Windows/ZFS/btrfs/NFSv3 on a SSD/HDD/eMMC
- **number of monitors**: 42
value: |
- Runtime:
- Database:
- Filesystem used to store the database on:
- number of monitors:
validations:
required: true

120
.github/ISSUE_TEMPLATE/ask_for_help.yml vendored Normal file
View file

@ -0,0 +1,120 @@
---
name: ❓ Ask for help
description: |
Submit any question related to Uptime Kuma
#title: "[Help]"
labels: ["help", "P3-low"]
body:
- type: markdown
attributes:
value: |
🚫 **We kindly ask you to refrain from pinging maintainers unless absolutely necessary. Pings are reserved for critical/urgent issues that require immediate attention.**
**Why**: Reserving pings for urgent matters ensures maintainers can prioritize critical tasks effectively
- type: checkboxes
id: no-duplicate-question
attributes:
label: ⚠️ Please verify that your question has not already been reported
description: |
To avoid duplicate reports, please search for any existing issues before submitting a new one. You can find the list of existing issues **[HERE](https://github.com/louislam/uptime-kuma/issues?q=is%3Aissue%20sort%3Acreated-desc%20)**.
options:
- label: |
I have searched the [existing issues](https://github.com/louislam/uptime-kuma/issues?q=is%3Aissue%20sort%3Acreated-desc%20) and found no similar reports.
required: true
- type: checkboxes
id: security-policy
attributes:
label: 🛡️ Security Policy
description: |
Please review and acknowledge the Security Policy before reporting any security-related issues or bugs. You can find the full Security Policy **[HERE](https://github.com/louislam/uptime-kuma/security/policy)**.
options:
- label: |
I have read and agree to Uptime Kuma's [Security Policy](https://github.com/louislam/uptime-kuma/security/policy).
required: true
- type: textarea
id: steps-to-reproduce
validations:
required: true
attributes:
label: 📝 Describe your problem
description: |
Please walk us through it step by step. Include all important details and add screenshots where appropriate
placeholder: |
Describe what are you asking for ...
- type: textarea
id: error-msg
attributes:
label: 📝 Error Message(s) or Log
description: |
Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: bash session
validations:
required: false
- type: input
id: uptime-kuma-version
attributes:
label: 🐻 Uptime-Kuma Version
description: |
What version of Uptime-Kuma are you running? Please do not provide Docker tags like `latest` or `1`.
placeholder: |
e.g., 1.23.16 or 2.0.0-beta.2
validations:
required: true
- type: input
id: operating-system
attributes:
label: 💻 Operating System and Arch
description: |
Which OS is your server/device running on? (For Replit, please do not report this bug)
placeholder: |
e.g., Ubuntu Server 24.04.2 LTS (GNU/Linux 6.8.0-55-generic x86_64)
validations:
required: true
- type: input
id: browser-vendor
attributes:
label: 🌐 Browser
description: |
Which browser are you running on? (For Replit, please do not report this bug)
placeholder: |
e.g., Google Chrome 134.0.6998.183 (Official Build) (64-bit)
validations:
required: true
- type: textarea
id: deployment-info
attributes:
label: 🖥️ Deployment Environment
description: |
Provide details about the deployment environment, including runtime components, databases, and storage configurations. This will
help assess the infrastructure and identify any potential compatibility requirements.
**Remove any fields that do not apply to your setup.**
value: |
- **Runtime Environment**:
- Docker: Version `X.X.X` (Build `Y.Y.Y`)
- Docker Compose: Version `X.X.X`
- Portainer (BE/CE): Version `X.X.X` (LTS: Yes/No)
- MariaDB: Version `X.X.X` (LTS: Yes/No)
- Node.js: Version `X.X.X` (LTS: Yes/No)
- Kubernetes (K3S/K8S): Version `X.X.X` (LTS: Yes/No, via `[method/tool]`)
- **Database**:
- SQLite: Embedded
- MariaDB: Embedded/External
- **Database Storage**:
- **Filesystem**:
- Linux: ext4/XFS/Btrfs/ZFS/F2FS
- macOS: APFS/ HFS+
- Windows: NTFS/ReFS
- **Storage Medium**: HDD/eMMC/SSD/NVMe
- **Uptime Kuma Setup**:
- Number of monitors: `X`
validations:
required: true

View file

@ -1,100 +0,0 @@
name: "🐛 Bug Report"
description: "Submit a bug report to help us improve"
#title: "[Bug] "
labels: [bug]
body:
- type: textarea
id: related-issues
validations:
required: true
attributes:
label: "📑 I have found these related issues/pull requests"
description: "Search related issues by clicking [HERE](https://github.com/louislam/uptime-kuma/issues?q=) and explain what the difference between them or explain that you are unable to find any related issues"
placeholder: "Related to #1 by also touching the ... system. They should not be merged because ..."
- 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
- type: textarea
id: description
validations:
required: false
attributes:
label: "Description"
description: "You could also upload screenshots"
- 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. Include all important details and add screenshots where appropriate"
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? Please do NOT provide the docker tag such as latest or 1"
placeholder: "Ex. 1.10.0"
validations:
required: true
- type: input
id: operating-system
attributes:
label: "💻 Operating System and Arch"
description: "Which OS is your server/device running on? (For Replit, please do not report this bug)"
placeholder: "Ex. Ubuntu 20.04 x64 "
validations:
required: true
- type: input
id: browser-vendor
attributes:
label: "🌐 Browser"
description: "Which browser are you running on?"
placeholder: "Ex. Google Chrome 95.0.4638.69"
validations:
required: true
- type: textarea
id: deployment-info
attributes:
label: "🖥️ Deployment Environment"
description: |
examples:
- **Runtime**: Docker 20.10.9 / nodejs 18.17.1 / K8S via ... v1.3.3 / ..
- **Database**: sqlite/embedded mariadb/external mariadb
- **Filesystem used to store the database on**: Windows/ZFS/btrfs/NFSv3 on a SSD/HDD/eMMC
- **number of monitors**: 42
value: |
- Runtime:
- Database:
- Filesystem used to store the database on:
- number of monitors:
validations:
required: true
- 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

154
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View file

@ -0,0 +1,154 @@
---
name: 🐛 Bug Report
description: |
Submit a bug report to help us improve
#title: "[Bug]"
labels: ["bug", "P2-medium"]
body:
- type: markdown
attributes:
value: |
🚫 **We kindly ask you to refrain from pinging maintainers unless absolutely necessary. Pings are reserved for critical/urgent issues that require immediate attention.**
**Why**: Reserving pings for urgent matters ensures maintainers can prioritize critical tasks effectively
- type: textarea
id: related-issues
validations:
required: true
attributes:
label: 📑 I have found these related issues/pull requests
description: |
Please search for related **[ISSUES](https://github.com/louislam/uptime-kuma/issues?q=is%3Aissue%20sort%3Acreated-desc)**
and **[PULL REQUESTS](https://github.com/louislam/uptime-kuma/pulls?q=is%3Apr+sort%3Acreated-desc+)**.
Explain the differences between them or clarify if you were unable to find any related issues/pull requests.
placeholder: |
Example: This relates to issue #1, which also affects the ... system. It should not be merged because ...
- type: checkboxes
id: security-policy
attributes:
label: 🛡️ Security Policy
description: |
Please review and acknowledge the Security Policy before reporting any security-related issues or bugs. You can find the full Security Policy **[HERE](https://github.com/louislam/uptime-kuma/security/policy)**.
options:
- label: |
I have read and agree to Uptime Kuma's [Security Policy](https://github.com/louislam/uptime-kuma/security/policy).
required: true
- type: textarea
id: description
validations:
required: false
attributes:
label: 📝 Description
description: |
You could also upload screenshots
- 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. Include all important details and add screenshots where appropriate
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: |
What version of Uptime-Kuma are you running? Please do not provide Docker tags like `latest` or `1`.
placeholder: |
e.g., 1.23.16 or 2.0.0-beta.2
validations:
required: true
- type: input
id: operating-system
attributes:
label: 💻 Operating System and Arch
description: |
Which OS is your server/device running on? (For Replit, please do not
report this bug)
placeholder: |
e.g., Ubuntu Server 24.04.2 LTS (GNU/Linux 6.8.0-55-generic x86_64)
validations:
required: true
- type: input
id: browser-vendor
attributes:
label: 🌐 Browser
description: |
Which browser are you running on?
placeholder: |
e.g., Google Chrome 134.0.6998.183 (Official Build) (64-bit)
validations:
required: true
- type: textarea
id: deployment-info
attributes:
label: 🖥️ Deployment Environment
description: |
Provide details about the deployment environment, including runtime components, databases, and storage configurations. This will
help assess the infrastructure and identify any potential compatibility requirements.
**Remove any fields that do not apply to your setup.**
value: |
- **Runtime Environment**:
- Docker: Version `X.X.X` (Build `Y.Y.Y`)
- Docker Compose: Version `X.X.X`
- Portainer (BE/CE): Version `X.X.X` (LTS: Yes/No)
- MariaDB: Version `X.X.X` (LTS: Yes/No)
- Node.js: Version `X.X.X` (LTS: Yes/No)
- Kubernetes (K3S/K8S): Version `X.X.X` (LTS: Yes/No, via `[method/tool]`)
- **Database**:
- SQLite: Embedded
- MariaDB: Embedded/External
- **Database Storage**:
- **Filesystem**:
- Linux: ext4/XFS/Btrfs/ZFS/F2FS
- macOS: APFS/ HFS+
- Windows: NTFS/ReFS
- **Storage Medium**: HDD/eMMC/SSD/NVMe
- **Uptime Kuma Setup**:
- Number of monitors: `X`
validations:
required: true
- 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: bash session
validations:
required: false

2
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View file

@ -0,0 +1,2 @@
---
blank_issues_enabled: false

View file

@ -1,66 +0,0 @@
name: 🚀 Feature Request
description: "Submit a proposal for a new feature"
#title: "[Feature] "
labels: [feature-request]
body:
- type: textarea
id: related-issues
validations:
required: true
attributes:
label: "📑 I have found these related issues/pull requests"
description: "Search related issues by clicking [HERE](https://github.com/louislam/uptime-kuma/issues?q=) and explain what the difference between them or explain that you are unable to find any related issues"
placeholder: "Related to #1 by also touching the ... system. They should not be merged because ..."
- type: dropdown
id: feature-area
attributes:
label: "🏷️ Feature Request Type"
description: "What kind of feature request is this?"
multiple: true
options:
- API / automation options
- New notification-provider
- Change to existing notification-provider
- New monitor
- Change to existing monitor
- Dashboard
- Status-page
- Maintenance
- Deployment
- Certificate expiry
- Settings
- 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: "..."

View file

@ -0,0 +1,106 @@
---
name: 🚀 Feature Request
description: |
Submit a proposal for a new feature
# title: "[Feature]"
labels: ["feature-request", "P3-low"]
body:
- type: markdown
attributes:
value: |
## ❗Important Announcement
### 🚧 Temporary Delay in Feature Requests and Pull Request Reviews
**At this time, we may be slower to respond to new feature requests and review pull requests. Existing requests and PRs will remain in the backlog but may not be prioritized immediately.**
- **Reason**: Our current focus is on addressing bugs, improving system performance, and implementing essential updates. This will help stabilize the project and ensure smoother management.
- **Impact**: While no new feature requests or pull requests are being outright rejected, there may be significant delays in reviews. We encourage the community to help by reviewing PRs or assisting other users in the meantime.
- **What You Can Do**: If you're interested in contributing, reviewing open PRs by following our [Review Guidelines](https://github.com/louislam/uptime-kuma/blob/master/.github/REVIEW_GUIDELINES.md) or offering help to other users is greatly appreciated. All feature requests and PRs will be revisited once the suspension period is lifted.
We appreciate your patience and understanding as we continue to improve Uptime Kuma.
### 🚫 Please Avoid Unnecessary Pinging of Maintainers
**We kindly ask you to refrain from pinging maintainers unless absolutely necessary. Pings are reserved for critical/urgent pull requests that require immediate attention.**
**Why**: Reserving pings for urgent matters ensures maintainers can prioritize critical tasks effectively.
- type: textarea
id: related-issues
validations:
required: true
attributes:
label: 📑 I have found these related issues/pull requests
description: |
Please search for related **[ISSUES](https://github.com/louislam/uptime-kuma/issues?q=is%3Aissue%20sort%3Acreated-desc)**
and **[PULL REQUESTS](https://github.com/louislam/uptime-kuma/pulls?q=is%3Apr+sort%3Acreated-desc+)**.
Explain the differences between them or clarify if you were unable to find any related issues/pull requests.
placeholder: |
Example: This relates to issue #1, which also affects the ... system. It should not be merged because ...
- type: dropdown
id: feature-area
attributes:
label: 🏷️ Feature Request Type
description: |
What kind of feature request is this?
multiple: true
options:
- API / automation options
- New notification-provider
- Change to existing notification-provider
- New monitor
- Change to existing monitor
- Dashboard
- Status-page
- Maintenance
- Deployment
- Certificate expiry
- Settings
- 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: |
...

View file

@ -1,17 +0,0 @@
---
name: "Security Issue"
about: "Just for alerting @louislam, do not provide any details here"
title: "Security Issue"
ref: "main"
labels:
- security
---
DO NOT PROVIDE ANY DETAILS HERE. Please privately report to https://github.com/louislam/uptime-kuma/security/advisories/new.
Why need this issue? It is because GitHub Advisory do not send a notification to @louislam, it is a workaround to do so.
Your GitHub Advisory URL:

View file

@ -0,0 +1,45 @@
---
name: 🛡️ Security Issue
description: |
Notify Louis Lam about a security concern. Please do NOT include any sensitive details in this issue.
# title: "Security Issue"
labels: ["security", "P1-high"]
assignees: [louislam]
body:
- type: markdown
attributes:
value: |
## ❗ IMPORTANT: DO NOT SHARE VULNERABILITY DETAILS HERE
### ⚠️ Report a Security Vulnerability
**If you have discovered a security vulnerability, please report it securely using the GitHub Security Advisory.**
**Note**: This issue is only for notifying the maintainers of the repository, as the GitHub Security Advisory does not automatically send notifications.
- **Confidentiality**: The information you provide in the GitHub Security Advisory will initially remain confidential. However, once the vulnerability is addressed, the advisory will be publicly disclosed on GitHub.
- **Access and Visibility**: Until the advisory is published, it will only be visible to the maintainers of the repository and invited collaborators.
- **Credit**: You will be automatically credited as a contributor for identifying and reporting the vulnerability. Your contribution will be reflected in the MITRE Credit System.
- **Important Reminder**: **Do not include any sensitive or detailed vulnerability information in this issue.** This issue is only for sharing the advisory URL to notify the maintainers of the repository, not for discussing the vulnerability itself.
**Thank you for helping us keep Uptime Kuma secure!**
## **Step 1: Submit a GitHub Security Advisory**
Right-click the link below and select `Open link in new tab` to access the page. This will keep the security issue open, allowing you to easily return and paste the Advisory URL here later.
➡️ [Create a New Security Advisory](https://github.com/louislam/uptime-kuma/security/advisories/new)
## **Step 2: Share the Advisory URL**
Once you've created your advisory, please share the URL below. This will notify Louis Lam and enable them to take the appropriate action.
- type: textarea
id: github-advisory-url
validations:
required: true
attributes:
label: GitHub Advisory URL for @louislam
placeholder: |
Please paste the GitHub Advisory URL here. Only the URL is required.
Example: https://github.com/louislam/uptime-kuma/security/advisories/GHSA-8h5r-7t6l-q3kz

View file

@ -1,33 +1,122 @@
⚠️⚠️⚠️ Since we do not accept all types of pull requests and do not want to waste your time. Please be sure that you have read pull request rules: **⚠️ Please Note: We do not accept all types of pull requests, and we want to ensure we dont waste your time. Before submitting, make sure you have read our pull request guidelines: [Pull Request Rules](https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma)**
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma
Tick the checkbox if you understand [x]: ## ❗ Important Announcement
- [ ] I have read and understand the pull request rules.
# Description <details><summary>Click here for more details:</summary>
</p>
Fixes #(issue) ### 🚧 Temporary Delay in Feature Requests and Pull Request Reviews
## Type of change **At this time, we may be slower to respond to new feature requests and review pull requests. Existing requests and PRs will remain in the backlog but may not be prioritized immediately.**
Please delete any options that are not relevant. - **Reason**: Our current focus is on addressing bugs, improving system performance, and implementing essential updates. This will help stabilize the project and ensure smoother management.
- **Impact**: While no new feature requests or pull requests are being outright rejected, there may be significant delays in reviews. We encourage the community to help by reviewing PRs or assisting other users in the meantime.
- **What You Can Do**: If you're interested in contributing, reviewing open PRs by following our [Review Guidelines](https://github.com/louislam/uptime-kuma/blob/master/.github/REVIEW_GUIDELINES.md) or offering support to other users is greatly appreciated. All feature requests and PRs will be revisited once the suspension period is lifted.
- Bug fix (non-breaking change which fixes an issue) We appreciate your patience and understanding as we continue to improve Uptime Kuma.
- User interface (UI)
- New feature (non-breaking change which adds functionality)
- Breaking change (a fix or feature that would cause existing functionality to not work as expected)
- Other
- This change requires a documentation update
## Checklist ### 🚫 Please Avoid Unnecessary Pinging of Maintainers
- [ ] My code follows the style guidelines of this project **We kindly ask you to refrain from pinging maintainers unless absolutely necessary. Pings are reserved for critical/urgent pull requests that require immediate attention.**
- [ ] I ran ESLint and other linters for modified files
- [ ] I have performed a self-review of my own code and tested it
- [ ] I have commented my code, particularly in hard-to-understand areas (including JSDoc for methods)
- [ ] My changes generates no new warnings
- [ ] My code needed automated testing. I have added them (this is optional task)
## Screenshots (if any) **Why**: Reserving pings for urgent matters ensures maintainers can prioritize critical tasks effectively.
Please do not use any external image service. Instead, just paste in or drag and drop the image here, and it will be uploaded automatically. </p>
</details>
## 📋 Overview
Provide a clear summary of the purpose and scope of this pull request:
- **What problem does this pull request address?**
- Please provide a detailed explanation here.
- **What features or functionality does this pull request introduce or enhance?**
- Please provide a detailed explanation here.
## 🔄 Changes
### 🛠️ Type of change
<!-- Please select all options that apply -->
- [ ] 🐛 Bugfix (a non-breaking change that resolves an issue)
- [ ] ✨ New feature (a non-breaking change that adds new functionality)
- [ ] ⚠️ Breaking change (a fix or feature that alters existing functionality in a way that could cause issues)
- [ ] 🎨 User Interface (UI) updates
- [ ] 📄 New Documentation (addition of new documentation)
- [ ] 📄 Documentation Update (modification of existing documentation)
- [ ] 📄 Documentation Update Required (the change requires updates to related documentation)
- [ ] 🔧 Other (please specify):
- Provide additional details here.
## 🔗 Related Issues
<!--
Please link any GitHub issues or tasks that this pull request addresses. Use the appropriate issue numbers or links.
**Note**: Include only issues directly related to this PR. Remove any irrelevant reference.
-->
- Relates to #issue-number
- Resolves #issue-number
- Fixes #issue-number
## 📄 Checklist *
<!-- Please select all options that apply -->
- [ ] 🔍 My code adheres to the style guidelines of this project.
- [ ] ✅ I ran ESLint and other code linters for modified files.
- [ ] 🛠️ I have reviewed and tested my code.
- [ ] 📝 I have commented my code, especially in hard-to-understand areas (e.g., using JSDoc for methods).
- [ ] ⚠️ My changes generate no new warnings.
- [ ] 🤖 My code needed automated testing. I have added them (this is an optional task).
- [ ] 📄 Documentation updates are included (if applicable).
- [ ] 🔒 I have considered potential security impacts and mitigated risks.
- [ ] 🧰 Dependency updates are listed and explained.
- [ ] 📚 I have read and understood the [Pull Request guidelines](https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#recommended-pull-request-guideline).
## 📷 Screenshots or Visual Changes
<!--
Please upload the image directly here by pasting it or dragging and dropping. Avoid using external image services as the image will be uploaded automatically.
If this pull request introduces visual changes, please provide the following details.
If not, remove this section.
-->
- **UI Modifications**: Highlight any changes made to the user interface.
- **Before & After**: Include screenshots or comparisons (if applicable).
| Event | Before | After |
| ------------------ | --------------------- | -------------------- |
| `UP` | ![Before](image-link) | ![After](image-link) |
| `DOWN` | ![Before](image-link) | ![After](image-link) |
| Certificate-expiry | ![Before](image-link) | ![After](image-link) |
| Testing | ![Before](image-link) | ![After](image-link) |
## Additional Context
Provide any relevant details to assist reviewers in understanding the changes.
<details><summary>Click here for more details:</summary>
</p>
**Key Considerations**:
- **Design decisions** Key choices or trade-offs made during development.
- **Alternative solutions** Approaches considered but not implemented, along with reasons.
- **Relevant links** Specifications, discussions, or resources that provide context.
- **Dependencies** Related pull requests or issues that must be resolved before merging.
- **Additional context** Any other details that may help reviewers understand the changes.
Provide details here
## 💬 Requested Feedback
<!-- If a part of our docs is unclear, you are unsure how to do something/.. this is where we would appreciate your feedback -->
- `Mention documents needing feedback here`

224
.github/REVIEW_GUIDELINES.md vendored Normal file
View file

@ -0,0 +1,224 @@
# Uptime Kuma Review Guidelines
> [!NOTE]
> These review guidelines are a work in progress, and are frequently
> updated and improved, so please check back frequently for the latest version.
## Preparing for a PR Review
### Read the PR description carefully
Make sure you understand what the PR is trying to solve or implement. This could
be a bug fix, a new feature, or a refactor.
### Check the linked issues
If the PR has a linked issue, read it to better understand the context and the
reason for the change.
### Check the test coverage
Make sure relevant tests have been added or modified. If the PR adds new
functionality, there should be tests covering the change.
## General Review
### Code formatting and style
Check if the code adheres to the style guidelines of the project. Make sure
there are no unused imports, variables, `console.log` for debugging in the PR.
- [Project Style](../CONTRIBUTING.md#project-styles)
- [Coding Style](../CONTRIBUTING.md#coding-styles)
### Readability and maintainability
Is the code easy to understand for other developers? Make sure complex parts are
explained with comments about **_why_** something is done, and use clear names
to show **_how_**. Are variables and functions well-named, and is there a
consistent naming style? Also, check if the code is maintainable:
- Is it unnecessarily complex? Could it be simplified?
- Does it follow the **[Single Responsibility Principle (SRP)]**?
[Single Responsibility Principle (SRP)]: https://www.geeksforgeeks.org/single-responsibility-in-solid-design-principle/
### Documentation
Is the PR well documented? Check if the descriptions of functions, parameters,
and return values are present. Are there any changes needed to the README or
other documentation, for example, if new features or configurations are
introduced?
## Functional Review
### Testing
Ensure that the new code is properly tested. This includes unit tests,
integration tests, and if necessary, end-to-end tests.
### Test results
Did all tests pass in the CI pipeline (e.g., GitHub Actions, Travis, CircleCI)?
### Testing in different environments
If the changes depend on certain environments or configurations, verify that the
code has been tested in various environments (e.g., local development, staging,
production).
- [How to test Pull Requests](https://github.com/louislam/uptime-kuma/wiki/Test-Pull-Requests)
### Edge cases and regressions
- Are there test cases for possible edge cases?
- Could this change introduce regressions in other parts of the system?
## Security
### Security issues
Check for potential security problems, such as SQL injection, XSS attacks, or
unsafe API calls. Are there passwords, tokens, or other sensitive data left in
the code by mistake?
### Authentication and authorization
Is access to sensitive data or functionality properly secured? Check that the
correct authorization and authentication mechanisms are in place.
### Security Best Practices
- Ensure that the code is free from common vulnerabilities like **SQL
injection**, **XSS attacks**, and **insecure API calls**.
- Check for proper encryption of sensitive data, and ensure that **passwords**
or **API tokens** are not hardcoded in the code.
## Performance
### Performance impact
Check if the changes negatively impact performance. This can include factors
like load times, memory usage, or other performance aspects.
### Use of external libraries
- Have the right libraries been chosen?
- Are there unnecessary dependencies that might reduce performance or increase
code complexity?
- Are these dependencies actively maintained and free of known vulnerabilities?
### Performance Best Practices
- **Measure performance** using tools like Lighthouse or profiling libraries.
- **Avoid unnecessary dependencies** that may bloat the codebase.
- Ensure that the **code does not degrade the user experience** (e.g., by
increasing load times or memory consumption).
## Compliance and Integration
### Alignment with the project
Are the changes consistent with the project goals and requirements? Ensure the
PR aligns with the architecture and design principles of the project.
### Integration
If the PR depends on other PRs or changes, verify that they integrate well with
the rest of the project. Ensure the code does not cause conflicts with other
active PRs.
### Backward compatibility
Does the change break compatibility with older versions of the software or
dependencies? If so, is there a migration plan in place?
## Logging and Error Handling
### Proper error handling
- Are errors properly caught and handled instead of being silently ignored?
- Are exceptions used appropriately?
### Logging
- Is sufficient logging included for debugging and monitoring?
- Is there excessive logging that could affect performance?
## Accessibility (for UI-related changes)
If the PR affects the user interface, ensure that it meets accessibility
standards:
- Can users navigate using only the keyboard?
- Are screen readers supported?
- Is there proper color contrast for readability?
- Are there **WCAG** (Web Content Accessibility Guidelines) compliance issues?
- Use tools like **Axe** or **Lighthouse** to evaluate accessibility.
## Providing Feedback
### Constructive feedback
Provide clear, constructive feedback on what is good and what can be improved.
If improvements are needed, be specific about what should change.
### Clarity and collaboration
Ensure your feedback is friendly and open, so the team member who submitted the
PR feels supported and motivated to make improvements.
<details><summary><b>For Maintainers only</b> (click to expand)</summary>
<p>
## Go/No-Go Decision
### Go
If the code has no issues and meets the project requirements, approve it (and
possibly merge it).
### No-Go
If there are significant issues, such as missing tests, security
vulnerabilities, or performance problems, request the necessary changes before
the PR can be approved. Some examples of **significant issues** include:
- Missing tests for new functionality.
- Identified **security vulnerabilities**.
- Code changes that break **backward compatibility** without a proper migration
plan.
- Code that causes **major performance regressions** (e.g., high CPU/memory
usage).
## After the Review
### Reordering and merging
Once the necessary changes have been made and the PR is approved, the code can
be merged into the main branch (e.g., `main` or `master`).
### Testing after merging
Ensure that the build passes after merging the PR, and re-test the functionality
in the production environment if necessary.
## Follow-up
### Communication with team members
If the PR has long-term technical or functional implications, communicate the
changes to the team.
### Monitoring
Continue monitoring the production environment for any unexpected issues that
may arise after the code has been merged.
</p>
</details>
---
This process ensures that PRs are systematically and thoroughly reviewed,
improving overall code quality.

View file

@ -78,7 +78,7 @@ jobs:
e2e-test: e2e-test:
needs: [ ] needs: [ ]
runs-on: ARM64 runs-on: ubuntu-24.04-arm
steps: steps:
- run: git config --global core.autocrlf false # Mainly for Windows - run: git config --global core.autocrlf false # Mainly for Windows
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View file

@ -6,8 +6,8 @@ We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status, identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity nationality, personal appearance, race, caste, color, religion, or sexual
and orientation. identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming, We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community. diverse, inclusive, and healthy community.
@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our Examples of behavior that contributes to a positive environment for our
community include: community include:
* Demonstrating empathy and kindness toward other people - Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences - Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback - Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, - Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience and learning from the experience
* Focusing on what is best not just for us as individuals, but for the - Focusing on what is best not just for us as individuals, but for the overall
overall community community
Examples of unacceptable behavior include: Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or - The use of sexualized language or imagery, and sexual attention or advances of
advances of any kind any kind
* Trolling, insulting or derogatory comments, and personal or political attacks - Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment - Public or private harassment
* Publishing others' private information, such as a physical or email - Publishing others' private information, such as a physical or email address,
address, without their explicit permission without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a - Other conduct which could reasonably be considered inappropriate in a
professional setting professional setting
## Enforcement Responsibilities ## Enforcement Responsibilities
@ -52,7 +52,7 @@ decisions when appropriate.
This Code of Conduct applies within all community spaces, and also applies when This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces. an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address, Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed posting via an official social media account, or acting as an appointed
representative at an online or offline event. representative at an online or offline event.
@ -60,8 +60,8 @@ representative at an online or offline event.
Instances of abusive, harassing, or otherwise unacceptable behavior may be Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at reported to the community leaders responsible for enforcement at
uptime@kuma.pet. <uptime@kuma.pet>. All complaints will be reviewed and investigated promptly and
All complaints will be reviewed and investigated promptly and fairly. fairly.
All community leaders are obligated to respect the privacy and security of the All community leaders are obligated to respect the privacy and security of the
reporter of any incident. reporter of any incident.
@ -82,15 +82,15 @@ behavior was inappropriate. A public apology may be requested.
### 2. Warning ### 2. Warning
**Community Impact**: A violation through a single incident or series **Community Impact**: A violation through a single incident or series of
of actions. actions.
**Consequence**: A warning with consequences for continued behavior. No **Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or like social media. Violating these terms may lead to a temporary or permanent
permanent ban. ban.
### 3. Temporary Ban ### 3. Temporary Ban
@ -109,20 +109,24 @@ Violating these terms may lead to a permanent ban.
standards, including sustained inappropriate behavior, harassment of an standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals. individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within **Consequence**: A permanent ban from any sort of public interaction within the
the community. community.
## Attribution ## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at version 2.1, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
Community Impact Guidelines were inspired by [Mozilla's code of conduct Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity). enforcement ladder][Mozilla CoC].
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
https://www.contributor-covenant.org/translations. [https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations

View file

@ -1,16 +1,18 @@
# Project Info # Project Info
First of all, I want to thank everyone who has submitted issues or shared pull requests for Uptime Kuma. First of all, I want to thank everyone who has submitted issues or shared pull
I never thought the GitHub community would be so nice! requests for Uptime Kuma. I never thought the GitHub community would be so nice!
Because of this, I also never thought that other people would actually read and edit my code. Because of this, I also never thought that other people would actually read and
Parts of the code are not very well-structured or commented, sorry about that. edit my code. Parts of the code are not very well-structured or commented, sorry
about that.
The project was created with `vite.js` and is written in `vue3`. The project was created with `vite.js` and is written in `vue3`. Our backend
Our backend lives in the `server`-directory and mostly communicates via websockets. lives in the `server`-directory and mostly communicates via websockets. Both
Both frontend and backend share the same `package.json`. frontend and backend share the same `package.json`.
For production, the frontend is built into the `dist`-directory and the server (`express.js`) exposes the `dist` directory as the root of the endpoint. For production, the frontend is built into the `dist`-directory and the server
For development, we run vite in development mode on another port. (`express.js`) exposes the `dist` directory as the root of the endpoint. For
development, we run vite in development mode on another port.
## Directories ## Directories
@ -25,193 +27,437 @@ For development, we run vite in development mode on another port.
- `src` (Frontend source code) - `src` (Frontend source code)
- `test` (unit test) - `test` (unit test)
## Can I create a pull request for Uptime Kuma? ## Can I Create a Pull Request for Uptime Kuma?
Yes or no, it depends on what you will try to do. Whether or not you can create a pull request depends on the nature of your
Both yours and our maintainers' time is precious, and we don't want to waste either. contribution. We value both your time and our maintainers' time, so we want to
make sure it's spent efficiently.
If you have any questions about any process/.. is not clear, you are likely not alone => please ask them ^^ If you're unsure about any process or step, you're probably not the only one
with that question—please feel free to ask. We're happy to help!
Different guidelines exist for different types of pull requests (PRs): Different types of pull requests (PRs) may have different guidelines, so be sure
- <details><summary><b>security fixes</b></summary> to review the appropriate one for your contribution.
- <details><summary><b>Security Fixes</b> (click to expand)</summary>
<p> <p>
Submitting security fixes is something that may put the community at risk. Submitting security fixes is something that may put the community at risk.
Please read through our [security policy](SECURITY.md) and submit vulnerabilities via an [advisory](https://github.com/louislam/uptime-kuma/security/advisories/new) + [issue](https://github.com/louislam/uptime-kuma/issues/new?assignees=&labels=help&template=security.md) instead. Please read through our [security policy](SECURITY.md) and submit
We encourage you to submit how to fix a vulnerability if you know how to, this is not required. vulnerabilities via an [advisory] + [issue] instead. We encourage you to
Following the security policy allows us to properly test, fix bugs. submit how to fix a vulnerability if you know how to, this is not required.
This review allows us to notice, if there are any changes necessary to unrelated parts like the documentation. Following the security policy allows us to properly test, fix bugs. This
review allows us to notice, if there are any changes necessary to unrelated
parts like the documentation.
[**PLEASE SEE OUR SECURITY POLICY.**](SECURITY.md) [**PLEASE SEE OUR SECURITY POLICY.**](SECURITY.md)
[advisory]: https://github.com/louislam/uptime-kuma/security/advisories/new
[issue]:
https://github.com/louislam/uptime-kuma/issues/new?template=security_issue.yml
</p> </p>
</details> </details>
- <details><summary><b>small, non-breaking bug fixes</b></summary>
- <details><summary><b>Small, Non-Breaking Bug Fixes</b> (click to expand)</summary>
<p> <p>
If you come across a bug and think you can solve, we appreciate your work. If you come across a bug and think you can solve, we appreciate your work.
Please make sure that you follow these rules: Please make sure that you follow these rules:
- keep the PR as small as possible, fix only one thing at a time => keeping it reviewable
- keep the PR as small as possible, fix only one thing at a time => keeping it
reviewable
- test that your code does what you claim it does. - test that your code does what you claim it does.
<sub>Because maintainer time is precious, junior maintainers may merge uncontroversial PRs in this area.</sub> <sub>Because maintainer time is precious, junior maintainers may merge
uncontroversial PRs in this area.</sub>
</p> </p>
</details> </details>
- <details><summary><b>translations / internationalisation (i18n)</b></summary>
- <details><summary><b>Translations / Internationalisation (i18n)</b> (click to expand)</summary>
<p> <p>
We use weblate to localise this project into many languages. We use weblate to localise this project into many languages. If you are
If you are unhappy with a translation this is the best start. unhappy with a translation this is the best start. On how to translate using
On how to translate using weblate, please see [these instructions](https://github.com/louislam/uptime-kuma/blob/master/src/lang/README.md). weblate, please see
[these instructions](https://github.com/louislam/uptime-kuma/blob/master/src/lang/README.md).
There are two cases in which a change cannot be done in weblate and requires a PR: There are two cases in which a change cannot be done in weblate and requires a
- A text may not be currently localisable. In this case, **adding a new language key** via `$t("languageKey")` might be nessesary PR:
- language keys need to be **added to `en.json`** to be visible in weblate. If this has not happened, a PR is appreciated.
- **Adding a new language** requires a new file see [these instructions](https://github.com/louislam/uptime-kuma/blob/master/src/lang/README.md) - A text may not be currently localisable. In this case, **adding a new
language key** via `$t("languageKey")` might be nessesary
- language keys need to be **added to `en.json`** to be visible in weblate. If
this has not happened, a PR is appreciated.
- **Adding a new language** requires a new file see
[these instructions](https://github.com/louislam/uptime-kuma/blob/master/src/lang/README.md)
<sub>Because maintainer time is precious, junior maintainers may merge
uncontroversial PRs in this area.</sub>
<sub>Because maintainer time is precious, junior maintainers may merge uncontroversial PRs in this area.</sub>
</p> </p>
</details> </details>
- <details><summary><b>new notification providers</b></summary>
- <details><summary><b>New Notification Providers</b> (click to expand)</summary>
<p> <p>
To set up a new notification provider these files need to be modified/created: To set up a new notification provider these files need to be modified/created:
- `server/notification-providers/PROVIDER_NAME.js` is where the heart of the notification provider lives.
- Both `monitorJSON` and `heartbeatJSON` can be `null` for some events.
If both are `null`, this is a general testing message, but if just `heartbeatJSON` is `null` this is a certificate expiry.
- Please wrap the axios call into a
```js
try {
let result = await axios.post(...);
if (result.status === ...) ...
} catch (error) {
this.throwGeneralAxiosError(error);
}
```
- `server/notification.js` is where the backend of the notification provider needs to be registered.
*If you have an idea how we can skip this step, we would love to hear about it ^^*
- `src/components/NotificationDialog.vue` you need to decide if the provider is a regional or a global one and add it with a name to the respective list
- `src/components/notifications/PROVIDER_NAME.vue` is where the frontend of each provider lives.
Please make sure that you have:
- used `HiddenInput` for secret credentials
- included all the necessary helptexts/placeholder/.. to make sure the notification provider is simple to setup for new users.
- include all translations (`{{ $t("Translation key") }}`, [`i18n-t keypath="Translation key">`](https://vue-i18n.intlify.dev/guide/advanced/component.html)) in `src/lang/en.json` to enable our translators to translate this
- `src/components/notifications/index.js` is where the frontend of the provider needs to be registered.
*If you have an idea how we can skip this step, we would love to hear about it ^^*
Offering notifications is close to the core of what we are as an uptime monitor. - `server/notification-providers/PROVIDER_NAME.js` is where the heart of the
Therefore, making sure that they work is also really important. notification provider lives.
Because testing notification providers is quite time intensive, we mostly offload this onto the person contributing a notification provider.
To make sure you have tested the notification provider, please include screenshots of the following events in the pull-request description: - Both `monitorJSON` and `heartbeatJSON` can be `null` for some events. If
- `UP`/`DOWN`
- Certificate Expiry via https://expired.badssl.com/
- Testing (the test button on the notification provider setup page)
Using the following way to format this is encouraged: both are `null`, this is a general testing message, but if just
```md `heartbeatJSON` is `null` this is a certificate expiry.
| Event | Before | After |
------------------ - Please wrap the axios call into a
| `UP` | paste-image-here | paste-image-here |
| `DOWN` | paste-image-here | paste-image-here | ```js
| Certificate-expiry | paste-image-here | paste-image-here | try {
| Testing | paste-image-here | paste-image-here | let result = await axios.post(...);
if (result.status === ...) ...
} catch (error) {
this.throwGeneralAxiosError(error);
}
``` ```
<sub>Because maintainer time is precious, junior maintainers may merge uncontroversial PRs in this area.</sub> - `server/notification.js` is where the backend of the notification provider
needs to be registered. _If you have an idea how we can skip this step, we
would love to hear about it ^^_
- `src/components/NotificationDialog.vue` you need to decide if the provider
is a regional or a global one and add it with a name to the respective list
- `src/components/notifications/PROVIDER_NAME.vue` is where the frontend of
each provider lives. Please make sure that you have:
- used `HiddenInput` for secret credentials
- included all the necessary helptexts/placeholder/.. to make sure the
notification provider is simple to setup for new users. - include all
translations (`{{ $t("Translation key") }}`,
[`i18n-t keypath="Translation key">`](https://vue-i18n.intlify.dev/guide/advanced/component.html))
in `src/lang/en.json` to enable our translators to translate this
- `src/components/notifications/index.js` is where the frontend of the
provider needs to be registered. _If you have an idea how we can skip this
step, we would love to hear about it ^^_
Offering notifications is close to the core of what we are as an uptime
monitor. Therefore, making sure that they work is also really important.
Because testing notification providers is quite time intensive, we mostly
offload this onto the person contributing a notification provider.
To make sure you have tested the notification provider, please include
screenshots of the following events in the pull-request description:
- `UP`/`DOWN`
- Certificate Expiry via <https://expired.badssl.com/>
- Testing (the test button on the notification provider setup page)
<br/>
Using the following way to format this is encouraged:
```md
| Event | Before | After |
| ------------------ | --------------------- | -------------------- |
| `UP` | ![Before](image-link) | ![After](image-link) |
| `DOWN` | ![Before](image-link) | ![After](image-link) |
| Certificate-expiry | ![Before](image-link) | ![After](image-link) |
| Testing | ![Before](image-link) | ![After](image-link) |
```
<sub>Because maintainer time is precious, junior maintainers may merge
uncontroversial PRs in this area.</sub>
</p> </p>
</details> </details>
- <details><summary><b>new monitoring types</b></summary>
- <details><summary><b>New Monitoring Types</b> (click to expand)</summary>
<p> <p>
To set up a new notification provider these files need to be modified/created: To set up a new notification provider these files need to be modified/created:
- `server/monitor-types/MONITORING_TYPE.js` is the core of each monitor.
the `async check(...)`-function should: - `server/monitor-types/MONITORING_TYPE.js` is the core of each monitor. the
- throw an error for each fault that is detected with an actionable error message `async check(...)`-function should:
- in the happy-path, you should set `heartbeat.msg` to a successful message and set `heartbeat.status = UP`
- `server/uptime-kuma-server.js` is where the monitoring backend needs to be registered. - throw an error for each fault that is detected with an actionable error
*If you have an idea how we can skip this step, we would love to hear about it ^^*
message - in the happy-path, you should set `heartbeat.msg` to a successful
message and set `heartbeat.status = UP`
- `server/uptime-kuma-server.js` is where the monitoring backend needs to be
registered. _If you have an idea how we can skip this step, we would love to
hear about it ^^_
- `src/pages/EditMonitor.vue` is the shared frontend users interact with. - `src/pages/EditMonitor.vue` is the shared frontend users interact with.
Please make sure that you have: Please make sure that you have: - used `HiddenInput` for secret
- used `HiddenInput` for secret credentials credentials - included all the necessary helptexts/placeholder/.. to make
- included all the necessary helptexts/placeholder/.. to make sure the notification provider is simple to setup for new users. sure the notification provider is simple to setup for new users. - include
- include all translations (`{{ $t("Translation key") }}`, [`i18n-t keypath="Translation key">`](https://vue-i18n.intlify.dev/guide/advanced/component.html)) in `src/lang/en.json` to enable our translators to translate this all translations (`{{ $t("Translation key") }}`,
- [`i18n-t keypath="Translation key">`](https://vue-i18n.intlify.dev/guide/advanced/component.html))
in `src/lang/en.json` to enable our translators to translate this
<sub>Because maintainer time is precious, junior maintainers may merge
uncontroversial PRs in this area.</sub>
<sub>Because maintainer time is precious, junior maintainers may merge uncontroversial PRs in this area.</sub>
</p> </p>
</details> </details>
- <details><summary><b>new features/ major changes / breaking bugfixes</b></summary>
- <details><summary><b>New Features / Major Changes / Breaking Bugfixes</b> (click to expand)</summary>
<p> <p>
be sure to **create an empty draft pull request or open an issue, so we can have a discussion first**. be sure to **create an empty draft pull request or open an issue, so we can
This is especially important for a large pull request or when you don't know if it will be merged or not. have a discussion first**. This is especially important for a large pull
request or when you don't know if it will be merged or not.
<sub>Because of the large impact of this work, only senior maintainers may
merge PRs in this area. </sub>
<sub>Because of the large impact of this work, only senior maintainers may merge PRs in this area.</sub>
</p> </p>
</details> </details>
The following rules are essential for making your PR mergable: - <details><summary><b>Pull Request Guidelines</b> (click to expand)</summary>
- Merging multiple issues by a huge PR is more difficult to review and causes conflicts with other PRs. Please <p>
## Steps to Submit a Pull Request
1. **Fork** the [Uptime-Kuma repository].
[Uptime-Kuma repository]: https://github.com/louislam/uptime-kuma/
2. **Clone** your forked repository to your local machine.
3. **Create a new branch** for your changes (e.g.,
`feature/add-new-notification-provider-signal`).
4. **Initiate a discussion before making major changes** by creating an empty
commit:
```sh
git commit -m "<YOUR TASK NAME>" --allow-empty
```
5. **Push** your branch to your forked repository.
6. **Open a pull request** using this link: [Compare & Pull Request].
[Compare & Pull Request]: https://github.com/louislam/uptime-kuma/compare/
7. **Select the correct source and target branches**.
8. **Link to related issues** for context.
9. **Provide a clear and concise description** explaining the changes and
their purpose.
- **Type of changes**
- Bugfix (a non-breaking change that resolves an issue)
- New feature (a non-breaking change that adds new functionality)
- Breaking change (a fix or feature that alters existing functionality in a
way that could cause issues)
- User Interface (UI) updates
- New Documentation (addition of new documentation)
- Documentation Update (modification of existing documentation)
- Documentation Update Required (the change requires updates to related
documentation)
- Other (please specify):
- Provide additional details here.
- **Checklist**
- My code adheres to the style guidelines of this project.
- I ran ESLint and other code linters for modified files.
- I have reviewed and tested my code.
- I have commented my code, especially in hard-to-understand areas (e.g.,
using JSDoc for methods).
- My changes generate no new warnings.
- My code needed automated testing. I have added them (this is an optional
task).
- Documentation updates are included (if applicable).
- I have considered potential security impacts and mitigated risks.
- Dependency updates are listed and explained.
- I have read and understood the
[Pull Request guidelines](#recommended-pull-request-guideline).
10. **When publishing your PR, set it as a** `Draft pull request` **to allow
for review and prevent automatic merging.**
11. **Maintainers will assign relevant labels** (e.g., `A:maintenance`,
`A:notifications`).
12. **Complete the PR checklist**, ensuring that:
- Documentation is updated if necessary.
- Tests are written or updated.
- CI/CD checks pass successfully.
13. **Request feedback** from team members to refine your changes before the
final review.
## When Can You Change the PR Status to "Ready for Review"?
A PR should remain in **draft status** until all tasks are completed. Only
change the status to **Ready for Review** when:
- You have implemented all planned changes.
- You have addressed all feedback.
- Your code is fully tested and ready for integration.
- You have updated or created the necessary tests.
- You have verified that CI/CD checks pass successfully.
<br />
A **work-in-progress (WIP) PR** must stay in **draft status** until everything
is finalized.
<sub>Since maintainer time is valuable, junior maintainers may merge
uncontroversial PRs.</sub>
</p>
</details>
## The following rules are essential for making your PR mergable
- Merging multiple issues by a huge PR is more difficult to review and causes
conflicts with other PRs. Please
- (if possible) **create one PR for one issue** or - (if possible) **create one PR for one issue** or
- (if not possible) **explain which issues a PR addresses and why this PR should not be broken apart** - (if not possible) **explain which issues a PR addresses and why this PR
- Make sure your **PR passes our continuous integration**. should not be broken apart**
PRs will not be merged unless all CI-Checks are green.
- **Breaking changes** (unless for a good reason and discussed beforehand) will not get merged / not get merged quickly. - Make sure your **PR passes our continuous integration**. PRs will not be
Such changes require a major version release. merged unless all CI-Checks are green.
- **Test your code** before submitting a PR. - **Breaking changes** (unless for a good reason and discussed beforehand) will
Buggy PRs will not be merged. not get merged / not get merged quickly. Such changes require a major version
release.
- **Test your code** before submitting a PR. Buggy PRs will not be merged.
- Make sure the **UI/UX is close to Uptime Kuma**. - Make sure the **UI/UX is close to Uptime Kuma**.
- **Think about the maintainability**: - **Think about the maintainability**: Don't add functionality that is
Don't add functionality that is completely **out of scope**. completely **out of scope**. Keep in mind that we need to be able to maintain
Keep in mind that we need to be able to maintain the functionality. the functionality.
- Don't modify or delete existing logic without a valid reason. - Don't modify or delete existing logic without a valid reason.
- Don't convert existing code into other programming languages for no reason. - Don't convert existing code into other programming languages for no reason.
I ([@louislam](https://github.com/louislam)) have the final say. I ([@louislam](https://github.com/louislam)) have the final say. If your pull
If your pull request does not meet my expectations, I will reject it, no matter how much time you spent on it. request does not meet my expectations, I will reject it, no matter how much time
Therefore, it is essential to have a discussion beforehand. you spent on it. Therefore, it is essential to have a discussion beforehand.
I will assign your pull request to a [milestone](https://github.com/louislam/uptime-kuma/milestones), if I plan to review and merge it. I will assign your pull request to a [milestone], if I plan to review and merge
it.
Please don't rush or ask for an ETA. [milestone]: https://github.com/louislam/uptime-kuma/milestones
We have to understand the pull request, make sure it has no breaking changes and stick to the vision of this project, especially for large pull requests.
Please don't rush or ask for an ETA. We have to understand the pull request,
make sure it has no breaking changes and stick to the vision of this project,
especially for large pull requests.
## I'd like to work on an issue. How do I do that? ## I'd Like to Work on an Issue. How Do I Do That?
We have found that assigning people to issues is management-overhead that we don't need. We have found that assigning people to issues is unnecessary management
A short comment that you want to try your hand at this issue is appreciated to save other devs time. overhead. Instead, a short comment stating that you want to work on an issue is
If you come across any problem during development, feel free to leave a comment with what you are stuck on. appreciated, as it saves time for other developers. If you encounter any
problems during development, feel free to leave a comment describing what you
are stuck on.
### Recommended Pull Request Guideline ### Recommended Pull Request Guideline
Before diving deep into coding, having a discussion first by creating an empty pull request for discussion is preferred. Before jumping into coding, it's recommended to initiate a discussion by
The rationale behind this is that we can align the direction and scope of the feature to eliminate any conflicts with existing and planned work, and can help by pointing out any potential pitfalls. creating an empty pull request. This approach allows us to align on the
direction and scope of the feature, ensuring it doesn't conflict with existing
or planned work. It also provides an opportunity to identify potential pitfalls
early on, helping to avoid issues down the line.
1. Fork the project 1. **Fork** the [Uptime-Kuma repository].
2. Clone your fork repo to local 2. **Clone** your forked repository to your local machine.
3. Create a new branch 3. **Create a new branch** for your changes (e.g.,
4. Create an empty commit: `git commit -m "<YOUR TASK NAME>" --allow-empty` `feature/add-new-notification-provider-signal`).
5. Push to your fork repo 4. **Initiate a discussion before making major changes** by creating an empty
6. Prepare a pull request: https://github.com/louislam/uptime-kuma/compare commit:
7. Write a proper description. You can mention @louislam in it, so @louislam will get the notification.
8. Create your pull request as a Draft ```sh
9. Wait for the discussion git commit -m "<YOUR TASK NAME>" --allow-empty
```
5. **Push** your branch to your forked repository.
6. **Open a pull request** using this link: [Compare & Pull Request].
7. **Select the correct source and target branches**.
8. **Link to related issues** for context.
9. **Provide a clear and concise description** explaining the changes and their
purpose.
- **Type of changes**
- Bugfix (a non-breaking change that resolves an issue)
- New feature (a non-breaking change that adds new functionality)
- Breaking change (a fix or feature that alters existing functionality in a
way that could cause issues)
- User Interface (UI) updates
- New Documentation (addition of new documentation)
- Documentation Update (modification of existing documentation)
- Documentation Update Required (the change requires updates to related
documentation)
- Other (please specify):
- Provide additional details here.
- **Checklist**
- My code adheres to the style guidelines of this project.
- I ran ESLint and other code linters for modified files.
- I have reviewed and tested my code.
- I have commented my code, especially in hard-to-understand areas (e.g.,
using JSDoc for methods).
- My changes generate no new warnings.
- My code needed automated testing. I have added them (this is an optional
task).
- Documentation updates are included (if applicable).
- I have considered potential security impacts and mitigated risks.
- Dependency updates are listed and explained.
- I have read and understood the
[Pull Request guidelines](#recommended-pull-request-guideline).
10. **When publishing your PR, set it as a** `Draft pull request` **to allow for
review and prevent automatic merging.**
11. **Maintainers will assign relevant labels** (e.g., `A:maintenance`,
`A:notifications`).
12. **Complete the PR checklist**, ensuring that:
- Documentation is updated if necessary.
- Tests are written or updated.
- CI/CD checks pass successfully.
13. **Request feedback** from team members to refine your changes before the
final review.
### When Can You Change the PR Status to "Ready for Review"?
A PR should remain in **draft status** until all tasks are completed. Only
change the status to **Ready for Review** when:
- You have implemented all planned changes.
- You have addressed all feedback.
- Your code is fully tested and ready for integration.
- You have updated or created the necessary tests.
- You have verified that CI/CD checks pass successfully.
A **work-in-progress (WIP) PR** must stay in **draft status** until everything
is finalized.
## Project Styles ## Project Styles
I personally do not like something that requires a lot of configuration before you can finally start the app. I personally do not like something that requires a lot of configuration before
The goal is to make the Uptime Kuma installation as easy as installing a mobile app. you can finally start the app. The goal is to make the Uptime Kuma installation
as easy as installing a mobile app.
- Easy to install for non-Docker users - Easy to install for non-Docker users
- no native build dependency is needed (for `x86_64`/`armv7`/`arm64`) - no native build dependency is needed (for `x86_64`/`armv7`/`arm64`)
- no extra configuration and - no extra configuration and
- no extra effort required to get it running - no extra effort required to get it running
- Single container for Docker users - Single container for Docker users
- no complex docker-compose file - no complex docker-compose file
- mapping the volume and exposing the port should be the only requirements - mapping the volume and exposing the port should be the only requirements
- Settings should be configurable in the frontend. Environment variables are discouraged, unless it is related to startup such as `DATA_DIR`
- Settings should be configurable in the frontend. Environment variables are
discouraged, unless it is related to startup such as `DATA_DIR`
- Easy to use - Easy to use
- The web UI styling should be consistent and nice - The web UI styling should be consistent and nice
@ -233,13 +479,18 @@ The goal is to make the Uptime Kuma installation as easy as installing a mobile
- [`Node.js`](https://nodejs.org/) >= 18 - [`Node.js`](https://nodejs.org/) >= 18
- [`npm`](https://www.npmjs.com/) >= 9.3 - [`npm`](https://www.npmjs.com/) >= 9.3
- [`git`](https://git-scm.com/) - [`git`](https://git-scm.com/)
- IDE that supports [`ESLint`](https://eslint.org/) and EditorConfig (I am using [`IntelliJ IDEA`](https://www.jetbrains.com/idea/)) - IDE that supports [`ESLint`](https://eslint.org/) and EditorConfig (I am using
- A SQLite GUI tool (f.ex. [`SQLite Expert Personal`](https://www.sqliteexpert.com/download.html) or [`DBeaver Community`](https://dbeaver.io/download/)) [`IntelliJ IDEA`](https://www.jetbrains.com/idea/))
- A SQLite GUI tool (f.ex.
[`SQLite Expert Personal`](https://www.sqliteexpert.com/download.html) or
[`DBeaver Community`](https://dbeaver.io/download/))
## Git Branches ## Git Branches
- `master`: 2.X.X development. If you want to add a new feature, your pull request should base on this. - `master`: 2.X.X development. If you want to add a new feature, your pull
- `1.23.X`: 1.23.X development. If you want to fix a bug for v1 and v2, your pull request should base on this. request should base on this.
- `1.23.X`: 1.23.X development. If you want to fix a bug for v1 and v2, your
pull request should base on this.
- All other branches are unused, outdated or for dev. - All other branches are unused, outdated or for dev.
## Install Dependencies for Development ## Install Dependencies for Development
@ -260,7 +511,8 @@ Port `3000` and port `3001` will be used.
npm run dev npm run dev
``` ```
But sometimes you may want to restart the server without restarting the frontend. In that case, you can run these commands in two terminals: But sometimes you may want to restart the server without restarting the
frontend. In that case, you can run these commands in two terminals:
```bash ```bash
npm run start-frontend-dev npm run start-frontend-dev
@ -271,9 +523,9 @@ npm run start-server-dev
It binds to `0.0.0.0:3001` by default. It binds to `0.0.0.0:3001` by default.
The backend is an `express.js` server with `socket.io` integrated. The backend is an `express.js` server with `socket.io` integrated. It uses
It uses `socket.io` to communicate with clients, and most server logic is encapsulated in the `socket.io` handlers. `socket.io` to communicate with clients, and most server logic is encapsulated
`express.js` is also used to serve: in the `socket.io` handlers. `express.js` is also used to serve:
- as an entry point for redirecting to a status page or the dashboard - as an entry point for redirecting to a status page or the dashboard
- the frontend built files (`index.html`, `*.js`, `*.css`, etc.) - the frontend built files (`index.html`, `*.js`, `*.css`, etc.)
@ -289,11 +541,13 @@ It uses `socket.io` to communicate with clients, and most server logic is encaps
- `routers/` (Express Routers) - `routers/` (Express Routers)
- `socket-handler/` (Socket.io Handlers) - `socket-handler/` (Socket.io Handlers)
- `server.js` (Server entry point) - `server.js` (Server entry point)
- `uptime-kuma-server.js` (UptimeKumaServer class, main logic should be here, but some still in `server.js`) - `uptime-kuma-server.js` (UptimeKumaServer class, main logic should be here,
but some still in `server.js`)
## Frontend Dev Server ## Frontend Dev Server
It binds to `0.0.0.0:3000` by default. The frontend dev server is used for development only. It binds to `0.0.0.0:3000` by default. The frontend dev server is used for
development only.
For production, it is not used. It will be compiled to `dist` directory instead. For production, it is not used. It will be compiled to `dist` directory instead.
@ -307,17 +561,19 @@ npm run build
### Frontend Details ### Frontend Details
Uptime Kuma Frontend is a single page application (SPA). Most paths are handled by Vue Router. Uptime Kuma Frontend is a single page application (SPA). Most paths are handled
by Vue Router.
The router is in `src/router.js` The router is in `src/router.js`
As you can see, most data in the frontend is stored at the root level, even though you changed the current router to any other pages. As you can see, most data in the frontend is stored at the root level, even
though you changed the current router to any other pages.
The data and socket logic are in `src/mixins/socket.js`. The data and socket logic are in `src/mixins/socket.js`.
## Database Migration ## Database Migration
See: https://github.com/louislam/uptime-kuma/tree/master/db/knex_migrations See: <https://github.com/louislam/uptime-kuma/tree/master/db/knex_migrations>
## Unit Test ## Unit Test
@ -328,11 +584,12 @@ npm test
## Dependencies ## Dependencies
Both frontend and backend share the same `package.json`. Both frontend and backend share the same `package.json`. However, the frontend
However, the frontend dependencies are eventually not used in the production environment, because it is usually also baked into `dist` files. So: dependencies are eventually not used in the production environment, because it
is usually also baked into `dist` files. So:
- Frontend dependencies = "devDependencies" - Frontend dependencies = "devDependencies"
- Examples: `vue`, `chart.js` - Examples: - `vue`, `chart.js`
- Backend dependencies = "dependencies" - Backend dependencies = "dependencies"
- Examples: `socket.io`, `sqlite3` - Examples: `socket.io`, `sqlite3`
- Development dependencies = "devDependencies" - Development dependencies = "devDependencies"
@ -340,31 +597,41 @@ However, the frontend dependencies are eventually not used in the production env
### Update Dependencies ### Update Dependencies
Since previously updating Vite 2.5.10 to 2.6.0 broke the application completely, from now on, it should update the patch release version only. Since previously updating Vite 2.5.10 to 2.6.0 broke the application completely,
from now on, it should update the patch release version only.
Patch release = the third digit ([Semantic Versioning](https://semver.org/)) Patch release = the third digit ([Semantic Versioning](https://semver.org/))
If for security / bug / other reasons, a library must be updated, breaking changes need to be checked by the person proposing the change. If for security / bug / other reasons, a library must be updated, breaking
changes need to be checked by the person proposing the change.
## Translations ## Translations
Please add **all** the strings which are translatable to `src/lang/en.json` (if translation keys are omitted, they can not be translated.) Please add **all** the strings which are translatable to `src/lang/en.json` (if
translation keys are omitted, they can not be translated.)
**Don't include any other languages in your initial pull request** (even if this is your mother tongue), to avoid merge-conflicts between weblate and `master`. **Don't include any other languages in your initial pull request** (even if this
The translations can then (after merging a PR into `master`) be translated by awesome people donating their language skills. is your mother tongue), to avoid merge-conflicts between weblate and `master`.
The translations can then (after merging a PR into `master`) be translated by
awesome people donating their language skills.
If you want to help by translating Uptime Kuma into your language, please visit the [instructions on how to translate using weblate](https://github.com/louislam/uptime-kuma/blob/master/src/lang/README.md). If you want to help by translating Uptime Kuma into your language, please visit
the [instructions on how to translate using weblate].
[instructions on how to translate using weblate]:
https://github.com/louislam/uptime-kuma/blob/master/src/lang/README.md
## Spelling & Grammar ## Spelling & Grammar
Feel free to correct the grammar in the documentation or code. Feel free to correct the grammar in the documentation or code. My mother
My mother language is not English and my grammar is not that great. language is not English and my grammar is not that great.
## Wiki ## Wiki
Since there is no way to make a pull request to the wiki, I have set up another repo to do that. Since there is no way to make a pull request to the wiki, I have set up another
repo to do that.
https://github.com/louislam/uptime-kuma-wiki <https://github.com/louislam/uptime-kuma-wiki>
## Docker ## Docker
@ -405,7 +672,7 @@ https://github.com/louislam/uptime-kuma-wiki
## Maintainer ## Maintainer
Check the latest issues and pull requests: Check the latest issues and pull requests:
https://github.com/louislam/uptime-kuma/issues?q=sort%3Aupdated-desc <https://github.com/louislam/uptime-kuma/issues?q=sort%3Aupdated-desc>
### What is a maintainer and what are their roles? ### What is a maintainer and what are their roles?
@ -413,7 +680,7 @@ This project has multiple maintainers who specialise in different areas.
Currently, there are 3 maintainers: Currently, there are 3 maintainers:
| Person | Role | Main Area | | Person | Role | Main Area |
|-------------------|-------------------|------------------| | ----------------- | ----------------- | ---------------- |
| `@louislam` | senior maintainer | major features | | `@louislam` | senior maintainer | major features |
| `@chakflying` | junior maintainer | fixing bugs | | `@chakflying` | junior maintainer | fixing bugs |
| `@commanderstorm` | junior maintainer | issue-management | | `@commanderstorm` | junior maintainer | issue-management |
@ -421,39 +688,49 @@ Currently, there are 3 maintainers:
### Procedures ### Procedures
We have a few procedures we follow. These are documented here: We have a few procedures we follow. These are documented here:
- <details><summary>Set up a Docker Builder</summary>
- <details><summary><b>Set up a Docker Builder</b> (click to expand)</summary>
<p> <p>
- amd64, armv7 using local. - amd64, armv7 using local.
- arm64 using remote arm64 cpu, as the emulator is too slow and can no longer pass the `npm ci` command. - arm64 using remote arm64 cpu, as the emulator is too slow and can no longer
1. Add the public key to the remote server. pass the `npm ci` command.
2. Add the remote context. The remote machine must be arm64 and installed Docker CE.
``` 1. Add the public key to the remote server.
docker context create oracle-arm64-jp --docker "host=ssh://root@100.107.174.88" 2. Add the remote context. The remote machine must be arm64 and installed
``` Docker CE.
3. Create a new builder.
``` ```bash
docker buildx create --name kuma-builder --platform linux/amd64,linux/arm/v7 docker context create oracle-arm64-jp --docker "host=ssh://root@100.107.174.88"
docker buildx use kuma-builder ```
docker buildx inspect --bootstrap
``` 3. Create a new builder.
4. Append the remote context to the builder.
``` ```bash
docker buildx create --append --name kuma-builder --platform linux/arm64 oracle-arm64-jp docker buildx create --name kuma-builder --platform linux/amd64,linux/arm/v7
``` docker buildx use kuma-builder
5. Verify the builder and check if the builder is using `kuma-builder`. docker buildx inspect --bootstrap
``` ```
docker buildx inspect kuma-builder
docker buildx ls 4. Append the remote context to the builder.
```
```bash
docker buildx create --append --name kuma-builder --platform linux/arm64 oracle-arm64-jp
```
5. Verify the builder and check if the builder is using `kuma-builder`.
`docker buildx inspect kuma-builder docker buildx ls`
</p> </p>
</details> </details>
- <details><summary>Release</summary>
- <details><summary><b>Release</b> (click to expand)</summary>
<p> <p>
1. Draft a release note 1. Draft a release note
2. Make sure the repo is cleared 2. Make sure the repo is cleared
3. If the healthcheck is updated, remember to re-compile it: `npm run build-docker-builder-go` 3. If the healthcheck is updated, remember to re-compile it:
`npm run build-docker-builder-go`
4. `npm run release-final` with env vars: `VERSION` and `GITHUB_TOKEN` 4. `npm run release-final` with env vars: `VERSION` and `GITHUB_TOKEN`
5. Wait until the `Press any key to continue` 5. Wait until the `Press any key to continue`
6. `git push` 6. `git push`
@ -463,13 +740,16 @@ We have a few procedures we follow. These are documented here:
These Items need to be checked: These Items need to be checked:
- [ ] Check all tags is fine on https://hub.docker.com/r/louislam/uptime-kuma/tags - [ ] Check all tags is fine on
- [ ] Try the Docker image with tag 1.X.X (Clean install / amd64 / arm64 / armv7) <https://hub.docker.com/r/louislam/uptime-kuma/tags>
- [ ] Try the Docker image with tag 1.X.X (Clean install / amd64 / arm64 /
armv7)
- [ ] Try clean installation with Node.js - [ ] Try clean installation with Node.js
</p> </p>
</details> </details>
- <details><summary>Release Beta</summary>
- <details><summary><b>Release Beta</b> (click to expand)</summary>
<p> <p>
1. Draft a release note, check `This is a pre-release` 1. Draft a release note, check `This is a pre-release`
@ -481,7 +761,8 @@ We have a few procedures we follow. These are documented here:
</p> </p>
</details> </details>
- <details><summary>Release Wiki</summary>
- <details><summary><b>Release Wiki</b> (click to expand)</summary>
<p> <p>
**Setup Repo** **Setup Repo**
@ -501,7 +782,8 @@ We have a few procedures we follow. These are documented here:
</p> </p>
</details> </details>
- <details><summary>Change the base of a pull request such as <code>master</code> to <code>1.23.X</code></summary>
- <details><summary>Change the base of a pull request such as <code>master</code> to <code>1.23.X</code> (click to expand)</summary>
<p> <p>
```bash ```bash

View file

@ -62,6 +62,7 @@ Requirements:
- Platform - Platform
- ✅ Major Linux distros such as Debian, Ubuntu, CentOS, Fedora and ArchLinux etc. - ✅ Major Linux distros such as Debian, Ubuntu, CentOS, Fedora and ArchLinux etc.
- ✅ Windows 10 (x64), Windows Server 2012 R2 (x64) or higher - ✅ Windows 10 (x64), Windows Server 2012 R2 (x64) or higher
- ❌ FreeBSD / OpenBSD / NetBSD
- ❌ Replit / Heroku - ❌ Replit / Heroku
- [Node.js](https://nodejs.org/en/download/) 18 / 20.4 - [Node.js](https://nodejs.org/en/download/) 18 / 20.4
- [npm](https://docs.npmjs.com/cli/) 9 - [npm](https://docs.npmjs.com/cli/) 9

View file

@ -2,29 +2,37 @@
## Reporting a Vulnerability ## Reporting a Vulnerability
1. Please report security issues to https://github.com/louislam/uptime-kuma/security/advisories/new. 1. Please report security issues to
2. Please also create an empty security issue to alert me, as GitHub Advisories do not send a notification, I probably will miss it without this. https://github.com/louislam/uptime-kuma/issues/new?assignees=&labels=help&template=security.md <https://github.com/louislam/uptime-kuma/security/advisories/new>.
2. Please also create an empty security issue to alert me, as GitHub Advisories
do not send a notification, I probably will miss it without this.
<https://github.com/louislam/uptime-kuma/issues/new?assignees=&labels=help&template=security.md>
Do not use the public issue tracker or discuss it in public as it will cause more damage. Do not use the public issue tracker or discuss it in public as it will cause
more damage.
## Do you accept other 3rd-party bug bounty platforms? ## Do you accept other 3rd-party bug bounty platforms?
At this moment, I DO NOT accept other bug bounty platforms, because I am not familiar with these platforms and someone has tried to send a phishing link to me by doing this already. To minimize my own risk, please report through GitHub Advisories only. I will ignore all 3rd-party bug bounty platforms emails. At this moment, I DO NOT accept other bug bounty platforms, because I am not
familiar with these platforms and someone has tried to send a phishing link to
me by doing this already. To minimize my own risk, please report through GitHub
Advisories only. I will ignore all 3rd-party bug bounty platforms emails.
## Supported Versions ## Supported Versions
### Uptime Kuma Versions ### Uptime Kuma Versions
You should use or upgrade to the latest version of Uptime Kuma. All `1.X.X` versions are upgradable to the latest version. You should use or upgrade to the latest version of Uptime Kuma. All `1.X.X`
versions are upgradable to the latest version.
### Upgradable Docker Tags ### Upgradable Docker Tags
| Tag | Supported | | Tag | Supported |
|-|-| | -------------- | ------------------ |
| 1 | :white_check_mark: | | 1 | :white_check_mark: |
| 1-debian | :white_check_mark: | | 1-debian | :white_check_mark: |
| latest | :white_check_mark: | | latest | :white_check_mark: |
| debian | :white_check_mark: | | debian | :white_check_mark: |
| 1-alpine | ⚠️ Deprecated | | 1-alpine | ⚠️ Deprecated |
| alpine | ⚠️ Deprecated | | alpine | ⚠️ Deprecated |
| All other tags | ❌ | | All other tags | ❌ |

View file

@ -0,0 +1,12 @@
exports.up = function (knex) {
return knex.schema
.alterTable("monitor", function (table) {
table.string("smtp_security").defaultTo(null);
});
};
exports.down = function (knex) {
return knex.schema.alterTable("monitor", function (table) {
table.dropColumn("smtp_security");
});
};

View file

@ -0,0 +1,24 @@
/* SQL:
ALTER TABLE monitor ADD ping_count INTEGER default 1 not null;
ALTER TABLE monitor ADD ping_numeric BOOLEAN default true not null;
ALTER TABLE monitor ADD ping_per_request_timeout INTEGER default 2 not null;
*/
exports.up = function (knex) {
// Add new columns to table monitor
return knex.schema
.alterTable("monitor", function (table) {
table.integer("ping_count").defaultTo(1).notNullable();
table.boolean("ping_numeric").defaultTo(true).notNullable();
table.integer("ping_per_request_timeout").defaultTo(2).notNullable();
});
};
exports.down = function (knex) {
return knex.schema
.alterTable("monitor", function (table) {
table.dropColumn("ping_count");
table.dropColumn("ping_numeric");
table.dropColumn("ping_per_request_timeout");
});
};

View file

@ -0,0 +1,13 @@
// Fix #5721: Change proxy port column type to integer to support larger port numbers
exports.up = function (knex) {
return knex.schema
.alterTable("proxy", function (table) {
table.integer("port").alter();
});
};
exports.down = function (knex) {
return knex.schema.alterTable("proxy", function (table) {
table.smallint("port").alter();
});
};

View file

@ -0,0 +1,13 @@
// Add column custom_url to monitor_group table
exports.up = function (knex) {
return knex.schema
.alterTable("monitor_group", function (table) {
table.text("custom_url", "text");
});
};
exports.down = function (knex) {
return knex.schema.alterTable("monitor_group", function (table) {
table.dropColumn("custom_url");
});
};

View file

@ -101,12 +101,30 @@ export function buildImage(repoNames, tags, target, buildArgs = "", dockerfile =
/** /**
* Check if the version already exists on Docker Hub * Check if the version already exists on Docker Hub
* TODO: use semver to compare versions if it is greater than the previous? * TODO: use semver to compare versions if it is greater than the previous?
* @param {string} repoName Docker Hub repository name * @param {string[]} repoNames repository name (Only check the name with single slash)
* @param {string} version Version to check * @param {string} version Version to check
* @returns {void} * @returns {void}
*/ */
export async function checkTagExists(repoName, version) { export async function checkTagExists(repoNames, version) {
console.log(`Checking if version ${version} exists on Docker Hub`); // Skip if the tag is not on Docker Hub
// louislam/uptime-kuma
let dockerHubRepoNames = repoNames.filter((name) => {
return name.split("/").length === 2;
});
for (let repoName of dockerHubRepoNames) {
await checkTagExistsSingle(repoName, version);
}
}
/**
* Check if the version already exists on Docker Hub
* @param {string} repoName repository name
* @param {string} version Version to check
* @returns {Promise<void>}
*/
export async function checkTagExistsSingle(repoName, version) {
console.log(`Checking if version ${version} exists on Docker Hub:`, repoName);
// Get a list of tags from the Docker Hub repository // Get a list of tags from the Docker Hub repository
let tags = []; let tags = [];

View file

@ -3,6 +3,7 @@ console.log("== Uptime Kuma Reset Password Tool ==");
const Database = require("../server/database"); const Database = require("../server/database");
const { R } = require("redbean-node"); const { R } = require("redbean-node");
const readline = require("readline"); const readline = require("readline");
const { passwordStrength } = require("check-password-strength");
const { initJWTSecret } = require("../server/util-server"); const { initJWTSecret } = require("../server/util-server");
const User = require("../server/model/user"); const User = require("../server/model/user");
const { io } = require("socket.io-client"); const { io } = require("socket.io-client");
@ -42,8 +43,15 @@ const main = async () => {
console.log("Using password from argument"); console.log("Using password from argument");
console.warn("\x1b[31m%s\x1b[0m", "Warning: the password might be stored, in plain text, in your shell's history"); console.warn("\x1b[31m%s\x1b[0m", "Warning: the password might be stored, in plain text, in your shell's history");
password = confirmPassword = args["new-password"] + ""; password = confirmPassword = args["new-password"] + "";
if (passwordStrength(password).value === "Too weak") {
throw new Error("Password is too weak, please use a stronger password.");
}
} else { } else {
password = await question("New Password: "); password = await question("New Password: ");
if (passwordStrength(password).value === "Too weak") {
console.log("Password is too weak, please try again.");
continue;
}
confirmPassword = await question("Confirm New Password: "); confirmPassword = await question("Confirm New Password: ");
} }

5336
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{ {
"name": "uptime-kuma", "name": "uptime-kuma",
"version": "2.0.0-beta.0", "version": "2.0.0-beta.2",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",
@ -32,7 +32,7 @@
"test-e2e-ui": "playwright test --config ./config/playwright.config.js --ui --ui-port=51063", "test-e2e-ui": "playwright test --config ./config/playwright.config.js --ui --ui-port=51063",
"playwright-codegen": "playwright codegen localhost:3000 --save-storage=./private/e2e-auth.json", "playwright-codegen": "playwright codegen localhost:3000 --save-storage=./private/e2e-auth.json",
"playwright-show-report": "playwright show-report ./private/playwright-report", "playwright-show-report": "playwright show-report ./private/playwright-report",
"tsc": "tsc", "tsc": "tsc --project ./tsconfig-backend.json",
"vite-preview-dist": "vite preview --host --config ./config/vite.config.js", "vite-preview-dist": "vite preview --host --config ./config/vite.config.js",
"build-docker-base": "docker buildx build -f docker/debian-base.dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:base2 --target base2 . --push", "build-docker-base": "docker buildx build -f docker/debian-base.dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:base2 --target base2 . --push",
"build-docker-base-slim": "docker buildx build -f docker/debian-base.dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:base2-slim --target base2-slim . --push", "build-docker-base-slim": "docker buildx build -f docker/debian-base.dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:base2-slim --target base2-slim . --push",
@ -41,7 +41,7 @@
"build-docker-pr-test": "docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64 -t louislam/uptime-kuma:pr-test2 --target pr-test2 . --push", "build-docker-pr-test": "docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64 -t louislam/uptime-kuma:pr-test2 --target pr-test2 . --push",
"upload-artifacts": "node extra/release/upload-artifacts.mjs", "upload-artifacts": "node extra/release/upload-artifacts.mjs",
"upload-artifacts-beta": "node extra/release/upload-artifacts-beta.mjs", "upload-artifacts-beta": "node extra/release/upload-artifacts-beta.mjs",
"setup": "git checkout 1.23.15 && npm ci --production && npm run download-dist", "setup": "git checkout 1.23.16 && npm ci --omit dev && npm run download-dist",
"download-dist": "node extra/download-dist.js", "download-dist": "node extra/download-dist.js",
"mark-as-nightly": "node extra/mark-as-nightly.js", "mark-as-nightly": "node extra/mark-as-nightly.js",
"reset-password": "node extra/reset-password.js", "reset-password": "node extra/reset-password.js",
@ -72,7 +72,7 @@
"@louislam/sqlite3": "15.1.6", "@louislam/sqlite3": "15.1.6",
"@vvo/tzdb": "^6.125.0", "@vvo/tzdb": "^6.125.0",
"args-parser": "~1.3.0", "args-parser": "~1.3.0",
"axios": "~0.28.1", "axios": "~0.30.0",
"badge-maker": "~3.3.1", "badge-maker": "~3.3.1",
"bcryptjs": "~2.4.3", "bcryptjs": "~2.4.3",
"chardet": "~1.4.0", "chardet": "~1.4.0",
@ -82,6 +82,7 @@
"command-exists": "~1.2.9", "command-exists": "~1.2.9",
"compare-versions": "~3.6.0", "compare-versions": "~3.6.0",
"compression": "~1.7.4", "compression": "~1.7.4",
"country-flag-emoji-polyfill": "^0.1.8",
"croner": "~8.1.0", "croner": "~8.1.0",
"dayjs": "~1.11.5", "dayjs": "~1.11.5",
"dev-null": "^0.1.1", "dev-null": "^0.1.1",
@ -95,8 +96,8 @@
"html-escaper": "^3.0.3", "html-escaper": "^3.0.3",
"http-cookie-agent": "~5.0.4", "http-cookie-agent": "~5.0.4",
"http-graceful-shutdown": "~3.1.7", "http-graceful-shutdown": "~3.1.7",
"http-proxy-agent": "~5.0.0", "http-proxy-agent": "~7.0.2",
"https-proxy-agent": "~5.0.1", "https-proxy-agent": "~7.0.6",
"iconv-lite": "~0.6.3", "iconv-lite": "~0.6.3",
"isomorphic-ws": "^5.0.0", "isomorphic-ws": "^5.0.0",
"jsesc": "~3.0.2", "jsesc": "~3.0.2",
@ -118,7 +119,7 @@
"node-cloudflared-tunnel": "~1.0.9", "node-cloudflared-tunnel": "~1.0.9",
"node-radius-client": "~1.0.0", "node-radius-client": "~1.0.0",
"nodemailer": "~6.9.13", "nodemailer": "~6.9.13",
"nostr-tools": "^1.13.1", "nostr-tools": "^2.10.4",
"notp": "~2.0.3", "notp": "~2.0.3",
"openid-client": "^5.4.2", "openid-client": "^5.4.2",
"password-hash": "~1.2.2", "password-hash": "~1.2.2",
@ -135,7 +136,7 @@
"semver": "~7.5.4", "semver": "~7.5.4",
"socket.io": "~4.8.0", "socket.io": "~4.8.0",
"socket.io-client": "~4.8.0", "socket.io-client": "~4.8.0",
"socks-proxy-agent": "6.1.1", "socks-proxy-agent": "~8.0.5",
"tar": "~6.2.1", "tar": "~6.2.1",
"tcp-ping": "~0.1.1", "tcp-ping": "~0.1.1",
"thirty-two": "~1.0.2", "thirty-two": "~1.0.2",
@ -143,7 +144,7 @@
"ws": "^8.13.0" "ws": "^8.13.0"
}, },
"devDependencies": { "devDependencies": {
"@actions/github": "~5.1.1", "@actions/github": "~6.0.0",
"@fortawesome/fontawesome-svg-core": "~1.2.36", "@fortawesome/fontawesome-svg-core": "~1.2.36",
"@fortawesome/free-regular-svg-icons": "~5.15.4", "@fortawesome/free-regular-svg-icons": "~5.15.4",
"@fortawesome/free-solid-svg-icons": "~5.15.4", "@fortawesome/free-solid-svg-icons": "~5.15.4",
@ -169,7 +170,7 @@
"cross-env": "~7.0.3", "cross-env": "~7.0.3",
"delay": "^5.0.0", "delay": "^5.0.0",
"dns2": "~2.0.1", "dns2": "~2.0.1",
"dompurify": "~3.1.7", "dompurify": "~3.2.4",
"eslint": "~8.14.0", "eslint": "~8.14.0",
"eslint-plugin-jsdoc": "~46.4.6", "eslint-plugin-jsdoc": "~46.4.6",
"eslint-plugin-vue": "~8.7.1", "eslint-plugin-vue": "~8.7.1",
@ -179,7 +180,7 @@
"postcss-html": "~1.5.0", "postcss-html": "~1.5.0",
"postcss-rtlcss": "~3.7.2", "postcss-rtlcss": "~3.7.2",
"postcss-scss": "~4.0.4", "postcss-scss": "~4.0.4",
"prismjs": "~1.29.0", "prismjs": "~1.30.0",
"qrcode": "~1.5.0", "qrcode": "~1.5.0",
"rollup-plugin-visualizer": "^5.6.0", "rollup-plugin-visualizer": "^5.6.0",
"sass": "~1.42.1", "sass": "~1.42.1",
@ -190,14 +191,14 @@
"testcontainers": "^10.13.1", "testcontainers": "^10.13.1",
"typescript": "~4.4.4", "typescript": "~4.4.4",
"v-pagination-3": "~0.1.7", "v-pagination-3": "~0.1.7",
"vite": "~5.2.8", "vite": "~5.4.15",
"vite-plugin-compression": "^0.5.1", "vite-plugin-compression": "^0.5.1",
"vite-plugin-vue-devtools": "^7.0.15", "vite-plugin-vue-devtools": "^7.0.15",
"vue": "~3.4.2", "vue": "~3.4.2",
"vue-chartjs": "~5.2.0", "vue-chartjs": "~5.2.0",
"vue-confirm-dialog": "~1.0.2", "vue-confirm-dialog": "~1.0.2",
"vue-contenteditable": "~3.0.4", "vue-contenteditable": "~3.0.4",
"vue-i18n": "~9.2.2", "vue-i18n": "~9.14.3",
"vue-image-crop-upload": "~3.0.3", "vue-image-crop-upload": "~3.0.3",
"vue-multiselect": "~3.0.0-alpha.2", "vue-multiselect": "~3.0.0-alpha.2",
"vue-prism-editor": "~2.0.0-alpha.2", "vue-prism-editor": "~2.0.0-alpha.2",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View file

@ -736,7 +736,7 @@ class Database {
if (Database.dbConfig.type === "sqlite") { if (Database.dbConfig.type === "sqlite") {
return "DATETIME('now', ? || ' hours')"; return "DATETIME('now', ? || ' hours')";
} else { } else {
return "DATE_ADD(NOW(), INTERVAL ? HOUR)"; return "DATE_ADD(UTC_TIMESTAMP(), INTERVAL ? HOUR)";
} }
} }
@ -892,11 +892,13 @@ class Database {
AND important = 0 AND important = 0
AND time < ${sqlHourOffset} AND time < ${sqlHourOffset}
AND id NOT IN ( AND id NOT IN (
SELECT id SELECT id FROM ( -- written this way for Maria's support
FROM heartbeat SELECT id
WHERE monitor_id = ? FROM heartbeat
ORDER BY time DESC WHERE monitor_id = ?
LIMIT ? ORDER BY time DESC
LIMIT ?
) AS limited_ids
) )
`, [ `, [
monitor.id, monitor.id,

View file

@ -33,7 +33,7 @@ class Group extends BeanModel {
*/ */
async getMonitorList() { async getMonitorList() {
return R.convertToBeans("monitor", await R.getAll(` return R.convertToBeans("monitor", await R.getAll(`
SELECT monitor.*, monitor_group.send_url FROM monitor, monitor_group SELECT monitor.*, monitor_group.send_url, monitor_group.custom_url FROM monitor, monitor_group
WHERE monitor.id = monitor_group.monitor_id WHERE monitor.id = monitor_group.monitor_id
AND group_id = ? AND group_id = ?
ORDER BY monitor_group.weight ORDER BY monitor_group.weight

View file

@ -2,7 +2,11 @@ const dayjs = require("dayjs");
const axios = require("axios"); const axios = require("axios");
const { Prometheus } = require("../prometheus"); const { Prometheus } = require("../prometheus");
const { log, UP, DOWN, PENDING, MAINTENANCE, flipStatus, MAX_INTERVAL_SECOND, MIN_INTERVAL_SECOND, const { log, UP, DOWN, PENDING, MAINTENANCE, flipStatus, MAX_INTERVAL_SECOND, MIN_INTERVAL_SECOND,
SQL_DATETIME_FORMAT, evaluateJsonQuery SQL_DATETIME_FORMAT, evaluateJsonQuery,
PING_PACKET_SIZE_MIN, PING_PACKET_SIZE_MAX, PING_PACKET_SIZE_DEFAULT,
PING_GLOBAL_TIMEOUT_MIN, PING_GLOBAL_TIMEOUT_MAX, PING_GLOBAL_TIMEOUT_DEFAULT,
PING_COUNT_MIN, PING_COUNT_MAX, PING_COUNT_DEFAULT,
PING_PER_REQUEST_TIMEOUT_MIN, PING_PER_REQUEST_TIMEOUT_MAX, PING_PER_REQUEST_TIMEOUT_DEFAULT
} = require("../../src/util"); } = require("../../src/util");
const { tcping, ping, checkCertificate, checkStatusCode, getTotalClientInRoom, setting, mssqlQuery, postgresQuery, mysqlQuery, setSetting, httpNtlm, radius, grpcQuery, const { tcping, ping, checkCertificate, checkStatusCode, getTotalClientInRoom, setting, mssqlQuery, postgresQuery, mysqlQuery, setSetting, httpNtlm, radius, grpcQuery,
redisPingAsync, kafkaProducerAsync, getOidcTokenClientCredentials, rootCertificatesFingerprints, axiosAbortSignal redisPingAsync, kafkaProducerAsync, getOidcTokenClientCredentials, rootCertificatesFingerprints, axiosAbortSignal
@ -53,7 +57,7 @@ class Monitor extends BeanModel {
}; };
if (this.sendUrl) { if (this.sendUrl) {
obj.url = this.url; obj.url = this.customUrl ?? this.url;
} }
if (showTags) { if (showTags) {
@ -153,8 +157,14 @@ class Monitor extends BeanModel {
snmpOid: this.snmpOid, snmpOid: this.snmpOid,
jsonPathOperator: this.jsonPathOperator, jsonPathOperator: this.jsonPathOperator,
snmpVersion: this.snmpVersion, snmpVersion: this.snmpVersion,
smtpSecurity: this.smtpSecurity,
rabbitmqNodes: JSON.parse(this.rabbitmqNodes), rabbitmqNodes: JSON.parse(this.rabbitmqNodes),
conditions: JSON.parse(this.conditions), conditions: JSON.parse(this.conditions),
// ping advanced options
ping_numeric: this.isPingNumeric(),
ping_count: this.ping_count,
ping_per_request_timeout: this.ping_per_request_timeout,
}; };
if (includeSensitiveData) { if (includeSensitiveData) {
@ -247,6 +257,14 @@ class Monitor extends BeanModel {
return Boolean(this.expiryNotification); return Boolean(this.expiryNotification);
} }
/**
* Check if ping should use numeric output only
* @returns {boolean} True if IP addresses will be output instead of symbolic hostnames
*/
isPingNumeric() {
return Boolean(this.ping_numeric);
}
/** /**
* Parse to boolean * Parse to boolean
* @returns {boolean} Should TLS errors be ignored? * @returns {boolean} Should TLS errors be ignored?
@ -380,39 +398,6 @@ class Monitor extends BeanModel {
if (await Monitor.isUnderMaintenance(this.id)) { if (await Monitor.isUnderMaintenance(this.id)) {
bean.msg = "Monitor under maintenance"; bean.msg = "Monitor under maintenance";
bean.status = MAINTENANCE; bean.status = MAINTENANCE;
} else if (this.type === "group") {
const children = await Monitor.getChildren(this.id);
if (children.length > 0) {
bean.status = UP;
bean.msg = "All children up and running";
for (const child of children) {
if (!child.active) {
// Ignore inactive childs
continue;
}
const lastBeat = await Monitor.getPreviousHeartbeat(child.id);
// Only change state if the monitor is in worse conditions then the ones before
// lastBeat.status could be null
if (!lastBeat) {
bean.status = PENDING;
} else if (bean.status === UP && (lastBeat.status === PENDING || lastBeat.status === DOWN)) {
bean.status = lastBeat.status;
} else if (bean.status === PENDING && lastBeat.status === DOWN) {
bean.status = lastBeat.status;
}
}
if (bean.status !== UP) {
bean.msg = "Child inaccessible";
}
} else {
// Set status pending if group is empty
bean.status = PENDING;
bean.msg = "Group empty";
}
} else if (this.type === "http" || this.type === "keyword" || this.type === "json-query") { } else if (this.type === "http" || this.type === "keyword" || this.type === "json-query") {
// Do not do any queries/high loading things before the "bean.ping" // Do not do any queries/high loading things before the "bean.ping"
let startTime = dayjs().valueOf(); let startTime = dayjs().valueOf();
@ -617,7 +602,7 @@ class Monitor extends BeanModel {
bean.status = UP; bean.status = UP;
} else if (this.type === "ping") { } else if (this.type === "ping") {
bean.ping = await ping(this.hostname, this.packetSize); bean.ping = await ping(this.hostname, this.ping_count, "", this.ping_numeric, this.packetSize, this.timeout, this.ping_per_request_timeout);
bean.msg = ""; bean.msg = "";
bean.status = UP; bean.status = UP;
} else if (this.type === "push") { // Type: Push } else if (this.type === "push") { // Type: Push
@ -689,7 +674,7 @@ class Monitor extends BeanModel {
bean.msg = res.data.response.servers[0].name; bean.msg = res.data.response.servers[0].name;
try { try {
bean.ping = await ping(this.hostname, this.packetSize); bean.ping = await ping(this.hostname, PING_COUNT_DEFAULT, "", true, this.packetSize, PING_GLOBAL_TIMEOUT_DEFAULT, PING_PER_REQUEST_TIMEOUT_DEFAULT);
} catch (_) { } } catch (_) { }
} else { } else {
throw new Error("Server not found on Steam"); throw new Error("Server not found on Steam");
@ -1327,7 +1312,8 @@ class Monitor extends BeanModel {
try { try {
const heartbeatJSON = bean.toJSON(); const heartbeatJSON = bean.toJSON();
const monitorData = [{ id: monitor.id, const monitorData = [{ id: monitor.id,
active: monitor.active active: monitor.active,
name: monitor.name
}]; }];
const preloadData = await Monitor.preparePreloadData(monitorData); const preloadData = await Monitor.preparePreloadData(monitorData);
// Prevent if the msg is undefined, notifications such as Discord cannot send out. // Prevent if the msg is undefined, notifications such as Discord cannot send out.
@ -1434,7 +1420,7 @@ class Monitor extends BeanModel {
for (let notification of notificationList) { for (let notification of notificationList) {
try { try {
log.debug("monitor", "Sending to " + notification.name); log.debug("monitor", "Sending to " + notification.name);
await Notification.send(JSON.parse(notification.config), `[${this.name}][${this.url}] ${certType} certificate ${certCN} will be expired in ${daysRemaining} days`); await Notification.send(JSON.parse(notification.config), `[${this.name}][${this.url}] ${certType} certificate ${certCN} will expire in ${daysRemaining} days`);
sent = true; sent = true;
} catch (e) { } catch (e) {
log.error("monitor", "Cannot send cert notification to " + notification.name); log.error("monitor", "Cannot send cert notification to " + notification.name);
@ -1500,6 +1486,31 @@ class Monitor extends BeanModel {
if (this.interval < MIN_INTERVAL_SECOND) { if (this.interval < MIN_INTERVAL_SECOND) {
throw new Error(`Interval cannot be less than ${MIN_INTERVAL_SECOND} seconds`); throw new Error(`Interval cannot be less than ${MIN_INTERVAL_SECOND} seconds`);
} }
if (this.type === "ping") {
// ping parameters validation
if (this.packetSize && (this.packetSize < PING_PACKET_SIZE_MIN || this.packetSize > PING_PACKET_SIZE_MAX)) {
throw new Error(`Packet size must be between ${PING_PACKET_SIZE_MIN} and ${PING_PACKET_SIZE_MAX} (default: ${PING_PACKET_SIZE_DEFAULT})`);
}
if (this.ping_per_request_timeout && (this.ping_per_request_timeout < PING_PER_REQUEST_TIMEOUT_MIN || this.ping_per_request_timeout > PING_PER_REQUEST_TIMEOUT_MAX)) {
throw new Error(`Per-ping timeout must be between ${PING_PER_REQUEST_TIMEOUT_MIN} and ${PING_PER_REQUEST_TIMEOUT_MAX} seconds (default: ${PING_PER_REQUEST_TIMEOUT_DEFAULT})`);
}
if (this.ping_count && (this.ping_count < PING_COUNT_MIN || this.ping_count > PING_COUNT_MAX)) {
throw new Error(`Echo requests count must be between ${PING_COUNT_MIN} and ${PING_COUNT_MAX} (default: ${PING_COUNT_DEFAULT})`);
}
if (this.timeout) {
const pingGlobalTimeout = Math.round(Number(this.timeout));
if (pingGlobalTimeout < this.ping_per_request_timeout || pingGlobalTimeout < PING_GLOBAL_TIMEOUT_MIN || pingGlobalTimeout > PING_GLOBAL_TIMEOUT_MAX) {
throw new Error(`Timeout must be between ${PING_GLOBAL_TIMEOUT_MIN} and ${PING_GLOBAL_TIMEOUT_MAX} seconds (default: ${PING_GLOBAL_TIMEOUT_DEFAULT})`);
}
this.timeout = pingGlobalTimeout;
}
}
} }
/** /**
@ -1625,7 +1636,7 @@ class Monitor extends BeanModel {
/** /**
* Gets all Children of the monitor * Gets all Children of the monitor
* @param {number} monitorID ID of monitor to get * @param {number} monitorID ID of monitor to get
* @returns {Promise<LooseObject<any>>} Children * @returns {Promise<LooseObject<any>[]>} Children
*/ */
static async getChildren(monitorID) { static async getChildren(monitorID) {
return await R.getAll(` return await R.getAll(`

View file

@ -485,7 +485,7 @@ function ApiCache() {
} }
if (typeof duration === "string") { if (typeof duration === "string") {
let split = duration.match(/^([\d\.,]+)\s?(\w+)$/); let split = duration.match(/^([\d\.,]+)\s?([a-zA-Z]+)$/);
if (split.length === 3) { if (split.length === 3) {
let len = parseFloat(split[1]); let len = parseFloat(split[1]);

View file

@ -34,12 +34,16 @@ class DnsMonitorType extends MonitorType {
switch (monitor.dns_resolve_type) { switch (monitor.dns_resolve_type) {
case "A": case "A":
case "AAAA": case "AAAA":
case "TXT":
case "PTR": case "PTR":
dnsMessage = `Records: ${dnsRes.join(" | ")}`; dnsMessage = `Records: ${dnsRes.join(" | ")}`;
conditionsResult = dnsRes.some(record => handleConditions({ record })); conditionsResult = dnsRes.some(record => handleConditions({ record }));
break; break;
case "TXT":
dnsMessage = `Records: ${dnsRes.join(" | ")}`;
conditionsResult = dnsRes.flat().some(record => handleConditions({ record }));
break;
case "CNAME": case "CNAME":
dnsMessage = dnsRes[0]; dnsMessage = dnsRes[0];
conditionsResult = handleConditions({ record: dnsRes[0] }); conditionsResult = handleConditions({ record: dnsRes[0] });

View file

@ -0,0 +1,49 @@
const { UP, PENDING, DOWN } = require("../../src/util");
const { MonitorType } = require("./monitor-type");
const Monitor = require("../model/monitor");
class GroupMonitorType extends MonitorType {
name = "group";
/**
* @inheritdoc
*/
async check(monitor, heartbeat, _server) {
const children = await Monitor.getChildren(monitor.id);
if (children.length > 0) {
heartbeat.status = UP;
heartbeat.msg = "All children up and running";
for (const child of children) {
if (!child.active) {
// Ignore inactive childs
continue;
}
const lastBeat = await Monitor.getPreviousHeartbeat(child.id);
// Only change state if the monitor is in worse conditions then the ones before
// lastBeat.status could be null
if (!lastBeat) {
heartbeat.status = PENDING;
} else if (heartbeat.status === UP && (lastBeat.status === PENDING || lastBeat.status === DOWN)) {
heartbeat.status = lastBeat.status;
} else if (heartbeat.status === PENDING && lastBeat.status === DOWN) {
heartbeat.status = lastBeat.status;
}
}
if (heartbeat.status !== UP) {
heartbeat.msg = "Child inaccessible";
}
} else {
// Set status pending if group is empty
heartbeat.status = PENDING;
heartbeat.msg = "Group empty";
}
}
}
module.exports = {
GroupMonitorType,
};

View file

@ -240,6 +240,14 @@ class RealBrowserMonitorType extends MonitorType {
const context = await browser.newContext(); const context = await browser.newContext();
const page = await context.newPage(); const page = await context.newPage();
// Prevent Local File Inclusion
// Accept only http:// and https://
// https://github.com/louislam/uptime-kuma/security/advisories/GHSA-2qgm-m29m-cj2h
let url = new URL(monitor.url);
if (url.protocol !== "http:" && url.protocol !== "https:") {
throw new Error("Invalid url protocol, only http and https are allowed.");
}
const res = await page.goto(monitor.url, { const res = await page.goto(monitor.url, {
waitUntil: "networkidle", waitUntil: "networkidle",
timeout: monitor.interval * 1000 * 0.8, timeout: monitor.interval * 1000 * 0.8,

View file

@ -0,0 +1,35 @@
const { MonitorType } = require("./monitor-type");
const { UP } = require("../../src/util");
const nodemailer = require("nodemailer");
class SMTPMonitorType extends MonitorType {
name = "smtp";
/**
* @inheritdoc
*/
async check(monitor, heartbeat, _server) {
let options = {
port: monitor.port || 25,
host: monitor.hostname,
secure: monitor.smtpSecurity === "secure", // use SMTPS (not STARTTLS)
ignoreTLS: monitor.smtpSecurity === "nostarttls", // don't use STARTTLS even if it's available
requireTLS: monitor.smtpSecurity === "starttls", // use STARTTLS or fail
};
let transporter = nodemailer.createTransport(options);
try {
await transporter.verify();
heartbeat.status = UP;
heartbeat.msg = "SMTP connection verifies successfully";
} catch (e) {
throw new Error(`SMTP connection doesn't verify: ${e}`);
} finally {
transporter.close();
}
}
}
module.exports = {
SMTPMonitorType,
};

View file

@ -17,7 +17,7 @@ class AliyunSMS extends NotificationProvider {
if (heartbeatJSON != null) { if (heartbeatJSON != null) {
let msgBody = JSON.stringify({ let msgBody = JSON.stringify({
name: monitorJSON["name"], name: monitorJSON["name"],
time: heartbeatJSON["time"], time: heartbeatJSON["localDateTime"],
status: this.statusToString(heartbeatJSON["status"]), status: this.statusToString(heartbeatJSON["status"]),
msg: heartbeatJSON["msg"], msg: heartbeatJSON["msg"],
}); });

View file

@ -46,10 +46,10 @@ class Discord extends NotificationProvider {
name: "Service Name", name: "Service Name",
value: monitorJSON["name"], value: monitorJSON["name"],
}, },
{ ...(!notification.disableUrl ? [{
name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL", name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL",
value: this.extractAddress(monitorJSON), value: this.extractAddress(monitorJSON),
}, }] : []),
{ {
name: `Time (${heartbeatJSON["timezone"]})`, name: `Time (${heartbeatJSON["timezone"]})`,
value: heartbeatJSON["localDateTime"], value: heartbeatJSON["localDateTime"],
@ -83,10 +83,10 @@ class Discord extends NotificationProvider {
name: "Service Name", name: "Service Name",
value: monitorJSON["name"], value: monitorJSON["name"],
}, },
{ ...(!notification.disableUrl ? [{
name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL", name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL",
value: this.extractAddress(monitorJSON), value: this.extractAddress(monitorJSON),
}, }] : []),
{ {
name: `Time (${heartbeatJSON["timezone"]})`, name: `Time (${heartbeatJSON["timezone"]})`,
value: heartbeatJSON["localDateTime"], value: heartbeatJSON["localDateTime"],

View file

@ -73,13 +73,13 @@ class FlashDuty extends NotificationProvider {
} }
const options = { const options = {
method: "POST", method: "POST",
url: "https://api.flashcat.cloud/event/push/alert/standard?integration_key=" + notification.flashdutyIntegrationKey, url: notification.flashdutyIntegrationKey.startsWith("http") ? notification.flashdutyIntegrationKey : "https://api.flashcat.cloud/event/push/alert/standard?integration_key=" + notification.flashdutyIntegrationKey,
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
data: { data: {
description: `[${title}] [${monitorInfo.name}] ${body}`, description: `[${title}] [${monitorInfo.name}] ${body}`,
title, title,
event_status: eventStatus || "Info", event_status: eventStatus || "Info",
alert_key: String(monitorInfo.id) || Math.random().toString(36).substring(7), alert_key: monitorInfo.id ? String(monitorInfo.id) : Math.random().toString(36).substring(7),
labels, labels,
} }
}; };

View file

@ -72,6 +72,7 @@ class GoogleChat extends NotificationProvider {
// construct json data // construct json data
let data = { let data = {
fallbackText: chatHeader["title"],
cardsV2: [ cardsV2: [
{ {
card: { card: {

View file

@ -1,11 +1,10 @@
const NotificationProvider = require("./notification-provider"); const NotificationProvider = require("./notification-provider");
const { const {
relayInit, finalizeEvent,
getPublicKey, Relay,
getEventHash, kinds,
getSignature,
nip04, nip04,
nip19 nip19,
} = require("nostr-tools"); } = require("nostr-tools");
// polyfills for node versions // polyfills for node versions
@ -31,7 +30,6 @@ class Nostr extends NotificationProvider {
const createdAt = Math.floor(Date.now() / 1000); const createdAt = Math.floor(Date.now() / 1000);
const senderPrivateKey = await this.getPrivateKey(notification.sender); const senderPrivateKey = await this.getPrivateKey(notification.sender);
const senderPublicKey = getPublicKey(senderPrivateKey);
const recipientsPublicKeys = await this.getPublicKeys(notification.recipients); const recipientsPublicKeys = await this.getPublicKeys(notification.recipients);
// Create NIP-04 encrypted direct message event for each recipient // Create NIP-04 encrypted direct message event for each recipient
@ -39,34 +37,41 @@ class Nostr extends NotificationProvider {
for (const recipientPublicKey of recipientsPublicKeys) { for (const recipientPublicKey of recipientsPublicKeys) {
const ciphertext = await nip04.encrypt(senderPrivateKey, recipientPublicKey, msg); const ciphertext = await nip04.encrypt(senderPrivateKey, recipientPublicKey, msg);
let event = { let event = {
kind: 4, kind: kinds.EncryptedDirectMessage,
pubkey: senderPublicKey,
created_at: createdAt, created_at: createdAt,
tags: [[ "p", recipientPublicKey ]], tags: [[ "p", recipientPublicKey ]],
content: ciphertext, content: ciphertext,
}; };
event.id = getEventHash(event); const signedEvent = finalizeEvent(event, senderPrivateKey);
event.sig = getSignature(event, senderPrivateKey); events.push(signedEvent);
events.push(event);
} }
// Publish events to each relay // Publish events to each relay
const relays = notification.relays.split("\n"); const relays = notification.relays.split("\n");
let successfulRelays = 0; let successfulRelays = 0;
// Connect to each relay
for (const relayUrl of relays) { for (const relayUrl of relays) {
const relay = relayInit(relayUrl); const relay = await Relay.connect(relayUrl);
try { let eventIndex = 0;
await relay.connect();
successfulRelays++;
// Publish events // Authenticate to the relay, if required
for (const event of events) { try {
relay.publish(event); await relay.publish(events[0]);
} eventIndex = 1;
} catch (error) { } catch (error) {
continue; if (relay.challenge) {
await relay.auth(async (evt) => {
return finalizeEvent(evt, senderPrivateKey);
});
}
}
try {
for (let i = eventIndex; i < events.length; i++) {
await relay.publish(events[i]);
}
successfulRelays++;
} catch (error) {
console.error(`Failed to publish event to ${relayUrl}:`, error);
} finally { } finally {
relay.close(); relay.close();
} }
@ -90,7 +95,7 @@ class Nostr extends NotificationProvider {
const { data } = senderDecodeResult; const { data } = senderDecodeResult;
return data; return data;
} catch (error) { } catch (error) {
throw new Error(`Failed to get private key: ${error.message}`); throw new Error(`Failed to decode private key for sender ${sender}: ${error.message}`);
} }
} }
@ -109,10 +114,10 @@ class Nostr extends NotificationProvider {
if (type === "npub") { if (type === "npub") {
publicKeys.push(data); publicKeys.push(data);
} else { } else {
throw new Error("not an npub"); throw new Error(`Recipient ${recipient} is not an npub`);
} }
} catch (error) { } catch (error) {
throw new Error(`Error decoding recipient: ${error}`); throw new Error(`Error decoding recipient ${recipient}: ${error}`);
} }
} }
return publicKeys; return publicKeys;

View file

@ -0,0 +1,53 @@
const { getMonitorRelativeURL, UP } = require("../../src/util");
const { setting } = require("../util-server");
const NotificationProvider = require("./notification-provider");
const axios = require("axios");
class Notifery extends NotificationProvider {
name = "notifery";
/**
* @inheritdoc
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
const okMsg = "Sent Successfully.";
const url = "https://api.notifery.com/event";
let data = {
title: notification.notiferyTitle || "Uptime Kuma Alert",
message: msg,
};
if (notification.notiferyGroup) {
data.group = notification.notiferyGroup;
}
// Link to the monitor
const baseURL = await setting("primaryBaseURL");
if (baseURL && monitorJSON) {
data.message += `\n\nMonitor: ${baseURL}${getMonitorRelativeURL(monitorJSON.id)}`;
}
if (heartbeatJSON) {
data.code = heartbeatJSON.status === UP ? 0 : 1;
if (heartbeatJSON.ping) {
data.duration = heartbeatJSON.ping;
}
}
try {
const headers = {
"Content-Type": "application/json",
"x-api-key": notification.notiferyApiKey,
};
await axios.post(url, data, { headers });
return okMsg;
} catch (error) {
this.throwGeneralAxiosError(error);
}
}
}
module.exports = Notifery;

View file

@ -1,3 +1,6 @@
const { Liquid } = require("liquidjs");
const { DOWN } = require("../../src/util");
class NotificationProvider { class NotificationProvider {
/** /**
@ -49,6 +52,50 @@ class NotificationProvider {
} }
} }
/**
* Renders a message template with notification context
* @param {string} template the template
* @param {string} msg the message that will be included in the context
* @param {?object} monitorJSON Monitor details (For Up/Down/Cert-Expiry only)
* @param {?object} heartbeatJSON Heartbeat details (For Up/Down only)
* @returns {Promise<string>} rendered template
*/
async renderTemplate(template, msg, monitorJSON, heartbeatJSON) {
const engine = new Liquid();
const parsedTpl = engine.parse(template);
// Let's start with dummy values to simplify code
let monitorName = "Monitor Name not available";
let monitorHostnameOrURL = "testing.hostname";
if (monitorJSON !== null) {
monitorName = monitorJSON["name"];
monitorHostnameOrURL = this.extractAddress(monitorJSON);
}
let serviceStatus = "⚠️ Test";
if (heartbeatJSON !== null) {
serviceStatus = (heartbeatJSON["status"] === DOWN) ? "🔴 Down" : "✅ Up";
}
const context = {
// for v1 compatibility, to be removed in v3
"STATUS": serviceStatus,
"NAME": monitorName,
"HOSTNAME_OR_URL": monitorHostnameOrURL,
// variables which are officially supported
"status": serviceStatus,
"name": monitorName,
"hostnameOrURL": monitorHostnameOrURL,
monitorJSON,
heartbeatJSON,
msg,
};
return engine.render(parsedTpl, context);
}
/** /**
* Throws an error * Throws an error
* @param {any} error The error to throw * @param {any} error The error to throw

View file

@ -0,0 +1,73 @@
const NotificationProvider = require("./notification-provider");
const axios = require("axios");
const { DOWN, UP } = require("../../src/util");
class OneChat extends NotificationProvider {
name = "OneChat";
/**
* @inheritdoc
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
const okMsg = "Sent Successfully.";
const url = "https://chat-api.one.th/message/api/v1/push_message";
try {
const config = {
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + notification.accessToken,
},
};
if (heartbeatJSON == null) {
const testMessage = {
to: notification.recieverId,
bot_id: notification.botId,
type: "text",
message: "Test Successful!",
};
await axios.post(url, testMessage, config);
} else if (heartbeatJSON["status"] === DOWN) {
const downMessage = {
to: notification.recieverId,
bot_id: notification.botId,
type: "text",
message:
`UptimeKuma Alert:
[🔴 Down]
Name: ${monitorJSON["name"]}
${heartbeatJSON["msg"]}
Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`,
};
await axios.post(url, downMessage, config);
} else if (heartbeatJSON["status"] === UP) {
const upMessage = {
to: notification.recieverId,
bot_id: notification.botId,
type: "text",
message:
`UptimeKuma Alert:
[🟢 Up]
Name: ${monitorJSON["name"]}
${heartbeatJSON["msg"]}
Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`,
};
await axios.post(url, upMessage, config);
}
return okMsg;
} catch (error) {
// Handle errors and throw a descriptive message
if (error.response) {
const errorMessage =
error.response.data?.message ||
"Unknown API error occurred.";
throw new Error(`OneChat API Error: ${errorMessage}`);
} else {
this.throwGeneralAxiosError(error);
}
}
}
}
module.exports = OneChat;

View file

@ -0,0 +1,48 @@
const NotificationProvider = require("./notification-provider");
const axios = require("axios");
const { UP } = require("../../src/util");
class Pumble extends NotificationProvider {
name = "pumble";
/**
* @inheritDoc
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
const okMsg = "Sent Successfully.";
try {
if (heartbeatJSON === null && monitorJSON === null) {
let data = {
"attachments": [
{
"title": "Uptime Kuma Alert",
"text": msg,
"color": "#5BDD8B"
}
]
};
await axios.post(notification.webhookURL, data);
return okMsg;
}
let data = {
"attachments": [
{
"title": `${monitorJSON["name"]} is ${heartbeatJSON["status"] === UP ? "up" : "down"}`,
"text": heartbeatJSON["msg"],
"color": (heartbeatJSON["status"] === UP ? "#5BDD8B" : "#DC3645"),
}
]
};
await axios.post(notification.webhookURL, data);
return okMsg;
} catch (error) {
this.throwGeneralAxiosError(error);
}
}
}
module.exports = Pumble;

View file

@ -11,7 +11,8 @@ class PushDeer extends NotificationProvider {
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
const okMsg = "Sent Successfully."; const okMsg = "Sent Successfully.";
const serverUrl = notification.pushdeerServer || "https://api2.pushdeer.com"; const serverUrl = notification.pushdeerServer || "https://api2.pushdeer.com";
const url = `${serverUrl.trim().replace(/\/*$/, "")}/message/push`; // capture group below is nessesary to prevent an ReDOS-attack
const url = `${serverUrl.trim().replace(/([^/])\/+$/, "$1")}/message/push`;
let valid = msg != null && monitorJSON != null && heartbeatJSON != null; let valid = msg != null && monitorJSON != null && heartbeatJSON != null;

View file

@ -1,5 +1,6 @@
const { getMonitorRelativeURL } = require("../../src/util"); const { getMonitorRelativeURL } = require("../../src/util");
const { setting } = require("../util-server"); const { setting } = require("../util-server");
const { UP } = require("../../src/util");
const NotificationProvider = require("./notification-provider"); const NotificationProvider = require("./notification-provider");
const axios = require("axios"); const axios = require("axios");
@ -43,15 +44,20 @@ class Pushover extends NotificationProvider {
if (heartbeatJSON == null) { if (heartbeatJSON == null) {
await axios.post(url, data); await axios.post(url, data);
return okMsg; return okMsg;
} else {
data.message += `\n<b>Time (${heartbeatJSON["timezone"]})</b>:${heartbeatJSON["localDateTime"]}`;
await axios.post(url, data);
return okMsg;
} }
if (heartbeatJSON.status === UP && notification.pushoversounds_up) {
// default = DOWN => DOWN-sound is also played for non-UP/DOWN notiifcations
data.sound = notification.pushoversounds_up;
}
data.message += `\n<b>Time (${heartbeatJSON["timezone"]})</b>: ${heartbeatJSON["localDateTime"]}`;
await axios.post(url, data);
return okMsg;
} catch (error) { } catch (error) {
this.throwGeneralAxiosError(error); this.throwGeneralAxiosError(error);
} }
} }
} }

View file

@ -0,0 +1,56 @@
const NotificationProvider = require("./notification-provider");
const axios = require("axios");
const { DOWN, UP } = require("../../src/util");
class PushPlus extends NotificationProvider {
name = "PushPlus";
/**
* @inheritdoc
* @param {BeanModel} notification Notification object
* @param {string} msg Message content
* @param {?object} monitorJSON Monitor details
* @param {?object} heartbeatJSON Heartbeat details
* @returns {Promise<string>} Success message
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
const okMsg = "Sent Successfully.";
const url = "https://www.pushplus.plus/send";
try {
const config = {
headers: {
"Content-Type": "application/json",
},
};
const params = {
"token": notification.pushPlusSendKey,
"title": this.checkStatus(heartbeatJSON, monitorJSON),
"content": msg,
"template": "html"
};
await axios.post(url, params, config);
return okMsg;
} catch (error) {
this.throwGeneralAxiosError(error);
}
}
/**
* Get the formatted title for message
* @param {?object} heartbeatJSON Heartbeat details (For Up/Down only)
* @param {?object} monitorJSON Monitor details (For Up/Down only)
* @returns {string} Formatted title
*/
checkStatus(heartbeatJSON, monitorJSON) {
let title = "UptimeKuma Message";
if (heartbeatJSON != null && heartbeatJSON["status"] === UP) {
title = "UptimeKuma Monitor Up " + monitorJSON["name"];
}
if (heartbeatJSON != null && heartbeatJSON["status"] === DOWN) {
title = "UptimeKuma Monitor Down " + monitorJSON["name"];
}
return title;
}
}
module.exports = PushPlus;

View file

@ -145,6 +145,7 @@ class Slack extends NotificationProvider {
const title = "Uptime Kuma Alert"; const title = "Uptime Kuma Alert";
let data = { let data = {
"text": msg,
"channel": notification.slackchannel, "channel": notification.slackchannel,
"username": notification.slackusername, "username": notification.slackusername,
"icon_emoji": notification.slackiconemo, "icon_emoji": notification.slackiconemo,

View file

@ -0,0 +1,40 @@
const NotificationProvider = require("./notification-provider");
const axios = require("axios");
class SMSPlanet extends NotificationProvider {
name = "SMSPlanet";
/**
* @inheritdoc
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
const okMsg = "Sent Successfully.";
const url = "https://api2.smsplanet.pl/sms";
try {
let config = {
headers: {
"Authorization": "Bearer " + notification.smsplanetApiToken,
"content-type": "multipart/form-data"
}
};
let data = {
"from": notification.smsplanetSenderName,
"to": notification.smsplanetPhoneNumbers,
"msg": msg.replace(/🔴/, "❌")
};
let response = await axios.post(url, data, config);
if (!response.data?.messageId) {
throw new Error(response.data?.errorMsg ?? "SMSPlanet server did not respond with the expected result");
}
return okMsg;
} catch (error) {
this.throwGeneralAxiosError(error);
}
}
}
module.exports = SMSPlanet;

View file

@ -11,59 +11,127 @@ class SMSEagle extends NotificationProvider {
const okMsg = "Sent Successfully."; const okMsg = "Sent Successfully.";
try { try {
let config = { if (notification.smseagleApiType === "smseagle-apiv1") { // according to https://www.smseagle.eu/apiv1/
headers: { let config = {
"Content-Type": "application/json", headers: {
"Content-Type": "application/x-www-form-urlencoded",
}
};
let sendMethod;
let recipientType;
let duration;
let voiceId;
if (notification.smseagleRecipientType === "smseagle-contact") {
recipientType = "contactname";
sendMethod = "/send_tocontact";
} else if (notification.smseagleRecipientType === "smseagle-group") {
recipientType = "groupname";
sendMethod = "/send_togroup";
} else if (notification.smseagleRecipientType === "smseagle-to") {
recipientType = "to";
sendMethod = "/send_sms";
if (notification.smseagleMsgType !== "smseagle-sms") {
duration = notification.smseagleDuration ?? 10;
if (notification.smseagleMsgType === "smseagle-ring") {
sendMethod = "/ring_call";
} else if (notification.smseagleMsgType === "smseagle-tts") {
sendMethod = "/tts_call";
} else if (notification.smseagleMsgType === "smseagle-tts-advanced") {
sendMethod = "/tts_adv_call";
voiceId = notification.smseagleTtsModel ? notification.smseagleTtsModel : 1;
}
}
} }
};
let postData; const url = new URL(notification.smseagleUrl + "/http_api" + sendMethod);
let sendMethod;
let recipientType;
let encoding = (notification.smseagleEncoding) ? "1" : "0"; url.searchParams.append("access_token", notification.smseagleToken);
let priority = (notification.smseaglePriority) ? notification.smseaglePriority : "0"; url.searchParams.append(recipientType, notification.smseagleRecipient);
if (!notification.smseagleRecipientType || notification.smseagleRecipientType === "smseagle-sms") {
if (notification.smseagleRecipientType === "smseagle-contact") { url.searchParams.append("unicode", (notification.smseagleEncoding) ? "1" : "0");
recipientType = "contactname"; url.searchParams.append("highpriority", notification.smseaglePriority ?? "0");
sendMethod = "sms.send_tocontact";
}
if (notification.smseagleRecipientType === "smseagle-group") {
recipientType = "groupname";
sendMethod = "sms.send_togroup";
}
if (notification.smseagleRecipientType === "smseagle-to") {
recipientType = "to";
sendMethod = "sms.send_sms";
}
let params = {
access_token: notification.smseagleToken,
[recipientType]: notification.smseagleRecipient,
message: msg,
responsetype: "extended",
unicode: encoding,
highpriority: priority
};
postData = {
method: sendMethod,
params: params
};
let resp = await axios.post(notification.smseagleUrl + "/jsonrpc/sms", postData, config);
if ((JSON.stringify(resp.data)).indexOf("message_id") === -1) {
let error = "";
if (resp.data.result && resp.data.result.error_text) {
error = `SMSEagle API returned error: ${JSON.stringify(resp.data.result.error_text)}`;
} else { } else {
error = "SMSEagle API returned an unexpected response"; url.searchParams.append("duration", duration);
}
if (notification.smseagleRecipientType !== "smseagle-ring") {
url.searchParams.append("message", msg);
}
if (voiceId) {
url.searchParams.append("voice_id", voiceId);
} }
throw new Error(error);
}
return okMsg; let resp = await axios.get(url.toString(), config);
if (resp.data.indexOf("OK") === -1) {
let error = `SMSEagle API returned error: ${resp.data}`;
throw new Error(error);
}
return okMsg;
} else if (notification.smseagleApiType === "smseagle-apiv2") { // according to https://www.smseagle.eu/docs/apiv2/
let config = {
headers: {
"access-token": notification.smseagleToken,
"Content-Type": "application/json",
}
};
let encoding = (notification.smseagleEncoding) ? "unicode" : "standard";
let priority = (notification.smseaglePriority) ?? 0;
let postData = {
text: msg,
encoding: encoding,
priority: priority
};
if (notification.smseagleRecipientContact) {
postData["contacts"] = notification.smseagleRecipientContact.split(",").map(Number);
}
if (notification.smseagleRecipientGroup) {
postData["groups"] = notification.smseagleRecipientGroup.split(",").map(Number);
}
if (notification.smseagleRecipientTo) {
postData["to"] = notification.smseagleRecipientTo.split(",");
}
let endpoint = "/messages/sms";
if (notification.smseagleMsgType !== "smseagle-sms") {
postData["duration"] = notification.smseagleDuration ?? 10;
if (notification.smseagleMsgType === "smseagle-ring") {
endpoint = "/calls/ring";
} else if (notification.smseagleMsgType === "smseagle-tts") {
endpoint = "/calls/tts";
} else if (notification.smseagleMsgType === "smseagle-tts-advanced") {
endpoint = "/calls/tts_advanced";
postData["voice_id"] = notification.smseagleTtsModel ?? 1;
}
}
let resp = await axios.post(notification.smseagleUrl + "/api/v2" + endpoint, postData, config);
const queuedCount = resp.data.filter(x => x.status === "queued").length;
const unqueuedCount = resp.data.length - queuedCount;
if (resp.status !== 200 || queuedCount === 0) {
if (!resp.data.length) {
throw new Error("SMSEagle API returned an empty response");
}
throw new Error(`SMSEagle API returned error: ${JSON.stringify(resp.data)}`);
}
if (unqueuedCount) {
return `Sent ${queuedCount}/${resp.data.length} Messages Successfully.`;
}
return okMsg;
}
} catch (error) { } catch (error) {
this.throwGeneralAxiosError(error); this.throwGeneralAxiosError(error);
} }

View file

@ -1,7 +1,5 @@
const nodemailer = require("nodemailer"); const nodemailer = require("nodemailer");
const NotificationProvider = require("./notification-provider"); const NotificationProvider = require("./notification-provider");
const { DOWN } = require("../../src/util");
const { Liquid } = require("liquidjs");
class SMTP extends NotificationProvider { class SMTP extends NotificationProvider {
name = "smtp"; name = "smtp";
@ -44,6 +42,7 @@ class SMTP extends NotificationProvider {
// default values in case the user does not want to template // default values in case the user does not want to template
let subject = msg; let subject = msg;
let body = msg; let body = msg;
let useHTMLBody = false;
if (heartbeatJSON) { if (heartbeatJSON) {
body = `${msg}\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`; body = `${msg}\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`;
} }
@ -52,16 +51,12 @@ class SMTP extends NotificationProvider {
// cannot end with whitespace as this often raises spam scores // cannot end with whitespace as this often raises spam scores
const customSubject = notification.customSubject?.trim() || ""; const customSubject = notification.customSubject?.trim() || "";
const customBody = notification.customBody?.trim() || ""; const customBody = notification.customBody?.trim() || "";
const context = this.generateContext(msg, monitorJSON, heartbeatJSON);
const engine = new Liquid();
if (customSubject !== "") { if (customSubject !== "") {
const tpl = engine.parse(customSubject); subject = await this.renderTemplate(customSubject, msg, monitorJSON, heartbeatJSON);
subject = await engine.render(tpl, context);
} }
if (customBody !== "") { if (customBody !== "") {
const tpl = engine.parse(customBody); useHTMLBody = notification.htmlBody || false;
body = await engine.render(tpl, context); body = await this.renderTemplate(customBody, msg, monitorJSON, heartbeatJSON);
} }
} }
@ -73,48 +68,12 @@ class SMTP extends NotificationProvider {
bcc: notification.smtpBCC, bcc: notification.smtpBCC,
to: notification.smtpTo, to: notification.smtpTo,
subject: subject, subject: subject,
text: body, // If the email body is custom, and the user wants it, set the email body as HTML
[useHTMLBody ? "html" : "text"]: body
}); });
return okMsg; return okMsg;
} }
/**
* Generate context for LiquidJS
* @param {string} msg the message that will be included in the context
* @param {?object} monitorJSON Monitor details (For Up/Down/Cert-Expiry only)
* @param {?object} heartbeatJSON Heartbeat details (For Up/Down only)
* @returns {{STATUS: string, status: string, HOSTNAME_OR_URL: string, hostnameOrUrl: string, NAME: string, name: string, monitorJSON: ?object, heartbeatJSON: ?object, msg: string}} the context
*/
generateContext(msg, monitorJSON, heartbeatJSON) {
// Let's start with dummy values to simplify code
let monitorName = "Monitor Name not available";
let monitorHostnameOrURL = "testing.hostname";
if (monitorJSON !== null) {
monitorName = monitorJSON["name"];
monitorHostnameOrURL = this.extractAddress(monitorJSON);
}
let serviceStatus = "⚠️ Test";
if (heartbeatJSON !== null) {
serviceStatus = (heartbeatJSON["status"] === DOWN) ? "🔴 Down" : "✅ Up";
}
return {
// for v1 compatibility, to be removed in v3
"STATUS": serviceStatus,
"NAME": monitorName,
"HOSTNAME_OR_URL": monitorHostnameOrURL,
// variables which are officially supported
"status": serviceStatus,
"name": monitorName,
"hostnameOrURL": monitorHostnameOrURL,
monitorJSON,
heartbeatJSON,
msg,
};
}
} }
module.exports = SMTP; module.exports = SMTP;

View file

@ -0,0 +1,37 @@
const NotificationProvider = require("./notification-provider");
const axios = require("axios");
const { DOWN, UP } = require("../../src/util");
class SpugPush extends NotificationProvider {
name = "SpugPush";
/**
* @inheritdoc
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
let okMsg = "Sent Successfully.";
try {
let formData = {
title: "Uptime Kuma Message",
content: msg
};
if (heartbeatJSON) {
if (heartbeatJSON["status"] === UP) {
formData.title = `UptimeKuma 「${monitorJSON["name"]}」 is Up`;
formData.content = `[✅ Up] ${heartbeatJSON["msg"]}`;
} else if (heartbeatJSON["status"] === DOWN) {
formData.title = `UptimeKuma 「${monitorJSON["name"]}」 is Down`;
formData.content = `[🔴 Down] ${heartbeatJSON["msg"]}`;
}
}
const apiUrl = `https://push.spug.cc/send/${notification.templateKey}`;
await axios.post(apiUrl, formData);
return okMsg;
} catch (error) {
this.throwGeneralAxiosError(error);
}
}
}
module.exports = SpugPush;

View file

@ -9,7 +9,7 @@ class Telegram extends NotificationProvider {
*/ */
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
const okMsg = "Sent Successfully."; const okMsg = "Sent Successfully.";
const url = "https://api.telegram.org"; const url = notification.telegramServerUrl ?? "https://api.telegram.org";
try { try {
let params = { let params = {
@ -22,6 +22,14 @@ class Telegram extends NotificationProvider {
params.message_thread_id = notification.telegramMessageThreadID; params.message_thread_id = notification.telegramMessageThreadID;
} }
if (notification.telegramUseTemplate) {
params.text = await this.renderTemplate(notification.telegramTemplate, msg, monitorJSON, heartbeatJSON);
if (notification.telegramTemplateParseMode !== "plain") {
params.parse_mode = notification.telegramTemplateParseMode;
}
}
await axios.get(`${url}/bot${notification.telegramBotToken}/sendMessage`, { await axios.get(`${url}/bot${notification.telegramBotToken}/sendMessage`, {
params: params, params: params,
}); });

View file

@ -0,0 +1,40 @@
const NotificationProvider = require("./notification-provider");
const axios = require("axios");
class WAHA extends NotificationProvider {
name = "waha";
/**
* @inheritdoc
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
const okMsg = "Sent Successfully.";
try {
const config = {
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
"X-Api-Key": notification.wahaApiKey,
}
};
let data = {
"session": notification.wahaSession,
"chatId": notification.wahaChatId,
"text": msg,
};
let url = notification.wahaApiUrl.replace(/([^/])\/+$/, "$1") + "/api/sendText";
await axios.post(url, data, config);
return okMsg;
} catch (error) {
this.throwGeneralAxiosError(error);
}
}
}
module.exports = WAHA;

View file

@ -1,7 +1,6 @@
const NotificationProvider = require("./notification-provider"); const NotificationProvider = require("./notification-provider");
const axios = require("axios"); const axios = require("axios");
const FormData = require("form-data"); const FormData = require("form-data");
const { Liquid } = require("liquidjs");
class Webhook extends NotificationProvider { class Webhook extends NotificationProvider {
name = "webhook"; name = "webhook";
@ -28,17 +27,7 @@ class Webhook extends NotificationProvider {
config.headers = formData.getHeaders(); config.headers = formData.getHeaders();
data = formData; data = formData;
} else if (notification.webhookContentType === "custom") { } else if (notification.webhookContentType === "custom") {
// Initialize LiquidJS and parse the custom Body Template data = await this.renderTemplate(notification.webhookCustomBody, msg, monitorJSON, heartbeatJSON);
const engine = new Liquid();
const tpl = engine.parse(notification.webhookCustomBody);
// Insert templated values into Body
data = await engine.render(tpl,
{
msg,
heartbeatJSON,
monitorJSON
});
} }
if (notification.webhookAdditionalHeaders) { if (notification.webhookAdditionalHeaders) {

View file

@ -24,7 +24,7 @@ class Whapi extends NotificationProvider {
"body": msg, "body": msg,
}; };
let url = (notification.whapiApiUrl || "https://gate.whapi.cloud/").replace(/\/+$/, "") + "/messages/text"; let url = (notification.whapiApiUrl || "https://gate.whapi.cloud/").replace(/([^/])\/+$/, "$1") + "/messages/text";
await axios.post(url, data, config); await axios.post(url, data, config);

View file

@ -0,0 +1,57 @@
const NotificationProvider = require("./notification-provider");
const { DOWN, UP } = require("../../src/util");
const { default: axios } = require("axios");
class YZJ extends NotificationProvider {
name = "YZJ";
/**
* @inheritdoc
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
let okMsg = "Sent Successfully.";
try {
if (heartbeatJSON !== null) {
msg = `${this.statusToString(heartbeatJSON["status"])} ${monitorJSON["name"]} \n> ${heartbeatJSON["msg"]}\n> Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`;
}
const config = {
headers: {
"Content-Type": "application/json",
},
};
const params = {
content: msg
};
// yzjtype=0 => general robot
const url = `${notification.yzjWebHookUrl}?yzjtype=0&yzjtoken=${notification.yzjToken}`;
const result = await axios.post(url, params, config);
if (!result.data?.success) {
throw new Error(result.data?.errmsg ?? "yzj's server did not respond with the expected result");
}
return okMsg;
} catch (error) {
this.throwGeneralAxiosError(error);
}
}
/**
* Convert status constant to string
* @param {string} status The status constant
* @returns {string} status
*/
statusToString(status) {
switch (status) {
case DOWN:
return "❌";
case UP:
return "✅";
default:
return status;
}
}
}
module.exports = YZJ;

View file

@ -13,6 +13,7 @@ const DingDing = require("./notification-providers/dingding");
const Discord = require("./notification-providers/discord"); const Discord = require("./notification-providers/discord");
const Elks = require("./notification-providers/46elks"); const Elks = require("./notification-providers/46elks");
const Feishu = require("./notification-providers/feishu"); const Feishu = require("./notification-providers/feishu");
const Notifery = require("./notification-providers/notifery");
const FreeMobile = require("./notification-providers/freemobile"); const FreeMobile = require("./notification-providers/freemobile");
const GoogleChat = require("./notification-providers/google-chat"); const GoogleChat = require("./notification-providers/google-chat");
const Gorush = require("./notification-providers/gorush"); const Gorush = require("./notification-providers/gorush");
@ -30,15 +31,18 @@ const Mattermost = require("./notification-providers/mattermost");
const Nostr = require("./notification-providers/nostr"); const Nostr = require("./notification-providers/nostr");
const Ntfy = require("./notification-providers/ntfy"); const Ntfy = require("./notification-providers/ntfy");
const Octopush = require("./notification-providers/octopush"); const Octopush = require("./notification-providers/octopush");
const OneChat = require("./notification-providers/onechat");
const OneBot = require("./notification-providers/onebot"); const OneBot = require("./notification-providers/onebot");
const Opsgenie = require("./notification-providers/opsgenie"); const Opsgenie = require("./notification-providers/opsgenie");
const PagerDuty = require("./notification-providers/pagerduty"); const PagerDuty = require("./notification-providers/pagerduty");
const Pumble = require("./notification-providers/pumble");
const FlashDuty = require("./notification-providers/flashduty"); const FlashDuty = require("./notification-providers/flashduty");
const PagerTree = require("./notification-providers/pagertree"); const PagerTree = require("./notification-providers/pagertree");
const PromoSMS = require("./notification-providers/promosms"); const PromoSMS = require("./notification-providers/promosms");
const Pushbullet = require("./notification-providers/pushbullet"); const Pushbullet = require("./notification-providers/pushbullet");
const PushDeer = require("./notification-providers/pushdeer"); const PushDeer = require("./notification-providers/pushdeer");
const Pushover = require("./notification-providers/pushover"); const Pushover = require("./notification-providers/pushover");
const PushPlus = require("./notification-providers/pushplus");
const Pushy = require("./notification-providers/pushy"); const Pushy = require("./notification-providers/pushy");
const RocketChat = require("./notification-providers/rocket-chat"); const RocketChat = require("./notification-providers/rocket-chat");
const SerwerSMS = require("./notification-providers/serwersms"); const SerwerSMS = require("./notification-providers/serwersms");
@ -64,11 +68,15 @@ const ServerChan = require("./notification-providers/serverchan");
const ZohoCliq = require("./notification-providers/zoho-cliq"); const ZohoCliq = require("./notification-providers/zoho-cliq");
const SevenIO = require("./notification-providers/sevenio"); const SevenIO = require("./notification-providers/sevenio");
const Whapi = require("./notification-providers/whapi"); const Whapi = require("./notification-providers/whapi");
const WAHA = require("./notification-providers/waha");
const GtxMessaging = require("./notification-providers/gtx-messaging"); const GtxMessaging = require("./notification-providers/gtx-messaging");
const Cellsynt = require("./notification-providers/cellsynt"); const Cellsynt = require("./notification-providers/cellsynt");
const Onesender = require("./notification-providers/onesender"); const Onesender = require("./notification-providers/onesender");
const Wpush = require("./notification-providers/wpush"); const Wpush = require("./notification-providers/wpush");
const SendGrid = require("./notification-providers/send-grid"); const SendGrid = require("./notification-providers/send-grid");
const YZJ = require("./notification-providers/yzj");
const SMSPlanet = require("./notification-providers/sms-planet");
const SpugPush = require("./notification-providers/spugpush");
class Notification { class Notification {
@ -116,6 +124,7 @@ class Notification {
new Nostr(), new Nostr(),
new Ntfy(), new Ntfy(),
new Octopush(), new Octopush(),
new OneChat(),
new OneBot(), new OneBot(),
new Onesender(), new Onesender(),
new Opsgenie(), new Opsgenie(),
@ -123,9 +132,11 @@ class Notification {
new FlashDuty(), new FlashDuty(),
new PagerTree(), new PagerTree(),
new PromoSMS(), new PromoSMS(),
new Pumble(),
new Pushbullet(), new Pushbullet(),
new PushDeer(), new PushDeer(),
new Pushover(), new Pushover(),
new PushPlus(),
new Pushy(), new Pushy(),
new RocketChat(), new RocketChat(),
new ServerChan(), new ServerChan(),
@ -151,10 +162,15 @@ class Notification {
new ZohoCliq(), new ZohoCliq(),
new SevenIO(), new SevenIO(),
new Whapi(), new Whapi(),
new WAHA(),
new GtxMessaging(), new GtxMessaging(),
new Cellsynt(), new Cellsynt(),
new Wpush(), new Wpush(),
new SendGrid() new SendGrid(),
new YZJ(),
new SMSPlanet(),
new SpugPush(),
new Notifery(),
]; ];
for (let item of list) { for (let item of list) {
if (! item.name) { if (! item.name) {

View file

@ -1,7 +1,7 @@
const { R } = require("redbean-node"); const { R } = require("redbean-node");
const HttpProxyAgent = require("http-proxy-agent"); const { HttpProxyAgent } = require("http-proxy-agent");
const HttpsProxyAgent = require("https-proxy-agent"); const { HttpsProxyAgent } = require("https-proxy-agent");
const SocksProxyAgent = require("socks-proxy-agent"); const { SocksProxyAgent } = require("socks-proxy-agent");
const { debug } = require("../src/util"); const { debug } = require("../src/util");
const { UptimeKumaServer } = require("./uptime-kuma-server"); const { UptimeKumaServer } = require("./uptime-kuma-server");
const { CookieJar } = require("tough-cookie"); const { CookieJar } = require("tough-cookie");
@ -100,17 +100,17 @@ class Proxy {
let jar = new CookieJar(); let jar = new CookieJar();
const proxyOptions = { const proxyOptions = {
protocol: proxy.protocol,
host: proxy.host,
port: proxy.port,
cookies: { jar }, cookies: { jar },
}; };
const proxyUrl = new URL(`${proxy.protocol}://${proxy.host}:${proxy.port}`);
if (proxy.auth) { if (proxy.auth) {
proxyOptions.auth = `${proxy.username}:${proxy.password}`; proxyUrl.username = proxy.username;
proxyUrl.password = proxy.password;
} }
debug(`Proxy Options: ${JSON.stringify(proxyOptions)}`); debug(`Proxy URL: ${proxyUrl.toString()}`);
debug(`HTTP Agent Options: ${JSON.stringify(httpAgentOptions)}`); debug(`HTTP Agent Options: ${JSON.stringify(httpAgentOptions)}`);
debug(`HTTPS Agent Options: ${JSON.stringify(httpsAgentOptions)}`); debug(`HTTPS Agent Options: ${JSON.stringify(httpsAgentOptions)}`);
@ -122,15 +122,15 @@ class Proxy {
// eslint-disable-next-line no-case-declarations // eslint-disable-next-line no-case-declarations
const HttpsCookieProxyAgent = createCookieAgent(HttpsProxyAgent); const HttpsCookieProxyAgent = createCookieAgent(HttpsProxyAgent);
httpAgent = new HttpCookieProxyAgent({ httpAgent = new HttpCookieProxyAgent(proxyUrl.toString(), {
...httpAgentOptions || {}, ...(httpAgentOptions || {}),
...proxyOptions,
});
httpsAgent = new HttpsCookieProxyAgent(proxyUrl.toString(), {
...(httpsAgentOptions || {}),
...proxyOptions, ...proxyOptions,
}); });
httpsAgent = new HttpsCookieProxyAgent({
...httpsAgentOptions || {},
...proxyOptions,
});
break; break;
case "socks": case "socks":
case "socks5": case "socks5":
@ -138,10 +138,9 @@ class Proxy {
case "socks4": case "socks4":
// eslint-disable-next-line no-case-declarations // eslint-disable-next-line no-case-declarations
const SocksCookieProxyAgent = createCookieAgent(SocksProxyAgent); const SocksCookieProxyAgent = createCookieAgent(SocksProxyAgent);
agent = new SocksCookieProxyAgent({ agent = new SocksCookieProxyAgent(proxyUrl.toString(), {
...httpAgentOptions, ...httpAgentOptions,
...httpsAgentOptions, ...httpsAgentOptions,
...proxyOptions,
tls: { tls: {
rejectUnauthorized: httpsAgentOptions.rejectUnauthorized, rejectUnauthorized: httpsAgentOptions.rejectUnauthorized,
}, },

View file

@ -50,7 +50,7 @@ router.all("/api/push/:pushToken", async (request, response) => {
let msg = request.query.msg || "OK"; let msg = request.query.msg || "OK";
let ping = parseFloat(request.query.ping) || null; let ping = parseFloat(request.query.ping) || null;
let statusString = request.query.status || "up"; let statusString = request.query.status || "up";
let status = (statusString === "up") ? UP : DOWN; const statusFromParam = (statusString === "up") ? UP : DOWN;
let monitor = await R.findOne("monitor", " push_token = ? AND active = 1 ", [ let monitor = await R.findOne("monitor", " push_token = ? AND active = 1 ", [
pushToken pushToken
@ -80,7 +80,7 @@ router.all("/api/push/:pushToken", async (request, response) => {
msg = "Monitor under maintenance"; msg = "Monitor under maintenance";
bean.status = MAINTENANCE; bean.status = MAINTENANCE;
} else { } else {
determineStatus(status, previousHeartbeat, monitor.maxretries, monitor.isUpsideDown(), bean); determineStatus(statusFromParam, previousHeartbeat, monitor.maxretries, monitor.isUpsideDown(), bean);
} }
// Calculate uptime // Calculate uptime
@ -92,21 +92,21 @@ router.all("/api/push/:pushToken", async (request, response) => {
log.debug("router", "PreviousStatus: " + previousHeartbeat?.status); log.debug("router", "PreviousStatus: " + previousHeartbeat?.status);
log.debug("router", "Current Status: " + bean.status); log.debug("router", "Current Status: " + bean.status);
bean.important = Monitor.isImportantBeat(isFirstBeat, previousHeartbeat?.status, status); bean.important = Monitor.isImportantBeat(isFirstBeat, previousHeartbeat?.status, bean.status);
if (Monitor.isImportantForNotification(isFirstBeat, previousHeartbeat?.status, status)) { if (Monitor.isImportantForNotification(isFirstBeat, previousHeartbeat?.status, bean.status)) {
// Reset down count // Reset down count
bean.downCount = 0; bean.downCount = 0;
log.debug("monitor", `[${this.name}] sendNotification`); log.debug("monitor", `[${monitor.name}] sendNotification`);
await Monitor.sendNotification(isFirstBeat, monitor, bean); await Monitor.sendNotification(isFirstBeat, monitor, bean);
} else { } else {
if (bean.status === DOWN && this.resendInterval > 0) { if (bean.status === DOWN && monitor.resendInterval > 0) {
++bean.downCount; ++bean.downCount;
if (bean.downCount >= this.resendInterval) { if (bean.downCount >= monitor.resendInterval) {
// Send notification again, because we are still DOWN // Send notification again, because we are still DOWN
log.debug("monitor", `[${this.name}] sendNotification again: Down Count: ${bean.downCount} | Resend Interval: ${this.resendInterval}`); log.debug("monitor", `[${monitor.name}] sendNotification again: Down Count: ${bean.downCount} | Resend Interval: ${monitor.resendInterval}`);
await Monitor.sendNotification(isFirstBeat, this, bean); await Monitor.sendNotification(isFirstBeat, monitor, bean);
// Reset down count // Reset down count
bean.downCount = 0; bean.downCount = 0;

View file

@ -15,11 +15,13 @@ const server = UptimeKumaServer.getInstance();
router.get("/status/:slug", cache("5 minutes"), async (request, response) => { router.get("/status/:slug", cache("5 minutes"), async (request, response) => {
let slug = request.params.slug; let slug = request.params.slug;
slug = slug.toLowerCase();
await StatusPage.handleStatusPageResponse(response, server.indexHTML, slug); await StatusPage.handleStatusPageResponse(response, server.indexHTML, slug);
}); });
router.get("/status/:slug/rss", cache("5 minutes"), async (request, response) => { router.get("/status/:slug/rss", cache("5 minutes"), async (request, response) => {
let slug = request.params.slug; let slug = request.params.slug;
slug = slug.toLowerCase();
await StatusPage.handleStatusPageRSSResponse(response, slug); await StatusPage.handleStatusPageRSSResponse(response, slug);
}); });
@ -37,6 +39,7 @@ router.get("/status-page", cache("5 minutes"), async (request, response) => {
router.get("/api/status-page/:slug", cache("5 minutes"), async (request, response) => { router.get("/api/status-page/:slug", cache("5 minutes"), async (request, response) => {
allowDevAllOrigin(response); allowDevAllOrigin(response);
let slug = request.params.slug; let slug = request.params.slug;
slug = slug.toLowerCase();
try { try {
// Get Status Page // Get Status Page
@ -69,6 +72,7 @@ router.get("/api/status-page/heartbeat/:slug", cache("1 minutes"), async (reques
let uptimeList = {}; let uptimeList = {};
let slug = request.params.slug; let slug = request.params.slug;
slug = slug.toLowerCase();
let statusPageID = await StatusPage.slugToID(slug); let statusPageID = await StatusPage.slugToID(slug);
let monitorIDList = await R.getCol(` let monitorIDList = await R.getCol(`
@ -85,7 +89,7 @@ router.get("/api/status-page/heartbeat/:slug", cache("1 minutes"), async (reques
SELECT * FROM heartbeat SELECT * FROM heartbeat
WHERE monitor_id = ? WHERE monitor_id = ?
ORDER BY time DESC ORDER BY time DESC
LIMIT 50 LIMIT 100
`, [ `, [
monitorID, monitorID,
]); ]);
@ -111,6 +115,7 @@ router.get("/api/status-page/heartbeat/:slug", cache("1 minutes"), async (reques
router.get("/api/status-page/:slug/manifest.json", cache("1440 minutes"), async (request, response) => { router.get("/api/status-page/:slug/manifest.json", cache("1440 minutes"), async (request, response) => {
allowDevAllOrigin(response); allowDevAllOrigin(response);
let slug = request.params.slug; let slug = request.params.slug;
slug = slug.toLowerCase();
try { try {
// Get Status Page // Get Status Page
@ -145,7 +150,8 @@ router.get("/api/status-page/:slug/manifest.json", cache("1440 minutes"), async
// overall status-page status badge // overall status-page status badge
router.get("/api/status-page/:slug/badge", cache("5 minutes"), async (request, response) => { router.get("/api/status-page/:slug/badge", cache("5 minutes"), async (request, response) => {
allowDevAllOrigin(response); allowDevAllOrigin(response);
const slug = request.params.slug; let slug = request.params.slug;
slug = slug.toLowerCase();
const statusPageID = await StatusPage.slugToID(slug); const statusPageID = await StatusPage.slugToID(slug);
const { const {
label, label,

View file

@ -866,6 +866,7 @@ let needSetup = false;
monitor.kafkaProducerAllowAutoTopicCreation; monitor.kafkaProducerAllowAutoTopicCreation;
bean.gamedigGivenPortOnly = monitor.gamedigGivenPortOnly; bean.gamedigGivenPortOnly = monitor.gamedigGivenPortOnly;
bean.remote_browser = monitor.remote_browser; bean.remote_browser = monitor.remote_browser;
bean.smtpSecurity = monitor.smtpSecurity;
bean.snmpVersion = monitor.snmpVersion; bean.snmpVersion = monitor.snmpVersion;
bean.snmpOid = monitor.snmpOid; bean.snmpOid = monitor.snmpOid;
bean.jsonPathOperator = monitor.jsonPathOperator; bean.jsonPathOperator = monitor.jsonPathOperator;
@ -875,6 +876,11 @@ let needSetup = false;
bean.rabbitmqPassword = monitor.rabbitmqPassword; bean.rabbitmqPassword = monitor.rabbitmqPassword;
bean.conditions = JSON.stringify(monitor.conditions); bean.conditions = JSON.stringify(monitor.conditions);
// ping advanced options
bean.ping_numeric = monitor.ping_numeric;
bean.ping_count = monitor.ping_count;
bean.ping_per_request_timeout = monitor.ping_per_request_timeout;
bean.validate(); bean.validate();
await R.store(bean); await R.store(bean);

View file

@ -213,6 +213,10 @@ module.exports.statusPageSocketHandler = (socket) => {
relationBean.send_url = monitor.sendUrl; relationBean.send_url = monitor.sendUrl;
} }
if (monitor.url !== undefined) {
relationBean.custom_url = monitor.url;
}
await R.store(relationBean); await R.store(relationBean);
} }
@ -294,6 +298,7 @@ module.exports.statusPageSocketHandler = (socket) => {
ok: true, ok: true,
msg: "successAdded", msg: "successAdded",
msgi18n: true, msgi18n: true,
slug: slug
}); });
} catch (error) { } catch (error) {

View file

@ -113,6 +113,8 @@ class UptimeKumaServer {
UptimeKumaServer.monitorTypeList["tailscale-ping"] = new TailscalePing(); UptimeKumaServer.monitorTypeList["tailscale-ping"] = new TailscalePing();
UptimeKumaServer.monitorTypeList["dns"] = new DnsMonitorType(); UptimeKumaServer.monitorTypeList["dns"] = new DnsMonitorType();
UptimeKumaServer.monitorTypeList["mqtt"] = new MqttMonitorType(); UptimeKumaServer.monitorTypeList["mqtt"] = new MqttMonitorType();
UptimeKumaServer.monitorTypeList["smtp"] = new SMTPMonitorType();
UptimeKumaServer.monitorTypeList["group"] = new GroupMonitorType();
UptimeKumaServer.monitorTypeList["snmp"] = new SNMPMonitorType(); UptimeKumaServer.monitorTypeList["snmp"] = new SNMPMonitorType();
UptimeKumaServer.monitorTypeList["mongodb"] = new MongodbMonitorType(); UptimeKumaServer.monitorTypeList["mongodb"] = new MongodbMonitorType();
UptimeKumaServer.monitorTypeList["rabbitmq"] = new RabbitMqMonitorType(); UptimeKumaServer.monitorTypeList["rabbitmq"] = new RabbitMqMonitorType();
@ -551,6 +553,8 @@ const { RealBrowserMonitorType } = require("./monitor-types/real-browser-monitor
const { TailscalePing } = require("./monitor-types/tailscale-ping"); const { TailscalePing } = require("./monitor-types/tailscale-ping");
const { DnsMonitorType } = require("./monitor-types/dns"); const { DnsMonitorType } = require("./monitor-types/dns");
const { MqttMonitorType } = require("./monitor-types/mqtt"); const { MqttMonitorType } = require("./monitor-types/mqtt");
const { SMTPMonitorType } = require("./monitor-types/smtp");
const { GroupMonitorType } = require("./monitor-types/group");
const { SNMPMonitorType } = require("./monitor-types/snmp"); const { SNMPMonitorType } = require("./monitor-types/snmp");
const { MongodbMonitorType } = require("./monitor-types/mongodb"); const { MongodbMonitorType } = require("./monitor-types/mongodb");
const { RabbitMqMonitorType } = require("./monitor-types/rabbitmq"); const { RabbitMqMonitorType } = require("./monitor-types/rabbitmq");

View file

@ -1,7 +1,11 @@
const tcpp = require("tcp-ping"); const tcpp = require("tcp-ping");
const ping = require("@louislam/ping"); const ping = require("@louislam/ping");
const { R } = require("redbean-node"); const { R } = require("redbean-node");
const { log, genSecret, badgeConstants } = require("../src/util"); const {
log, genSecret, badgeConstants,
PING_PACKET_SIZE_DEFAULT, PING_GLOBAL_TIMEOUT_DEFAULT,
PING_COUNT_DEFAULT, PING_PER_REQUEST_TIMEOUT_DEFAULT
} = require("../src/util");
const passwordHash = require("./password-hash"); const passwordHash = require("./password-hash");
const { Resolver } = require("dns"); const { Resolver } = require("dns");
const iconv = require("iconv-lite"); const iconv = require("iconv-lite");
@ -118,20 +122,33 @@ exports.tcping = function (hostname, port) {
/** /**
* Ping the specified machine * Ping the specified machine
* @param {string} hostname Hostname / address of machine * @param {string} destAddr Hostname / IP address of machine to ping
* @param {number} size Size of packet to send * @param {number} count Number of packets to send before stopping
* @param {string} sourceAddr Source address for sending/receiving echo requests
* @param {boolean} numeric If true, IP addresses will be output instead of symbolic hostnames
* @param {number} size Size (in bytes) of echo request to send
* @param {number} deadline Maximum time in seconds before ping stops, regardless of packets sent
* @param {number} timeout Maximum time in seconds to wait for each response
* @returns {Promise<number>} Time for ping in ms rounded to nearest integer * @returns {Promise<number>} Time for ping in ms rounded to nearest integer
*/ */
exports.ping = async (hostname, size = 56) => { exports.ping = async (
destAddr,
count = PING_COUNT_DEFAULT,
sourceAddr = "",
numeric = true,
size = PING_PACKET_SIZE_DEFAULT,
deadline = PING_GLOBAL_TIMEOUT_DEFAULT,
timeout = PING_PER_REQUEST_TIMEOUT_DEFAULT,
) => {
try { try {
return await exports.pingAsync(hostname, false, size); return await exports.pingAsync(destAddr, false, count, sourceAddr, numeric, size, deadline, timeout);
} catch (e) { } catch (e) {
// If the host cannot be resolved, try again with ipv6 // If the host cannot be resolved, try again with ipv6
log.debug("ping", "IPv6 error message: " + e.message); log.debug("ping", "IPv6 error message: " + e.message);
// As node-ping does not report a specific error for this, try again if it is an empty message with ipv6 no matter what. // As node-ping does not report a specific error for this, try again if it is an empty message with ipv6 no matter what.
if (!e.message) { if (!e.message) {
return await exports.pingAsync(hostname, true, size); return await exports.pingAsync(destAddr, true, count, sourceAddr, numeric, size, deadline, timeout);
} else { } else {
throw e; throw e;
} }
@ -140,18 +157,35 @@ exports.ping = async (hostname, size = 56) => {
/** /**
* Ping the specified machine * Ping the specified machine
* @param {string} hostname Hostname / address of machine to ping * @param {string} destAddr Hostname / IP address of machine to ping
* @param {boolean} ipv6 Should IPv6 be used? * @param {boolean} ipv6 Should IPv6 be used?
* @param {number} size Size of ping packet to send * @param {number} count Number of packets to send before stopping
* @param {string} sourceAddr Source address for sending/receiving echo requests
* @param {boolean} numeric If true, IP addresses will be output instead of symbolic hostnames
* @param {number} size Size (in bytes) of echo request to send
* @param {number} deadline Maximum time in seconds before ping stops, regardless of packets sent
* @param {number} timeout Maximum time in seconds to wait for each response
* @returns {Promise<number>} Time for ping in ms rounded to nearest integer * @returns {Promise<number>} Time for ping in ms rounded to nearest integer
*/ */
exports.pingAsync = function (hostname, ipv6 = false, size = 56) { exports.pingAsync = function (
destAddr,
ipv6 = false,
count = PING_COUNT_DEFAULT,
sourceAddr = "",
numeric = true,
size = PING_PACKET_SIZE_DEFAULT,
deadline = PING_GLOBAL_TIMEOUT_DEFAULT,
timeout = PING_PER_REQUEST_TIMEOUT_DEFAULT,
) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
ping.promise.probe(hostname, { ping.promise.probe(destAddr, {
v6: ipv6, v6: ipv6,
min_reply: 1, min_reply: count,
deadline: 10, sourceAddr: sourceAddr,
numeric: numeric,
packetSize: size, packetSize: size,
deadline: deadline,
timeout: timeout
}).then((res) => { }).then((res) => {
// If ping failed, it will set field to unknown // If ping failed, it will set field to unknown
if (res.alive) { if (res.alive) {

View file

@ -4,9 +4,11 @@
<script> <script>
import { setPageLocale } from "./util-frontend"; import { setPageLocale } from "./util-frontend";
import { polyfillCountryFlagEmojis } from "country-flag-emoji-polyfill";
export default { export default {
created() { created() {
setPageLocale(); setPageLocale();
}, },
}; };
polyfillCountryFlagEmojis();
</script> </script>

View file

@ -3,7 +3,7 @@
@import "node_modules/bootstrap/scss/bootstrap"; @import "node_modules/bootstrap/scss/bootstrap";
#app { #app {
font-family: BlinkMacSystemFont, segoe ui, Roboto, helvetica neue, Arial, noto sans, sans-serif, apple color emoji, segoe ui emoji, segoe ui symbol, noto color emoji; font-family: "Twemoji Country Flags", BlinkMacSystemFont, segoe ui, Roboto, helvetica neue, Arial, noto sans, sans-serif, apple color emoji, segoe ui emoji, segoe ui symbol, noto color emoji;
} }
h1 { h1 {
@ -619,7 +619,7 @@ $shadow-box-padding: 20px;
bottom: 0; bottom: 0;
margin-left: -$shadow-box-padding; margin-left: -$shadow-box-padding;
margin-right: -$shadow-box-padding; margin-right: -$shadow-box-padding;
z-index: 100; z-index: 10;
background-color: rgba(white, 0.2); background-color: rgba(white, 0.2);
backdrop-filter: blur(2px); backdrop-filter: blur(2px);
border-radius: 0 0 10px 10px; border-radius: 0 0 10px 10px;

View file

@ -42,6 +42,9 @@ export default {
mounted() { mounted() {
this.modal = new Modal(this.$refs.modal); this.modal = new Modal(this.$refs.modal);
}, },
beforeUnmount() {
this.cleanupModal();
},
methods: { methods: {
/** /**
* Show the confirm dialog * Show the confirm dialog
@ -58,6 +61,19 @@ export default {
this.$emit("added", this.groupName); this.$emit("added", this.groupName);
this.modal.hide(); this.modal.hide();
}, },
/**
* Clean up modal and restore scroll behavior
* @returns {void}
*/
cleanupModal() {
if (this.modal) {
try {
this.modal.hide();
} catch (e) {
console.warn("Modal hide failed:", e);
}
}
}
}, },
}; };
</script> </script>

View file

@ -73,12 +73,6 @@ export default {
} }
}, },
created() {
if (this.model.length === 0) {
this.addCondition();
}
},
methods: { methods: {
getNewGroup() { getNewGroup() {
return { return {

View file

@ -14,7 +14,7 @@
<router-link :to="monitorURL(monitor.id)" class="item" :class="{ 'disabled': ! monitor.active }"> <router-link :to="monitorURL(monitor.id)" class="item" :class="{ 'disabled': ! monitor.active }">
<div class="row"> <div class="row">
<div class="col-9 col-md-8 small-padding" :class="{ 'monitor-item': $root.userHeartbeatBar == 'bottom' || $root.userHeartbeatBar == 'none' }"> <div class="col-6 small-padding" :class="{ 'monitor-item': $root.userHeartbeatBar == 'bottom' || $root.userHeartbeatBar == 'none' }">
<div class="info"> <div class="info">
<Uptime :monitor="monitor" type="24" :pill="true" /> <Uptime :monitor="monitor" type="24" :pill="true" />
<span v-if="hasChildren" class="collapse-padding" @click.prevent="changeCollapsed"> <span v-if="hasChildren" class="collapse-padding" @click.prevent="changeCollapsed">
@ -22,11 +22,11 @@
</span> </span>
{{ monitor.name }} {{ monitor.name }}
</div> </div>
<div v-if="monitor.tags.length > 0" class="tags"> <div v-if="monitor.tags.length > 0" class="tags gap-1">
<Tag v-for="tag in monitor.tags" :key="tag" :item="tag" :size="'sm'" /> <Tag v-for="tag in monitor.tags" :key="tag" :item="tag" :size="'sm'" />
</div> </div>
</div> </div>
<div v-show="$root.userHeartbeatBar == 'normal'" :key="$root.userHeartbeatBar" class="col-3 col-md-4"> <div v-show="$root.userHeartbeatBar == 'normal'" :key="$root.userHeartbeatBar" class="col-6">
<HeartbeatBar ref="heartbeatBar" size="small" :monitor-id="monitor.id" /> <HeartbeatBar ref="heartbeatBar" size="small" :monitor-id="monitor.id" />
</div> </div>
</div> </div>

View file

@ -10,7 +10,7 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="my-3 form-check"> <div class="my-3 form-check">
<input id="show-clickable-link" v-model="monitor.isClickAble" class="form-check-input" type="checkbox" @click="toggleLink(monitor.group_index, monitor.monitor_index)" /> <input id="show-clickable-link" v-model="monitor.isClickAble" class="form-check-input" type="checkbox" data-testid="show-clickable-link" @click="toggleLink(monitor.group_index, monitor.monitor_index)" />
<label class="form-check-label" for="show-clickable-link"> <label class="form-check-label" for="show-clickable-link">
{{ $t("Show Clickable Link") }} {{ $t("Show Clickable Link") }}
</label> </label>
@ -19,6 +19,16 @@
</div> </div>
</div> </div>
<!-- Custom URL -->
<template v-if="monitor.isClickAble">
<label for="customUrl" class="form-label">{{ $t("Custom URL") }}</label>
<input id="customUrl" :value="monitor.url" type="url" class="form-control" data-testid="custom-url-input" @input="e => changeUrl(monitor.group_index, monitor.monitor_index, e.target!.value)">
<div class="form-text mb-3">
{{ $t("customUrlDescription") }}
</div>
</template>
<button <button
class="btn btn-primary btn-add-group me-2" class="btn btn-primary btn-add-group me-2"
@click="$refs.badgeGeneratorDialog.show(monitor.id, monitor.name)" @click="$refs.badgeGeneratorDialog.show(monitor.id, monitor.name)"
@ -29,7 +39,7 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="submit" class="btn btn-danger" data-bs-dismiss="modal"> <button type="submit" class="btn btn-danger" data-bs-dismiss="modal" data-testid="monitor-settings-close">
{{ $t("Close") }} {{ $t("Close") }}
</button> </button>
</div> </div>
@ -78,6 +88,7 @@ export default {
monitor_index: monitor.index, monitor_index: monitor.index,
group_index: group.index, group_index: group.index,
isClickAble: this.showLink(monitor), isClickAble: this.showLink(monitor),
url: monitor.element.url,
}; };
this.MonitorSettingDialog.show(); this.MonitorSettingDialog.show();
@ -110,6 +121,17 @@ export default {
} }
return monitor.element.sendUrl && monitor.element.url && monitor.element.url !== "https://" && !this.editMode; return monitor.element.sendUrl && monitor.element.url && monitor.element.url !== "https://" && !this.editMode;
}, },
/**
* Toggle the value of sendUrl
* @param {number} groupIndex Index of group monitor is member of
* @param {number} index Index of monitor within group
* @param {string} value The new value of the url
* @returns {void}
*/
changeUrl(groupIndex, index, value) {
this.$root.publicGroupList[groupIndex].monitorList[index].url = value;
},
}, },
}; };
</script> </script>

View file

@ -135,11 +135,13 @@ export default {
"nostr": "Nostr", "nostr": "Nostr",
"ntfy": "Ntfy", "ntfy": "Ntfy",
"octopush": "Octopush", "octopush": "Octopush",
"OneChat": "OneChat",
"OneBot": "OneBot", "OneBot": "OneBot",
"Onesender": "Onesender", "Onesender": "Onesender",
"Opsgenie": "Opsgenie", "Opsgenie": "Opsgenie",
"PagerDuty": "PagerDuty", "PagerDuty": "PagerDuty",
"PagerTree": "PagerTree", "PagerTree": "PagerTree",
"pumble": "Pumble",
"pushbullet": "Pushbullet", "pushbullet": "Pushbullet",
"PushByTechulus": "Push by Techulus", "PushByTechulus": "Push by Techulus",
"pushover": "Pushover", "pushover": "Pushover",
@ -163,9 +165,11 @@ export default {
"ZohoCliq": "ZohoCliq", "ZohoCliq": "ZohoCliq",
"SevenIO": "SevenIO", "SevenIO": "SevenIO",
"whapi": "WhatsApp (Whapi)", "whapi": "WhatsApp (Whapi)",
"waha": "WhatsApp (WAHA)",
"gtxmessaging": "GtxMessaging", "gtxmessaging": "GtxMessaging",
"Cellsynt": "Cellsynt", "Cellsynt": "Cellsynt",
"SendGrid": "SendGrid" "SendGrid": "SendGrid",
"notifery": "Notifery"
}; };
// Put notifications here if it's not supported in most regions or its documentation is not in English // Put notifications here if it's not supported in most regions or its documentation is not in English
@ -181,8 +185,12 @@ export default {
"SMSManager": "SmsManager (smsmanager.cz)", "SMSManager": "SmsManager (smsmanager.cz)",
"WeCom": "WeCom (企业微信群机器人)", "WeCom": "WeCom (企业微信群机器人)",
"ServerChan": "ServerChan (Server酱)", "ServerChan": "ServerChan (Server酱)",
"PushPlus": "PushPlus (推送加)",
"SpugPush": "SpugPushSpug推送助手",
"smsc": "SMSC", "smsc": "SMSC",
"WPush": "WPush(wpush.cn)", "WPush": "WPush(wpush.cn)",
"YZJ": "YZJ (云之家自定义机器人)",
"SMSPlanet": "SMSPlanet.pl"
}; };
// Sort by notification name // Sort by notification name
@ -232,6 +240,9 @@ export default {
mounted() { mounted() {
this.modal = new Modal(this.$refs.modal); this.modal = new Modal(this.$refs.modal);
}, },
beforeUnmount() {
this.cleanupModal();
},
methods: { methods: {
/** /**
@ -336,6 +347,20 @@ export default {
}); });
} while (this.$root.notificationList.find(it => it.name === name)); } while (this.$root.notificationList.find(it => it.name === name));
return name; return name;
},
/**
* Clean up modal and restore scroll behavior
* @returns {void}
*/
cleanupModal() {
if (this.modal) {
try {
this.modal.hide();
} catch (e) {
console.warn("Modal hide failed:", e);
}
}
} }
}, },
}; };

View file

@ -125,11 +125,12 @@ export default {
} }
}; };
}, },
mounted() { mounted() {
this.modal = new Modal(this.$refs.modal); this.modal = new Modal(this.$refs.modal);
}, },
beforeUnmount() {
this.cleanupModal();
},
methods: { methods: {
/** /**
* Show dialog to confirm deletion * Show dialog to confirm deletion
@ -209,6 +210,20 @@ export default {
} }
}); });
}, },
/**
* Clean up modal and restore scroll behavior
* @returns {void}
*/
cleanupModal() {
if (this.modal) {
try {
this.modal.hide();
} catch (e) {
console.warn("Modal hide failed:", e);
}
}
}
}, },
}; };
</script> </script>

View file

@ -33,7 +33,7 @@
<template #item="monitor"> <template #item="monitor">
<div class="item" data-testid="monitor"> <div class="item" data-testid="monitor">
<div class="row"> <div class="row">
<div class="col-9 col-md-8 small-padding"> <div class="col-6 small-padding">
<div class="info"> <div class="info">
<font-awesome-icon v-if="editMode" icon="arrows-alt-v" class="action drag me-3" /> <font-awesome-icon v-if="editMode" icon="arrows-alt-v" class="action drag me-3" />
<font-awesome-icon v-if="editMode" icon="times" class="action remove me-3" @click="removeMonitor(group.index, monitor.index)" /> <font-awesome-icon v-if="editMode" icon="times" class="action remove me-3" @click="removeMonitor(group.index, monitor.index)" />
@ -58,6 +58,7 @@
v-if="editMode" v-if="editMode"
:class="{'link-active': true, 'btn-link': true}" :class="{'link-active': true, 'btn-link': true}"
icon="cog" class="action me-3" icon="cog" class="action me-3"
data-testid="monitor-settings"
@click="$refs.monitorSettingDialog.show(group, monitor)" @click="$refs.monitorSettingDialog.show(group, monitor)"
/> />
</span> </span>
@ -71,7 +72,7 @@
</div> </div>
</div> </div>
</div> </div>
<div :key="$root.userHeartbeatBar" class="col-3 col-md-4"> <div :key="$root.userHeartbeatBar" class="col-6">
<HeartbeatBar size="mid" :monitor-id="monitor.element.id" /> <HeartbeatBar size="mid" :monitor-id="monitor.element.id" />
</div> </div>
</div> </div>

View file

@ -6,7 +6,6 @@
'm-2': size == 'normal', 'm-2': size == 'normal',
'px-2': size == 'sm', 'px-2': size == 'sm',
'py-0': size == 'sm', 'py-0': size == 'sm',
'mx-1': size == 'sm',
}" }"
:style="{ backgroundColor: item.color, fontSize: size == 'sm' ? '0.7em' : '1em' }" :style="{ backgroundColor: item.color, fontSize: size == 'sm' ? '0.7em' : '1em' }"
> >
@ -48,7 +47,7 @@ export default {
}, },
computed: { computed: {
displayText() { displayText() {
if (this.item.value === "" || this.item.value === undefined) { if (this.item.value === "" || this.item.value === undefined || this.item.value === null) {
return this.item.name; return this.item.name;
} else { } else {
return `${this.item.name}: ${this.item.value}`; return `${this.item.name}: ${this.item.value}`;

View file

@ -197,7 +197,7 @@ export default {
return tagOptions; return tagOptions;
}, },
selectedTags() { selectedTags() {
return this.preSelectedTags.concat(this.newTags).filter(tag => !this.deleteTags.find(monitorTag => monitorTag.id === tag.id)); return this.preSelectedTags.concat(this.newTags).filter(tag => !this.deleteTags.find(monitorTag => monitorTag.tag_id === tag.tag_id));
}, },
colorOptions() { colorOptions() {
return colorOptions(this); return colorOptions(this);
@ -248,6 +248,9 @@ export default {
this.modal = new Modal(this.$refs.modal); this.modal = new Modal(this.$refs.modal);
this.getExistingTags(); this.getExistingTags();
}, },
beforeUnmount() {
this.cleanupModal();
},
methods: { methods: {
/** /**
* Show the add tag dialog * Show the add tag dialog
@ -459,6 +462,19 @@ export default {
this.newTags = []; this.newTags = [];
this.deleteTags = []; this.deleteTags = [];
this.processing = false; this.processing = false;
},
/**
* Clean up modal and restore scroll behavior
* @returns {void}
*/
cleanupModal() {
if (this.modal) {
try {
this.modal.hide();
} catch (e) {
console.warn("Modal hide failed:", e);
}
}
} }
}, },
}; };

View file

@ -0,0 +1,75 @@
<template>
<div class="form-text mb-2">
<i18n-t tag="div" keypath="liquidIntroduction">
<a href="https://liquidjs.com/" target="_blank">{{ $t("documentation") }}</a>
</i18n-t>
<code v-pre>{{ msg }}</code>: {{ $t("templateMsg") }}<br />
<code v-pre>{{ name }}</code>: {{ $t("templateServiceName") }}<br />
<code v-pre>{{ status }}</code>: {{ $t("templateStatus") }}<br />
<code v-pre>{{ hostnameOrURL }}</code>: {{ $t("templateHostnameOrURL") }}<br />
<code v-pre>{{ heartbeatJSON }}</code>: {{ $t("templateHeartbeatJSON") }} <b>({{ $t("templateLimitedToUpDownNotifications") }})</b><br />
<code v-pre>{{ monitorJSON }}</code>: {{ $t("templateMonitorJSON") }} <b>({{ $t("templateLimitedToUpDownCertNotifications") }})</b><br />
</div>
<input
:id="id"
ref="templatedInput"
v-model="model"
type="text"
class="form-control"
:placeholder="placeholder"
:required="required"
autocomplete="false"
>
</template>
<script>
export default {
props: {
/**
* The value of the templated input.
*/
modelValue: {
type: String,
default: ""
},
/**
* id for the templated input.
*/
id: {
type: String,
required: true,
},
/**
* Whether the templated input is required.
* @example true
*/
required: {
type: Boolean,
required: true,
},
/**
* Placeholder text for the templated input.
*/
placeholder: {
type: String,
default: ""
},
},
emits: [ "update:modelValue" ],
computed: {
/**
* Send value update to parent on change.
*/
model: {
get() {
return this.modelValue;
},
set(value) {
this.$emit("update:modelValue", value);
}
}
},
};
</script>

View file

@ -0,0 +1,80 @@
<template>
<div class="form-text mb-2">
<i18n-t tag="div" keypath="liquidIntroduction">
<a href="https://liquidjs.com/" target="_blank">{{ $t("documentation") }}</a>
</i18n-t>
<code v-pre>{{ msg }}</code>: {{ $t("templateMsg") }}<br />
<code v-pre>{{ name }}</code>: {{ $t("templateServiceName") }}<br />
<code v-pre>{{ status }}</code>: {{ $t("templateStatus") }}<br />
<code v-pre>{{ hostnameOrURL }}</code>: {{ $t("templateHostnameOrURL") }}<br />
<code v-pre>{{ heartbeatJSON }}</code>: {{ $t("templateHeartbeatJSON") }} <b>({{ $t("templateLimitedToUpDownNotifications") }})</b><br />
<code v-pre>{{ monitorJSON }}</code>: {{ $t("templateMonitorJSON") }} <b>({{ $t("templateLimitedToUpDownCertNotifications") }})</b><br />
</div>
<textarea
:id="id"
ref="templatedTextarea"
v-model="model"
class="form-control"
:placeholder="placeholder"
:required="required"
autocomplete="false"
></textarea>
</template>
<script>
export default {
props: {
/**
* The value of the templated textarea.
*/
modelValue: {
type: String,
default: ""
},
/**
* id for the templated textarea.
*/
id: {
type: String,
required: true,
},
/**
* Whether the templated textarea is required.
* @example true
*/
required: {
type: Boolean,
required: true,
},
/**
* Placeholder text for the templated textarea.
*/
placeholder: {
type: String,
default: ""
},
},
emits: [ "update:modelValue" ],
computed: {
/**
* Send value update to parent on change.
*/
model: {
get() {
return this.modelValue;
},
set(value) {
this.$emit("update:modelValue", value);
}
}
},
};
</script>
<style lang="scss" scoped>
textarea {
min-height: 150px;
}
</style>

View file

@ -53,6 +53,13 @@
</div> </div>
</div> </div>
</div> </div>
<div class="mb-3">
<div class="form-check form-switch">
<input id="discord-disable-url" v-model="$parent.notification.disableUrl" class="form-check-input" type="checkbox" role="switch">
<label class="form-check-label" for="discord-disable-url">{{ $t("Disable URL in Notification") }}</label>
</div>
</div>
</template> </template>
<script> <script>
export default { export default {
@ -60,6 +67,9 @@ export default {
if (!this.$parent.notification.discordChannelType) { if (!this.$parent.notification.discordChannelType) {
this.$parent.notification.discordChannelType = "channel"; this.$parent.notification.discordChannelType = "channel";
} }
if (this.$parent.notification.disableUrl === undefined) {
this.$parent.notification.disableUrl = false;
}
} }
}; };
</script> </script>

View file

@ -1,7 +1,10 @@
<template> <template>
<div class="mb-3"> <div class="mb-3">
<label for="flashduty-integration-url" class="form-label">Integration Key</label> <label for="flashduty-integration-url" class="form-label">{{ $t("FlashDuty Push URL") }} <span style="color: red;"><sup>*</sup></span></label>
<HiddenInput id="flashduty-integration-url" v-model="$parent.notification.flashdutyIntegrationKey" autocomplete="false"></HiddenInput> <HiddenInput id="flashduty-integration-url" v-model="$parent.notification.flashdutyIntegrationKey" autocomplete="false" :placeholder="$t('FlashDuty Push URL Placeholder')" />
<div class="form-text">
<p><span style="color: red;"><sup>*</sup></span>{{ $t("Required") }}</p>
</div>
<i18n-t tag="div" keypath="wayToGetFlashDutyKey" class="form-text"> <i18n-t tag="div" keypath="wayToGetFlashDutyKey" class="form-text">
<a href="https://flashcat.cloud/product/flashduty?from=kuma" target="_blank">{{ $t("here") }}</a> <a href="https://flashcat.cloud/product/flashduty?from=kuma" target="_blank">{{ $t("here") }}</a>
</i18n-t> </i18n-t>
@ -18,7 +21,6 @@
<script> <script>
import HiddenInput from "../HiddenInput.vue"; import HiddenInput from "../HiddenInput.vue";
export default { export default {
components: { components: {
HiddenInput, HiddenInput,

View file

@ -18,7 +18,7 @@
{{ $t("matrixDesc1") }} {{ $t("matrixDesc1") }}
</p> </p>
<i18n-t tag="p" keypath="matrixDesc2" style="margin-top: 8px;"> <i18n-t tag="p" keypath="matrixDesc2" style="margin-top: 8px;">
<code>curl -XPOST -d '{"type": "m.login.password", "identifier": {"user": "botusername", "type": "m.id.user"}, "password": "passwordforuser"}' "https://home.server/_matrix/client/r0/login"</code>. <code>curl -XPOST -d '{"type": "m.login.password", "identifier": {"user": "botusername", "type": "m.id.user"}, "password": "passwordforuser"}' "https://home.server/_matrix/client/v3/login"</code>.
</i18n-t> </i18n-t>
</div> </div>
</template> </template>

View file

@ -0,0 +1,49 @@
<template>
<div class="mb-3">
<label for="notifery-api-key" class="form-label">{{
$t("API Key")
}}</label>
<HiddenInput
id="notifery-api-key"
v-model="$parent.notification.notiferyApiKey"
:required="true"
autocomplete="new-password"
></HiddenInput>
</div>
<div class="mb-3">
<label for="notifery-title" class="form-label">{{ $t("Title") }}</label>
<input
id="notifery-title"
v-model="$parent.notification.notiferyTitle"
type="text"
class="form-control"
placeholder="Uptime Kuma Alert"
/>
</div>
<div class="mb-3">
<label for="notifery-group" class="form-label">{{ $t("Group") }}</label>
<input
id="notifery-group"
v-model="$parent.notification.notiferyGroup"
type="text"
class="form-control"
:placeholder="$t('Optional')"
/>
</div>
<i18n-t tag="p" keypath="More info on:" style="margin-top: 8px;">
<a href="https://docs.notifery.com/api/event/" target="_blank">https://docs.notifery.com/api/event/</a>
</i18n-t>
</template>
<script>
import HiddenInput from "../HiddenInput.vue";
export default {
components: {
HiddenInput,
},
};
</script>

View file

@ -0,0 +1,64 @@
<template>
<div class="mb-3">
<!-- Access Token Input -->
<div class="mb-3">
<label for="onechat-access-token" class="form-label">
OneChat Access Token<span style="color: red;"><sup>*</sup></span>
</label>
<HiddenInput
id="onechat-access-token"
v-model="$parent.notification.accessToken"
:required="true"
>
</HiddenInput>
<div class="form-text">
<p>{{ $t("OneChatAccessToken") }}</p>
</div>
</div>
<!-- Receiver ID Input -->
<div class="mb-3">
<label for="onechat-receiver-id" class="form-label">
{{ $t("OneChatUserIdOrGroupId") }}<span style="color: red;"><sup>*</sup></span>
</label>
<input
id="onechat-receiver-id"
v-model="$parent.notification.recieverId"
type="text"
class="form-control"
required
/>
</div>
<!-- Bot ID Input -->
<div class="mb-3">
<label for="onechat-bot-id" class="form-label">
{{ $t("OneChatBotId") }}<span style="color: red;"><sup>*</sup></span>
</label>
<input
id="onechat-bot-id"
v-model="$parent.notification.botId"
type="text"
class="form-control"
required
/>
</div>
<!-- Document Link -->
<div class="form-text">
<i18n-t tag="p" keypath="Read more:">
<a href="https://chat-develop.one.th/docs" target="_blank">https://chat-develop.one.th/docs</a>
</i18n-t>
</div>
</div>
</template>
<script>
import HiddenInput from "../HiddenInput.vue";
export default {
components: {
HiddenInput,
},
};
</script>

View file

@ -0,0 +1,9 @@
<template>
<div class="mb-3">
<label for="pumble-webhook-url" class="form-label mb-2">{{ $t("Webhook URL") }}</label><span style="color: red;"><sup>*</sup></span>
<input id="pumble-webhook-url" v-model="$parent.notification.webhookURL" type="url" class="form-control" required>
</div>
<div class="mb-3">
<a href="https://pumble.com/help/integrations/add-pumble-apps/incoming-webhooks-for-pumble/" target="_blank">{{ $t("documentationOf", ["Pumble Webbhook"]) }}</a>
</div>
</template>

View file

@ -0,0 +1,19 @@
<template>
<div class="mb-3">
<label for="pushPlus-sendkey" class="form-label">{{ $t("SendKey") }}</label>
<HiddenInput id="pushPlus-sendkey" v-model="$parent.notification.pushPlusSendKey" :required="true" autocomplete="new-password"></HiddenInput>
</div>
<i18n-t tag="div" keypath="More info on:" class="mb-3 form-text">
<a href="https://www.pushplus.plus/" target="_blank">https://www.pushplus.plus/</a>
</i18n-t>
</template>
<script>
import HiddenInput from "../HiddenInput.vue";
export default {
components: {
HiddenInput,
},
};
</script>

View file

@ -16,34 +16,24 @@
<option>1</option> <option>1</option>
<option>2</option> <option>2</option>
</select> </select>
<label for="pushover-sound" class="form-label">{{ $t("Notification Sound") }}</label>
<select id="pushover-sound" v-model="$parent.notification.pushoversounds" class="form-select"> <label for="pushover-sound-down" class="form-label">{{ $t("Notification Sound") }} - Up</label>
<option value="pushover">{{ $t("pushoversounds pushover") }}</option> <select id="pushover-sound-down" v-model="$parent.notification.pushoversounds" class="form-select">
<option value="bike">{{ $t("pushoversounds bike") }}</option> <option v-for="sound in soundOptions" :key="sound" :value="sound">
<option value="bugle">{{ $t("pushoversounds bugle") }}</option> {{ $t(`pushoversounds ${sound}`) }}
<option value="cashregister">{{ $t("pushoversounds cashregister") }}</option> </option>
<option value="classical">{{ $t("pushoversounds classical") }}</option>
<option value="cosmic">{{ $t("pushoversounds cosmic") }}</option>
<option value="falling">{{ $t("pushoversounds falling") }}</option>
<option value="gamelan">{{ $t("pushoversounds gamelan") }}</option>
<option value="incoming">{{ $t("pushoversounds incoming") }}</option>
<option value="intermission">{{ $t("pushoversounds intermission") }}</option>
<option value="magic">{{ $t("pushoversounds magic") }}</option>
<option value="mechanical">{{ $t("pushoversounds mechanical") }}</option>
<option value="pianobar">{{ $t("pushoversounds pianobar") }}</option>
<option value="siren">{{ $t("pushoversounds siren") }}</option>
<option value="spacealarm">{{ $t("pushoversounds spacealarm") }}</option>
<option value="tugboat">{{ $t("pushoversounds tugboat") }}</option>
<option value="alien">{{ $t("pushoversounds alien") }}</option>
<option value="climb">{{ $t("pushoversounds climb") }}</option>
<option value="persistent">{{ $t("pushoversounds persistent") }}</option>
<option value="echo">{{ $t("pushoversounds echo") }}</option>
<option value="updown">{{ $t("pushoversounds updown") }}</option>
<option value="vibrate">{{ $t("pushoversounds vibrate") }}</option>
<option value="none">{{ $t("pushoversounds none") }}</option>
</select> </select>
<label for="pushover-sound-up" class="form-label">{{ $t("Notification Sound") }} - Down</label>
<select id="pushover-sound-up" v-model="$parent.notification.pushoversounds_up" class="form-select">
<option v-for="sound in soundOptions" :key="sound" :value="sound">
{{ $t(`pushoversounds ${sound}`) }}
</option>
</select>
<label for="pushover-ttl" class="form-label">{{ $t("pushoverMessageTtl") }}</label> <label for="pushover-ttl" class="form-label">{{ $t("pushoverMessageTtl") }}</label>
<input id="pushover-ttl" v-model="$parent.notification.pushoverttl" type="number" min="0" step="1" class="form-control"> <input id="pushover-ttl" v-model="$parent.notification.pushoverttl" type="number" min="0" step="1" class="form-control">
<div class="form-text"> <div class="form-text">
<span style="color: red;"><sup>*</sup></span>{{ $t("Required") }} <span style="color: red;"><sup>*</sup></span>{{ $t("Required") }}
<i18n-t tag="p" keypath="More info on:" style="margin-top: 8px;"> <i18n-t tag="p" keypath="More info on:" style="margin-top: 8px;">
@ -66,5 +56,34 @@ export default {
components: { components: {
HiddenInput, HiddenInput,
}, },
data() {
return {
soundOptions: [
"pushover",
"bike",
"bugle",
"cashregister",
"classical",
"cosmic",
"falling",
"gamelan",
"incoming",
"intermission",
"magic",
"mechanical",
"pianobar",
"siren",
"spacealarm",
"tugboat",
"alien",
"climb",
"persistent",
"echo",
"updown",
"vibrate",
"none",
],
};
},
}; };
</script> </script>

View file

@ -1,31 +1,123 @@
<template> <template>
<div class="mb-3"> <div class="mb-3">
<label for="smseagle-url" class="form-label">{{ $t("smseagleUrl") }}</label> <label for="smseagle-url" class="form-label">{{ $t("smseagleUrl") }}</label>
<input id="smseagle-url" v-model="$parent.notification.smseagleUrl" type="text" minlength="7" class="form-control" placeholder="http://127.0.0.1" required> <input
id="smseagle-url" v-model="$parent.notification.smseagleUrl" type="text" minlength="7"
class="form-control" placeholder="http://127.0.0.1" required
>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="smseagle-token" class="form-label">{{ $t("smseagleToken") }}</label> <label for="smseagle-token" class="form-label">{{ $t("smseagleToken") }}</label>
<HiddenInput id="smseagle-token" v-model="$parent.notification.smseagleToken" :required="true"></HiddenInput> <HiddenInput id="smseagle-token" v-model="$parent.notification.smseagleToken" :required="true"></HiddenInput>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="smseagle-recipient-type" class="form-label">{{ $t("smseagleRecipientType") }}</label> <label for="smseagle-api-type" class="form-label">{{ $t("smseagleApiType") }} </label>
<select id="smseagle-recipient-type" v-model="$parent.notification.smseagleRecipientType" class="form-select"> <select id="smseagle-api-type" v-model="$parent.notification.smseagleApiType" class="form-select">
<option value="smseagle-to" selected>{{ $t("smseagleTo") }}</option> <option value="smseagle-apiv1" selected>{{ $t("smseagleApiv1") }} </option>
<option value="smseagle-group">{{ $t("smseagleGroup") }}</option> <option value="smseagle-apiv2">{{ $t("smseagleApiv2") }} </option>
<option value="smseagle-contact">{{ $t("smseagleContact") }}</option>
</select> </select>
<i18n-t tag="div" keypath="smseagleDocs" class="form-text">
<a href="https://www.smseagle.eu/api/" target="_blank">https://www.smseagle.eu/api/</a>
</i18n-t>
</div> </div>
<div class="mb-3"> <div v-if="$parent.notification.smseagleApiType === 'smseagle-apiv1'" class="mb-3">
<label for="smseagle-recipient" class="form-label">{{ $t("smseagleRecipient") }}</label> <div class="mb-3">
<input id="smseagle-recipient" v-model="$parent.notification.smseagleRecipient" type="text" class="form-control" required> <label for="smseagle-recipient-type" class="form-label">{{ $t("smseagleRecipientType") }}</label>
<select
id="smseagle-recipient-type" v-model="$parent.notification.smseagleRecipientType"
class="form-select"
>
<!-- phone number -->
<option value="smseagle-to" selected>{{ $t("smseagleTo") }}</option>
<option value="smseagle-group">{{ $t("smseagleGroup") }}</option>
<option value="smseagle-contact">{{ $t("smseagleContact") }}</option>
</select>
</div>
<div class="mb-3">
<label for="smseagle-recipient" class="form-label">{{ $t("smseagleRecipient") }}</label>
<input id="smseagle-recipient" v-model="$parent.notification.smseagleRecipient" type="text" class="form-control" required>
</div>
<div
v-if="$parent.notification.smseagleMsgType === 'smseagle-sms'
|| $parent.notification.smseagleRecipientType !== 'smseagle-to'" class="mb-3"
>
<label for="smseagle-priority" class="form-label">{{ $t("smseaglePriority") }}</label>
<input id="smseagle-priority" v-model="$parent.notification.smseaglePriority" type="number" class="form-control" min="0" max="9" step="1" placeholder="0" required>
</div>
<div
v-if="$parent.notification.smseagleMsgType === 'smseagle-sms'
|| $parent.notification.smseagleRecipientType !== 'smseagle-to'" class="mb-3 form-check form-switch"
>
<label for="smseagle-encoding" class="form-label">{{ $t("smseagleEncoding") }}</label>
<input id="smseagle-encoding" v-model="$parent.notification.smseagleEncoding" type="checkbox" class="form-check-input">
</div>
<div v-if="$parent.notification.smseagleRecipientType === 'smseagle-to'" class="mb-3">
<div class="mb-3">
<label for="smseagle-msg-type" class="form-label">{{ $t("smseagleMsgType") }} </label>
<select id="smseagle-msg-type" v-model="$parent.notification.smseagleMsgType" class="form-select">
<option value="smseagle-sms" selected>{{ $t("smseagleMsgSms") }} </option>
<option value="smseagle-ring">{{ $t("smseagleMsgRing") }} </option>
<option value="smseagle-tts">{{ $t("smseagleMsgTts") }} </option>
<option value="smseagle-tts-advanced">{{ $t("smseagleMsgTtsAdvanced") }} </option>
</select>
</div>
<div
v-if="$parent.notification.smseagleMsgType === 'smseagle-ring'
|| $parent.notification.smseagleMsgType === 'smseagle-tts'
|| $parent.notification.smseagleMsgType === 'smseagle-tts-advanced'" class="mb-3"
>
<label for="smseagle-duration" class="form-label">{{ $t("smseagleDuration") }}</label>
<input id="smseagle-duration" v-model="$parent.notification.smseagleDuration" type="number" class="form-control" min="0" max="30" step="1" placeholder="10">
</div>
<div v-if="$parent.notification.smseagleMsgType === 'smseagle-tts-advanced'" class="mb-3">
<label for="smseagle-tts-model" class="form-label">{{ $t("smseagleTtsModel") }} </label>
<input id="smseagle-tts-model" v-model="$parent.notification.smseagleTtsModel" type="number" class="form-control" placeholder="1" required>
</div>
</div>
</div> </div>
<div class="mb-3">
<label for="smseagle-priority" class="form-label">{{ $t("smseaglePriority") }}</label> <div v-if="$parent.notification.smseagleApiType === 'smseagle-apiv2'" class="mb-3">
<input id="smseagle-priority" v-model="$parent.notification.smseaglePriority" type="number" class="form-control" min="0" max="9" step="1" placeholder="0"> <div class="mb-3">
</div> <!-- phone number -->
<div class="mb-3 form-check form-switch"> <label for="smseagle-recipient-to" class="form-label">{{ $t("smseagleTo") }}</label>
<label for="smseagle-encoding" class="form-label">{{ $t("smseagleEncoding") }}</label> <input id="smseagle-recipient-to" v-model="$parent.notification.smseagleRecipientTo" type="text" class="form-control">
<input id="smseagle-encoding" v-model="$parent.notification.smseagleEncoding" type="checkbox" class="form-check-input"> <i18n-t tag="div" keypath="smseagleComma" class="form-text" />
</div>
<div class="mb-3">
<label for="smseagle-recipient-group" class="form-label">{{ $t("smseagleGroupV2") }}</label>
<input id="smseagle-recipient-group" v-model="$parent.notification.smseagleRecipientGroup" type="text" class="form-control">
<i18n-t tag="div" keypath="smseagleComma" class="form-text" />
</div>
<div class="mb-3">
<label for="smseagle-recipient-contact" class="form-label">{{ $t("smseagleContactV2") }}</label>
<input id="smseagle-recipient-contact" v-model="$parent.notification.smseagleRecipientContact" type="text" class="form-control">
<i18n-t tag="div" keypath="smseagleComma" class="form-text" />
</div>
<div class="mb-3">
<label for="smseagle-priority-v2" class="form-label">{{ $t("smseaglePriority") }}</label>
<input id="smseagle-priority-v2" v-model="$parent.notification.smseaglePriority" type="number" class="form-control" min="0" max="9" step="1" placeholder="0">
</div>
<div class="mb-3 form-check form-switch">
<label for="smseagle-encoding-v2" class="form-label">{{ $t("smseagleEncoding") }}</label>
<input id="smseagle-encoding-v2" v-model="$parent.notification.smseagleEncoding" type="checkbox" class="form-check-input">
</div>
<div class="mb-3">
<label for="smseagle-msg-type-v2" class="form-label">{{ $t("smseagleMsgType") }} </label>
<select id="smseagle-msg-type-v2" v-model="$parent.notification.smseagleMsgType" class="form-select">
<option value="smseagle-sms" selected>{{ $t("smseagleMsgSms") }} </option>
<option value="smseagle-ring">{{ $t("smseagleMsgRing") }} </option>
<option value="smseagle-tts">{{ $t("smseagleMsgTts") }} </option>
<option value="smseagle-tts-advanced">{{ $t("smseagleMsgTtsAdvanced") }} </option>
</select>
</div>
<div v-if="$parent.notification.smseagleMsgType && $parent.notification.smseagleMsgType !== 'smseagle-sms'" class="mb-3">
<label for="smseagle-duration-v2" class="form-label">{{ $t("smseagleDuration") }}</label>
<input id="smseagle-duration-v2" v-model="$parent.notification.smseagleDuration" type="number" class="form-control" min="0" max="30" step="1" placeholder="10">
</div>
<div v-if="$parent.notification.smseagleMsgType === 'smseagle-tts-advanced'" class="mb-3">
<label for="smseagle-tts-model-v2" class="form-label">{{ $t("smseagleTtsModel") }} </label>
<input id="smseagle-tts-model-v2" v-model="$parent.notification.smseagleTtsModel" type="number" class="form-control" placeholder="1" required>
</div>
</div> </div>
</template> </template>
@ -36,5 +128,16 @@ export default {
components: { components: {
HiddenInput, HiddenInput,
}, },
mounted() {
if (!this.$parent.notification.smseagleApiType) {
this.$parent.notification.smseagleApiType = "smseagle-apiv1";
}
if (!this.$parent.notification.smseagleMsgType) {
this.$parent.notification.smseagleMsgType = "smseagle-sms";
}
if (!this.$parent.notification.smseagleRecipientType) {
this.$parent.notification.smseagleRecipientType = "smseagle-to";
}
}
}; };
</script> </script>

View file

@ -0,0 +1,46 @@
<template>
<div class="mb-3">
<label for="smsplanet-api-token" class="form-label">{{ $t('smsplanetApiToken') }}</label>
<HiddenInput id="smsplanet-api-token" v-model="$parent.notification.smsplanetApiToken" :required="true"></HiddenInput>
<i18n-t tag="div" keypath="smsplanetApiDocs" class="form-text">
<template #the_smsplanet_documentation>
<a
href="https://smsplanet.pl/doc/slate/index.html#introduction"
target="_blank"
>{{ $t("the smsplanet documentation") }}</a>
</template>
</i18n-t>
</div>
<div class="mb-3">
<label for="smsplanet-phone-numbers" class="form-label">{{ $t("Phone numbers") }}</label>
<textarea
id="smsplanet-phone-numbers"
v-model="$parent.notification.smsplanetPhoneNumbers"
class="form-control"
:placeholder="smsplanetPhoneNumbers"
required
></textarea>
</div>
<div class="mb-3">
<label for="smsplanet-sender-name" class="form-label">{{ $t("Sender name") }}</label>
<input id="smsplanet-sender-name" v-model="$parent.notification.smsplanetSenderName" type="text" minlength="3" maxlength="11" class="form-control">
<div class="form-text">{{ $t("smsplanetNeedToApproveName") }}</div>
</div>
</template>
<script>
import HiddenInput from "../HiddenInput.vue";
export default {
components: {
HiddenInput,
},
computed: {
smsplanetPhoneNumbers() {
return this.$t("Example:", [
"+48123456789,+48111222333",
]);
}
}
};
</script>

View file

@ -67,28 +67,27 @@
<input id="to-bcc" v-model="$parent.notification.smtpBCC" type="text" class="form-control" autocomplete="false" :required="!hasRecipient"> <input id="to-bcc" v-model="$parent.notification.smtpBCC" type="text" class="form-control" autocomplete="false" :required="!hasRecipient">
</div> </div>
<p class="form-text">
<i18n-t tag="div" keypath="smtpLiquidIntroduction" class="form-text mb-3">
<a href="https://liquidjs.com/" target="_blank">{{ $t("documentation") }}</a>
</i18n-t>
<code v-pre>{{name}}</code>: {{ $t("emailTemplateServiceName") }}<br />
<code v-pre>{{msg}}</code>: {{ $t("emailTemplateMsg") }}<br />
<code v-pre>{{status}}</code>: {{ $t("emailTemplateStatus") }}<br />
<code v-pre>{{heartbeatJSON}}</code>: {{ $t("emailTemplateHeartbeatJSON") }}<b>{{ $t("emailTemplateLimitedToUpDownNotification") }}</b><br />
<code v-pre>{{monitorJSON}}</code>: {{ $t("emailTemplateMonitorJSON") }} <b>{{ $t("emailTemplateLimitedToUpDownNotification") }}</b><br />
<code v-pre>{{hostnameOrURL}}</code>: {{ $t("emailTemplateHostnameOrURL") }}<br />
</p>
<div class="mb-3"> <div class="mb-3">
<label for="subject-email" class="form-label">{{ $t("emailCustomSubject") }}</label> <label for="subject-email" class="form-label">{{ $t("emailCustomSubject") }}</label>
<input id="subject-email" v-model="$parent.notification.customSubject" type="text" class="form-control" autocomplete="false" placeholder=""> <TemplatedInput id="subject-email" v-model="$parent.notification.customSubject" :required="false" placeholder=""></TemplatedInput>
<div class="form-text">{{ $t("leave blank for default subject") }}</div> <div class="form-text">{{ $t("leave blank for default subject") }}</div>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="body-email" class="form-label">{{ $t("emailCustomBody") }}</label> <label for="body-email" class="form-label">{{ $t("emailCustomBody") }}</label>
<textarea id="body-email" v-model="$parent.notification.customBody" type="text" class="form-control" autocomplete="false" placeholder=""></textarea> <TemplatedTextarea id="body-email" v-model="$parent.notification.customBody" :required="false" placeholder=""></TemplatedTextarea>
<div class="form-text">{{ $t("leave blank for default body") }}</div> <div class="form-text">{{ $t("leave blank for default body") }}</div>
</div> </div>
<div class="mb-3">
<div class="form-check">
<input id="use-html-body" v-model="$parent.notification.htmlBody" class="form-check-input" type="checkbox" value="">
<label class="form-check-label" for="use-html-body">
{{ $t("Use HTML for custom E-mail body") }}
</label>
</div>
</div>
<ToggleSection :heading="$t('smtpDkimSettings')"> <ToggleSection :heading="$t('smtpDkimSettings')">
<i18n-t tag="div" keypath="smtpDkimDesc" class="form-text mb-3"> <i18n-t tag="div" keypath="smtpDkimDesc" class="form-text mb-3">
<a href="https://nodemailer.com/dkim/" target="_blank">{{ $t("documentation") }}</a> <a href="https://nodemailer.com/dkim/" target="_blank">{{ $t("documentation") }}</a>
@ -124,11 +123,15 @@
<script> <script>
import HiddenInput from "../HiddenInput.vue"; import HiddenInput from "../HiddenInput.vue";
import TemplatedInput from "../TemplatedInput.vue";
import TemplatedTextarea from "../TemplatedTextarea.vue";
import ToggleSection from "../ToggleSection.vue"; import ToggleSection from "../ToggleSection.vue";
export default { export default {
components: { components: {
HiddenInput, HiddenInput,
TemplatedInput,
TemplatedTextarea,
ToggleSection, ToggleSection,
}, },
computed: { computed: {

View file

@ -0,0 +1,19 @@
<template>
<div class="mb-3">
<label for="spugpush-templateKey" class="form-label">{{ $t("SpugPush Template Code") }}</label>
<HiddenInput id="spugpush-templateKey" v-model="$parent.notification.templateKey" :required="true" autocomplete="new-password"></HiddenInput>
</div>
<i18n-t tag="p" keypath="More info on:" style="margin-top: 8px;">
<a href="https://push.spug.cc/guide/plugin/kuma" rel="noopener noreferrer" target="_blank">https://push.spug.cc</a>
</i18n-t>
</template>
<script>
import HiddenInput from "../HiddenInput.vue";
export default {
components: {
HiddenInput,
},
};
</script>

View file

@ -33,6 +33,56 @@
<input id="message_thread_id" v-model="$parent.notification.telegramMessageThreadID" type="text" class="form-control"> <input id="message_thread_id" v-model="$parent.notification.telegramMessageThreadID" type="text" class="form-control">
<p class="form-text">{{ $t("telegramMessageThreadIDDescription") }}</p> <p class="form-text">{{ $t("telegramMessageThreadIDDescription") }}</p>
<label for="server_url" class="form-label">{{ $t("telegramServerUrl") }}</label>
<input id="server_url" v-model="$parent.notification.telegramServerUrl" type="text" class="form-control">
<div class="form-text">
<i18n-t keypath="telegramServerUrlDescription">
<a
href="https://core.telegram.org/bots/api#using-a-local-bot-api-server"
target="_blank"
>{{ $t("here") }}</a>
<a
href="https://api.telegram.org"
target="_blank"
>https://api.telegram.org</a>
</i18n-t>
</div>
</div>
<div class="mb-3">
<div class="form-check form-switch">
<input v-model="$parent.notification.telegramUseTemplate" class="form-check-input" type="checkbox">
<label class="form-check-label">{{ $t("telegramUseTemplate") }}</label>
</div>
<div class="form-text">
{{ $t("telegramUseTemplateDescription") }}
</div>
</div>
<template v-if="$parent.notification.telegramUseTemplate">
<div class="mb-3">
<label class="form-label" for="message_parse_mode">{{ $t("Message Format") }}</label>
<select
id="message_parse_mode"
v-model="$parent.notification.telegramTemplateParseMode"
class="form-select"
required
>
<option value="plain">{{ $t("Plain Text") }}</option>
<option value="HTML">HTML</option>
<option value="MarkdownV2">MarkdownV2</option>
</select>
<i18n-t tag="p" keypath="telegramTemplateFormatDescription" class="form-text">
<a href="https://core.telegram.org/bots/api#formatting-options" target="_blank">{{ $t("documentation") }}</a>
</i18n-t>
<label class="form-label" for="message_template">{{ $t('Message Template') }}</label>
<TemplatedTextarea id="message_template" v-model="$parent.notification.telegramTemplate" :required="true" :placeholder="telegramTemplatedTextareaPlaceholder"></TemplatedTextarea>
</div>
</template>
<div class="mb-3">
<div class="form-check form-switch"> <div class="form-check form-switch">
<input v-model="$parent.notification.telegramSendSilently" class="form-check-input" type="checkbox"> <input v-model="$parent.notification.telegramSendSilently" class="form-check-input" type="checkbox">
<label class="form-check-label">{{ $t("telegramSendSilently") }}</label> <label class="form-check-label">{{ $t("telegramSendSilently") }}</label>
@ -57,11 +107,27 @@
<script> <script>
import HiddenInput from "../HiddenInput.vue"; import HiddenInput from "../HiddenInput.vue";
import TemplatedTextarea from "../TemplatedTextarea.vue";
import axios from "axios"; import axios from "axios";
export default { export default {
components: { components: {
HiddenInput, HiddenInput,
TemplatedTextarea,
},
computed: {
telegramTemplatedTextareaPlaceholder() {
return this.$t("Example:", [
`
Uptime Kuma Alert{% if monitorJSON %} - {{ monitorJSON['name'] }}{% endif %}
{{ msg }}
`,
]);
}
},
mounted() {
this.$parent.notification.telegramServerUrl ||= "https://api.telegram.org";
}, },
methods: { methods: {
/** /**
@ -80,7 +146,7 @@ export default {
} }
} }
return `https://api.telegram.org/bot${token}/getUpdates`; return `${this.$parent.notification.telegramServerUrl}/bot${token}/getUpdates`;
}, },
/** /**
@ -115,3 +181,9 @@ export default {
} }
}; };
</script> </script>
<style lang="scss" scoped>
textarea {
min-height: 150px;
}
</style>

View file

@ -0,0 +1,38 @@
<template>
<div class="mb-3">
<label for="waha-api-url" class="form-label">{{ $t("API URL") }}</label>
<input id="waha-api-url" v-model="$parent.notification.wahaApiUrl" placeholder="http://localhost:3000/" type="url" class="form-control" required>
<div class="form-text">{{ $t("wayToGetWahaApiUrl") }}</div>
</div>
<div class="mb-3">
<label for="waha-api-key" class="form-label">{{ $t("API Key") }}</label>
<HiddenInput id="waha-api-key" v-model="$parent.notification.wahaApiKey" :required="false" autocomplete="new-password"></HiddenInput>
<div class="form-text">{{ $t("wayToGetWahaApiKey") }}</div>
</div>
<div class="mb-3">
<label for="waha-session" class="form-label">{{ $t("wahaSession") }}</label>
<input id="waha-session" v-model="$parent.notification.wahaSession" type="text" placeholder="default" class="form-control" required>
<div class="form-text">{{ $t("wayToGetWahaSession") }}</div>
</div>
<div class="mb-3">
<label for="waha-chat-id" class="form-label">{{ $t("wahaChatId") }}</label>
<input id="waha-chat-id" v-model="$parent.notification.wahaChatId" type="text" pattern="^[\d-]{10,31}$" class="form-control" required>
<div class="form-text">{{ $t("wayToWriteWahaChatId", ["00117612345678", "00117612345678@c.us", "123456789012345678@g.us"]) }}</div>
</div>
<i18n-t tag="div" keypath="More info on:" class="mb-3 form-text">
<a href="https://waha.devlike.pro/" target="_blank">https://waha.devlike.pro/</a>
</i18n-t>
</template>
<script>
import HiddenInput from "../HiddenInput.vue";
export default {
components: {
HiddenInput,
}
};
</script>

View file

@ -32,20 +32,7 @@
</template> </template>
</i18n-t> </i18n-t>
<template v-else-if="$parent.notification.webhookContentType == 'custom'"> <template v-else-if="$parent.notification.webhookContentType == 'custom'">
<i18n-t tag="div" keypath="liquidIntroduction" class="form-text"> <TemplatedTextarea id="customBody" v-model="$parent.notification.webhookCustomBody" :required="true" :placeholder="customBodyPlaceholder"></TemplatedTextarea>
<a href="https://liquidjs.com/" target="_blank">{{ $t("documentation") }}</a>
</i18n-t>
<code v-pre>{{msg}}</code>: {{ $t("templateMsg") }}<br />
<code v-pre>{{heartbeatJSON}}</code>: {{ $t("templateHeartbeatJSON") }} <b>({{ $t("templateLimitedToUpDownNotifications") }})</b><br />
<code v-pre>{{monitorJSON}}</code>: {{ $t("templateMonitorJSON") }} <b>({{ $t("templateLimitedToUpDownCertNotifications") }})</b><br />
<textarea
id="customBody"
v-model="$parent.notification.webhookCustomBody"
class="form-control"
:placeholder="customBodyPlaceholder"
required
></textarea>
</template> </template>
</div> </div>
@ -67,7 +54,12 @@
</template> </template>
<script> <script>
import TemplatedTextarea from "../TemplatedTextarea.vue";
export default { export default {
components: {
TemplatedTextarea,
},
data() { data() {
return { return {
showAdditionalHeadersField: this.$parent.notification.webhookAdditionalHeaders != null, showAdditionalHeadersField: this.$parent.notification.webhookAdditionalHeaders != null,

View file

@ -0,0 +1,19 @@
<template>
<div class="mb-3">
<label for="yzjWebHookUrl" class="form-label">{{ $t("YZJ Webhook URL") }}<span style="color: red;"><sup>*</sup></span></label>
<input id="yzjWebHookUrl" v-model="$parent.notification.yzjWebHookUrl" type="url" class="form-control" required />
<i18n-t class="form-text" keypath="wayToGetTeamsURL">
<a href="https://www.yunzhijia.com/opendocs/docs.html#/tutorial/index/robot" target="_blank">{{ $t("here") }}</a>
</i18n-t>
</div>
<div class="mb-3">
<label for="yzjToken" class="form-label">{{ $t("YZJ Robot Token") }}<span style="color: red;"><sup>*</sup></span></label>
<HiddenInput id="yzjToken" v-model="$parent.notification.yzjToken" :required="true" autocomplete="new-password"></HiddenInput>
<i18n-t class="form-text" keypath="wayToGetLineNotifyToken">
<a href="https://www.yunzhijia.com/opendocs/docs.html#/server-api/im/index?id=%e6%8e%a5%e5%8f%a3%e5%9c%b0%e5%9d%80%e5%92%8c%e6%8e%88%e6%9d%83%e7%a0%81" target="_blank">{{ $t("here") }}</a>
</i18n-t>
</div>
</template>
<script setup lang="ts">
import HiddenInput from "../HiddenInput.vue";
</script>

View file

@ -4,6 +4,7 @@ import AliyunSMS from "./AliyunSms.vue";
import Apprise from "./Apprise.vue"; import Apprise from "./Apprise.vue";
import Bark from "./Bark.vue"; import Bark from "./Bark.vue";
import Bitrix24 from "./Bitrix24.vue"; import Bitrix24 from "./Bitrix24.vue";
import Notifery from "./Notifery.vue";
import ClickSendSMS from "./ClickSendSMS.vue"; import ClickSendSMS from "./ClickSendSMS.vue";
import CallMeBot from "./CallMeBot.vue"; import CallMeBot from "./CallMeBot.vue";
import SMSC from "./SMSC.vue"; import SMSC from "./SMSC.vue";
@ -29,6 +30,7 @@ import Mattermost from "./Mattermost.vue";
import Nostr from "./Nostr.vue"; import Nostr from "./Nostr.vue";
import Ntfy from "./Ntfy.vue"; import Ntfy from "./Ntfy.vue";
import Octopush from "./Octopush.vue"; import Octopush from "./Octopush.vue";
import OneChat from "./OneChat.vue";
import OneBot from "./OneBot.vue"; import OneBot from "./OneBot.vue";
import Onesender from "./Onesender.vue"; import Onesender from "./Onesender.vue";
import Opsgenie from "./Opsgenie.vue"; import Opsgenie from "./Opsgenie.vue";
@ -36,9 +38,11 @@ import PagerDuty from "./PagerDuty.vue";
import FlashDuty from "./FlashDuty.vue"; import FlashDuty from "./FlashDuty.vue";
import PagerTree from "./PagerTree.vue"; import PagerTree from "./PagerTree.vue";
import PromoSMS from "./PromoSMS.vue"; import PromoSMS from "./PromoSMS.vue";
import Pumble from "./Pumble.vue";
import Pushbullet from "./Pushbullet.vue"; import Pushbullet from "./Pushbullet.vue";
import PushDeer from "./PushDeer.vue"; import PushDeer from "./PushDeer.vue";
import Pushover from "./Pushover.vue"; import Pushover from "./Pushover.vue";
import PushPlus from "./PushPlus.vue";
import Pushy from "./Pushy.vue"; import Pushy from "./Pushy.vue";
import RocketChat from "./RocketChat.vue"; import RocketChat from "./RocketChat.vue";
import ServerChan from "./ServerChan.vue"; import ServerChan from "./ServerChan.vue";
@ -61,12 +65,16 @@ import WeCom from "./WeCom.vue";
import GoAlert from "./GoAlert.vue"; import GoAlert from "./GoAlert.vue";
import ZohoCliq from "./ZohoCliq.vue"; import ZohoCliq from "./ZohoCliq.vue";
import Splunk from "./Splunk.vue"; import Splunk from "./Splunk.vue";
import SpugPush from "./SpugPush.vue";
import SevenIO from "./SevenIO.vue"; import SevenIO from "./SevenIO.vue";
import Whapi from "./Whapi.vue"; import Whapi from "./Whapi.vue";
import WAHA from "./WAHA.vue";
import Cellsynt from "./Cellsynt.vue"; import Cellsynt from "./Cellsynt.vue";
import WPush from "./WPush.vue"; import WPush from "./WPush.vue";
import SIGNL4 from "./SIGNL4.vue"; import SIGNL4 from "./SIGNL4.vue";
import SendGrid from "./SendGrid.vue"; import SendGrid from "./SendGrid.vue";
import YZJ from "./YZJ.vue";
import SMSPlanet from "./SMSPlanet.vue";
/** /**
* Manage all notification form. * Manage all notification form.
@ -103,6 +111,7 @@ const NotificationFormList = {
"nostr": Nostr, "nostr": Nostr,
"ntfy": Ntfy, "ntfy": Ntfy,
"octopush": Octopush, "octopush": Octopush,
"OneChat": OneChat,
"OneBot": OneBot, "OneBot": OneBot,
"Onesender": Onesender, "Onesender": Onesender,
"Opsgenie": Opsgenie, "Opsgenie": Opsgenie,
@ -110,10 +119,12 @@ const NotificationFormList = {
"FlashDuty": FlashDuty, "FlashDuty": FlashDuty,
"PagerTree": PagerTree, "PagerTree": PagerTree,
"promosms": PromoSMS, "promosms": PromoSMS,
"pumble": Pumble,
"pushbullet": Pushbullet, "pushbullet": Pushbullet,
"PushByTechulus": TechulusPush, "PushByTechulus": TechulusPush,
"PushDeer": PushDeer, "PushDeer": PushDeer,
"pushover": Pushover, "pushover": Pushover,
"PushPlus": PushPlus,
"pushy": Pushy, "pushy": Pushy,
"rocket.chat": RocketChat, "rocket.chat": RocketChat,
"serwersms": SerwerSMS, "serwersms": SerwerSMS,
@ -131,6 +142,7 @@ const NotificationFormList = {
"threema": Threema, "threema": Threema,
"twilio": Twilio, "twilio": Twilio,
"Splunk": Splunk, "Splunk": Splunk,
"SpugPush": SpugPush,
"webhook": Webhook, "webhook": Webhook,
"WeCom": WeCom, "WeCom": WeCom,
"GoAlert": GoAlert, "GoAlert": GoAlert,
@ -138,10 +150,14 @@ const NotificationFormList = {
"ZohoCliq": ZohoCliq, "ZohoCliq": ZohoCliq,
"SevenIO": SevenIO, "SevenIO": SevenIO,
"whapi": Whapi, "whapi": Whapi,
"notifery": Notifery,
"waha": WAHA,
"gtxmessaging": GtxMessaging, "gtxmessaging": GtxMessaging,
"Cellsynt": Cellsynt, "Cellsynt": Cellsynt,
"WPush": WPush, "WPush": WPush,
"SendGrid": SendGrid, "SendGrid": SendGrid,
"YZJ": YZJ,
"SMSPlanet": SMSPlanet,
}; };
export default NotificationFormList; export default NotificationFormList;

View file

@ -21,6 +21,9 @@
<label><input v-model="settings.checkBeta" type="checkbox" :disabled="!settings.checkUpdate" @change="saveSettings()" /> {{ $t("Also check beta release") }}</label> <label><input v-model="settings.checkBeta" type="checkbox" :disabled="!settings.checkUpdate" @change="saveSettings()" /> {{ $t("Also check beta release") }}</label>
</div> </div>
</div> </div>
<div class="mt-5">
<p>{{ $t("Font Twemoji by Twitter licensed under") }} <a href="https://creativecommons.org/licenses/by/4.0/">CC-BY 4.0</a></p>
</div>
</div> </div>
</div> </div>
</template> </template>

View file

@ -31,6 +31,7 @@ const languageList = {
"sv-SE": "Svenska", "sv-SE": "Svenska",
"tr-TR": "Türkçe", "tr-TR": "Türkçe",
"ko-KR": "한국어", "ko-KR": "한국어",
"lt": "Lietuvių",
"ru-RU": "Русский", "ru-RU": "Русский",
"zh-CN": "简体中文", "zh-CN": "简体中文",
"pl": "Polski", "pl": "Polski",

View file

@ -733,5 +733,12 @@
"Remove the expiry notification": "إزالة تنبيه يوم تاريخ الإنتهاء", "Remove the expiry notification": "إزالة تنبيه يوم تاريخ الإنتهاء",
"tailscalePingWarning": "من أجل استخدام مراقبة Tailscale Ping، تحتاج إلى تثبيت Uptime Kuma بدون Docker وكذلك تثبيت عميل Tailscale على الخادم الخاص بك.", "tailscalePingWarning": "من أجل استخدام مراقبة Tailscale Ping، تحتاج إلى تثبيت Uptime Kuma بدون Docker وكذلك تثبيت عميل Tailscale على الخادم الخاص بك.",
"Clone Monitor": "نسخ المراقبة", "Clone Monitor": "نسخ المراقبة",
"telegramMessageThreadIDDescription": "معرف فريد اختياري لسلسلة الرسائل المستهدفة (الموضوع) في المنتدى؛ لمجموعات المنتدى الكبرى فقط" "telegramMessageThreadIDDescription": "معرف فريد اختياري لسلسلة الرسائل المستهدفة (الموضوع) في المنتدى؛ لمجموعات المنتدى الكبرى فقط",
"emailCustomBody": "نص مخصص",
"emailTemplateStatus": "الحالة",
"leave blank for default subject": "اترك فارغاً ليتم تعيين الموضوع تلقائياً",
"leave blank for default body": "اترك فارغاً ليتم تعيين النص تلقائياً",
"emailTemplateServiceName": "اسم الخدمة",
"emailTemplateHostnameOrURL": "اسم المضيف أو عنوان URL",
"smspartnerPhoneNumber": "رقم الهاتف"
} }

View file

@ -1097,5 +1097,26 @@
"Separate multiple email addresses with commas": "Разделяйте отделните имейл адреси със запетаи", "Separate multiple email addresses with commas": "Разделяйте отделните имейл адреси със запетаи",
"RabbitMQ Nodes": "Възли за управление на RabbitMQ", "RabbitMQ Nodes": "Възли за управление на RabbitMQ",
"rabbitmqNodesDescription": "Въведете URL адреса на възлите за управление на RabbitMQ, включително протокол и порт. Пример: {0}", "rabbitmqNodesDescription": "Въведете URL адреса на възлите за управление на RabbitMQ, включително протокол и порт. Пример: {0}",
"rabbitmqHelpText": "За да използвате монитора, ще трябва да активирате добавката за управление във вашата настройка на RabbitMQ. За повече информация моля, вижте {rabitmq_documentation}." "rabbitmqHelpText": "За да използвате монитора, ще трябва да активирате добавката за управление във вашата настройка на RabbitMQ. За повече информация моля, вижте {rabitmq_documentation}.",
"aboutSlackUsername": "Променя показваното име на подателя на съобщението. Ако желаете да споменете някого, вместо това го включете в приятелското име.",
"YZJ Robot Token": "YZJ Robot токен код",
"YZJ Webhook URL": "YZJ Уеб кука URL адрес",
"templateServiceName": "име на услугата",
"templateHostnameOrURL": "име на хоста или URL адрес",
"Plain Text": "Обикновен текст",
"Message Template": "Шаблон за съобщение",
"templateStatus": "статус",
"telegramUseTemplate": "Използвай персонализиран шаблон за съобщение",
"telegramUseTemplateDescription": "Ако е активирано, съобщението ще бъде изпратено чрез персонализиран шаблон.",
"telegramTemplateFormatDescription": "Telegram позволява използването на различни \"markup\" езици за съобщенията. Вижте Telegram {0} за детайли.",
"Template Format": "Формат на шаблона",
"wayToGetWahaApiUrl": "Вашият WAHA URL адрес.",
"wahaSession": "Сесия",
"wahaChatId": "Чат ID (телефонен номер / ID на контакт / ID на група)",
"wayToGetWahaApiKey": "API ключът, е стойността на променливата WHATSAPP_API_KEY, която сте използвали за стартиране на WAHA.",
"wayToWriteWahaChatId": "Телефонният номер с международния префикс, но без знака плюс в началото ({0}), ID на контакта ({1}) или ID на групата ({2}). Известията се изпращат до това чат ID от WAHA сесия.",
"wayToGetWahaSession": "От тази сесия WAHA изпраща известия до чат ID. Можете да го намерите в таблото за управление на WAHA.",
"telegramServerUrlDescription": "За премахване на API бот ограниченията за Telegram или за получаване на достъп в блокирани зони (Китай, Иран и др.). За повече информация щракнете върху {0}. По подразбиране: {1}",
"telegramServerUrl": "(По избор) URL адрес на сървъра",
"Font Twemoji by Twitter licensed under": "Шрифт Twemoji от Twitter, лицензиран под"
} }

Some files were not shown because too many files have changed in this diff Show more