Compare commits

...

6 commits

Author SHA1 Message Date
Louis Lam
2c8b6fb2bd
Merge d81bf8aaf9 into 8a432ac937 2024-11-12 18:00:27 +00:00
Ionys
8a432ac937
fix(status page): Make sure the group deletion is correctly handled when groupIDList is empty (#5340)
Some checks failed
Auto Test / check-linters (push) Has been cancelled
Auto Test / armv7-simple-test (18, ARMv7) (push) Has been cancelled
Auto Test / armv7-simple-test (20, ARMv7) (push) Has been cancelled
Auto Test / e2e-test (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
Merge Conflict Labeler / Labeling (push) Has been cancelled
validate / json-yaml-validate (push) Has been cancelled
validate / validate (push) Has been cancelled
Auto Test / auto-test (18, ARM64) (push) Has been cancelled
Auto Test / auto-test (18, macos-latest) (push) Has been cancelled
Auto Test / auto-test (18, ubuntu-latest) (push) Has been cancelled
Auto Test / auto-test (18, windows-latest) (push) Has been cancelled
Auto Test / auto-test (20, ARM64) (push) Has been cancelled
Auto Test / auto-test (20, macos-latest) (push) Has been cancelled
Auto Test / auto-test (20, ubuntu-latest) (push) Has been cancelled
Auto Test / auto-test (20, windows-latest) (push) Has been cancelled
2024-11-12 19:00:09 +01:00
Louis Lam
d81bf8aaf9
Remove the npm requirement, as all newer versions came with npm versions >= 9 2024-11-09 23:46:16 +08:00
Louis Lam
b376aa3299 WIP 2024-10-30 01:16:47 +08:00
Louis Lam
f09830a75e WIP 2024-10-30 01:13:43 +08:00
Louis Lam
3cd537808f WIP 2024-10-30 01:07:47 +08:00
3 changed files with 27 additions and 13 deletions

View file

@ -37,10 +37,13 @@ It is a temporary live demo, all data will be deleted after 10 minutes. Sponsore
## 🔧 How to Install ## 🔧 How to Install
### 🐳 Docker ### 🐳 Docker Compose
```bash ```bash
docker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:1 mkdir uptime-kuma
cd uptime-kuma
curl -o compose.yaml https://raw.githubusercontent.com/louislam/uptime-kuma/master/compose.yaml
docker compose up -d
``` ```
Uptime Kuma is now running on <http://0.0.0.0:3001>. Uptime Kuma is now running on <http://0.0.0.0:3001>.
@ -48,6 +51,14 @@ Uptime Kuma is now running on <http://0.0.0.0:3001>.
> [!WARNING] > [!WARNING]
> File Systems like **NFS** (Network File System) are **NOT** supported. Please map to a local directory or volume. > File Systems like **NFS** (Network File System) are **NOT** supported. Please map to a local directory or volume.
### 🐳 Docker Command
```bash
docker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:2
```
Uptime Kuma is now running on <http://0.0.0.0:3001>.
> [!NOTE] > [!NOTE]
> If you want to limit exposure to localhost (without exposing port for other users or to use a [reverse proxy](https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy)), you can expose the port like this: > If you want to limit exposure to localhost (without exposing port for other users or to use a [reverse proxy](https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy)), you can expose the port like this:
> >
@ -63,8 +74,7 @@ Requirements:
- ✅ 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
- ❌ Replit / Heroku - ❌ Replit / Heroku
- [Node.js](https://nodejs.org/en/download/) 18 / 20.4 - [Node.js](https://nodejs.org/en/download/) >= 18 or >= 20.4
- [npm](https://docs.npmjs.com/cli/) 9
- [Git](https://git-scm.com/downloads) - [Git](https://git-scm.com/downloads)
- [pm2](https://pm2.keymetrics.io/) - For running Uptime Kuma in the background - [pm2](https://pm2.keymetrics.io/) - For running Uptime Kuma in the background

View file

@ -1,9 +1,9 @@
services: services:
uptime-kuma: uptime-kuma:
image: louislam/uptime-kuma:1 image: louislam/uptime-kuma:2
restart: unless-stopped
volumes: volumes:
- ./data:/app/data - ./data:/app/data
ports: ports:
# <Host Port>:<Container Port> # <Host Port>:<Container Port>
- 3001:3001 - "3001:3001"
restart: unless-stopped

View file

@ -220,6 +220,9 @@ module.exports.statusPageSocketHandler = (socket) => {
// Delete groups that are not in the list // Delete groups that are not in the list
log.debug("socket", "Delete groups that are not in the list"); log.debug("socket", "Delete groups that are not in the list");
if (groupIDList.length === 0) {
await R.exec("DELETE FROM `group` WHERE status_page_id = ?", [ statusPage.id ]);
} else {
const slots = groupIDList.map(() => "?").join(","); const slots = groupIDList.map(() => "?").join(",");
const data = [ const data = [
@ -227,6 +230,7 @@ module.exports.statusPageSocketHandler = (socket) => {
statusPage.id statusPage.id
]; ];
await R.exec(`DELETE FROM \`group\` WHERE id NOT IN (${slots}) AND status_page_id = ?`, data); await R.exec(`DELETE FROM \`group\` WHERE id NOT IN (${slots}) AND status_page_id = ?`, data);
}
const server = UptimeKumaServer.getInstance(); const server = UptimeKumaServer.getInstance();