From 9379498b49c8bd892d69ac1e177160d754592478 Mon Sep 17 00:00:00 2001 From: Nelson Chan <3271800+chakflying@users.noreply.github.com> Date: Fri, 27 Oct 2023 18:46:13 +0800 Subject: [PATCH 1/9] Chore: Allow MS Edge for real-browser monitor (#3941) --- server/monitor-types/real-browser-monitor-type.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/monitor-types/real-browser-monitor-type.js b/server/monitor-types/real-browser-monitor-type.js index 94ceb02ee..12ff66e4a 100644 --- a/server/monitor-types/real-browser-monitor-type.js +++ b/server/monitor-types/real-browser-monitor-type.js @@ -24,6 +24,9 @@ if (process.platform === "win32") { allowedList.push(process.env.PROGRAMFILES + "\\Chromium\\Application\\chrome.exe"); allowedList.push(process.env["ProgramFiles(x86)"] + "\\Chromium\\Application\\chrome.exe"); + // Allow MS Edge + allowedList.push(process.env["ProgramFiles(x86)"] + "\\Microsoft\\Edge\\Application\\msedge.exe"); + // For Loop A to Z for (let i = 65; i <= 90; i++) { let drive = String.fromCharCode(i); From ddd135efa8953124f2f805887c0a2738c23e606e Mon Sep 17 00:00:00 2001 From: Chongyi Zheng Date: Fri, 27 Oct 2023 20:15:49 -0400 Subject: [PATCH 2/9] Confirm chrome path in macOS is correct (#3950) --- server/monitor-types/real-browser-monitor-type.js | 1 - 1 file changed, 1 deletion(-) diff --git a/server/monitor-types/real-browser-monitor-type.js b/server/monitor-types/real-browser-monitor-type.js index 12ff66e4a..4003c68eb 100644 --- a/server/monitor-types/real-browser-monitor-type.js +++ b/server/monitor-types/real-browser-monitor-type.js @@ -45,7 +45,6 @@ if (process.platform === "win32") { "/usr/bin/google-chrome", ]; } else if (process.platform === "darwin") { - // TODO: Generated by GitHub Copilot, but not sure if it's correct allowedList = [ "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", "/Applications/Chromium.app/Contents/MacOS/Chromium", From b32d869823787003b576ead24036bc7fdfc80ef9 Mon Sep 17 00:00:00 2001 From: check bot <113978832+check-bot@users.noreply.github.com> Date: Sat, 28 Oct 2023 05:46:53 +0530 Subject: [PATCH 3/9] Fix: sentence framing (#3945) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b4ae8581..8afa9e695 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ If you love this project, please consider giving me a ⭐. ## 🗣️ Discussion / Ask for Help -⚠️ For any general or technical questions, please don't send me an email, as I am unable to provide support in that manner. I will not respond if you asked such questions. +⚠️ For any general or technical questions, please don't send me an email, as I am unable to provide support in that manner. I will not respond if you ask such questions. I recommend using Google, GitHub Issues, or Uptime Kuma's Subreddit for finding answers to your question. If you cannot find the information you need, feel free to ask: From 201c10416e0aeaa2f28c1f6e5168077fc5ecacd1 Mon Sep 17 00:00:00 2001 From: Nelson Chan <3271800+chakflying@users.noreply.github.com> Date: Sat, 28 Oct 2023 10:34:15 +0800 Subject: [PATCH 4/9] Fix: Entry page setting in Dev mode (#3940) --- src/pages/Entry.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/Entry.vue b/src/pages/Entry.vue index b87c4d998..2a539fb81 100644 --- a/src/pages/Entry.vue +++ b/src/pages/Entry.vue @@ -33,10 +33,10 @@ export default { } else if (res.type === "entryPage") { // Dev only. For production, the logic is in the server side const entryPage = res.entryPage; - - if (entryPage === "statusPage") { - this.$router.push("/status"); + if (entryPage.startsWith("statusPage-")) { + this.$router.push("/status/" + entryPage.replace("statusPage-", "")); } else { + // should the old setting style still exist here? this.$router.push("/dashboard"); } } else if (res.type === "setup-database") { From d7b9bcf4b4b2869e30754159709c516c5695d69b Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Sun, 29 Oct 2023 15:28:47 +0800 Subject: [PATCH 5/9] Drop install.sh and related files (#3955) --- extra/install.batsh | 276 ------------------ install.sh | 228 --------------- package.json | 8 - test/test_install_script/alpine3.dockerfile | 4 - .../alpine3.dockerfile.dockerignore | 0 test/test_install_script/centos7.dockerfile | 4 - .../centos7.dockerfile.dockerignore | 0 .../debian-buster.dockerfile | 10 - .../debian-buster.dockerfile.dockerignore | 0 test/test_install_script/debian.dockerfile | 10 - .../debian.dockerfile.dockerignore | 0 .../test_install_script/rockylinux.dockerfile | 4 - .../rockylinux.dockerfile.dockerignore | 0 test/test_install_script/ubuntu.dockerfile | 10 - .../ubuntu.dockerfile.dockerignore | 0 .../test_install_script/ubuntu1604.dockerfile | 9 - .../ubuntu1604.dockerfile.dockerignore | 0 .../test_install_script/ubuntu1804.dockerfile | 4 - .../ubuntu1804.dockerfile.dockerignore | 0 19 files changed, 567 deletions(-) delete mode 100644 extra/install.batsh delete mode 100644 install.sh delete mode 100644 test/test_install_script/alpine3.dockerfile delete mode 100644 test/test_install_script/alpine3.dockerfile.dockerignore delete mode 100644 test/test_install_script/centos7.dockerfile delete mode 100644 test/test_install_script/centos7.dockerfile.dockerignore delete mode 100644 test/test_install_script/debian-buster.dockerfile delete mode 100644 test/test_install_script/debian-buster.dockerfile.dockerignore delete mode 100644 test/test_install_script/debian.dockerfile delete mode 100644 test/test_install_script/debian.dockerfile.dockerignore delete mode 100644 test/test_install_script/rockylinux.dockerfile delete mode 100644 test/test_install_script/rockylinux.dockerfile.dockerignore delete mode 100644 test/test_install_script/ubuntu.dockerfile delete mode 100644 test/test_install_script/ubuntu.dockerfile.dockerignore delete mode 100644 test/test_install_script/ubuntu1604.dockerfile delete mode 100644 test/test_install_script/ubuntu1604.dockerfile.dockerignore delete mode 100644 test/test_install_script/ubuntu1804.dockerfile delete mode 100644 test/test_install_script/ubuntu1804.dockerfile.dockerignore diff --git a/extra/install.batsh b/extra/install.batsh deleted file mode 100644 index e2f9a7511..000000000 --- a/extra/install.batsh +++ /dev/null @@ -1,276 +0,0 @@ -// install.sh is generated by ./extra/install.batsh, do not modify it directly. -// "npm run compile-install-script" to compile install.sh -// The command is working on Windows PowerShell and Docker for Windows only. - - -// curl -o kuma_install.sh https://raw.githubusercontent.com/louislam/uptime-kuma/master/install.sh && sudo bash kuma_install.sh -println("====================="); -println("Uptime Kuma Install Script"); -println("====================="); -println("Supported OS: Ubuntu >= 16.04, Debian and CentOS/RHEL 7/8"); -println("---------------------------------------"); -println("This script is designed for Linux and basic usage."); -println("For advanced usage, please go to https://github.com/louislam/uptime-kuma/wiki/Installation"); -println("---------------------------------------"); -println(""); -println("Local - Install Uptime Kuma on your current machine with git, Node.js and pm2"); -println("Docker - Install Uptime Kuma Docker container"); -println(""); - -if ("$1" != "") { - type = "$1"; -} else { - call("read", "-p", "Which installation method do you prefer? [DOCKER/local]: ", "type"); -} - -defaultPort = "3001"; - -function checkNode() { - bash("nodeVersion=$(node -e 'console.log(process.versions.node.split(`.`)[0])')"); - println("Node Version: " ++ nodeVersion); - - if (nodeVersion <= "12") { - println("Error: Required Node.js 14"); - call("exit", "1"); - } -} - -function deb() { - bash("nodeCheck=$(node -v)"); - bash("apt --yes update"); - - if (nodeCheck != "") { - checkNode(); - } else { - - // Old nodejs binary name is "nodejs" - bash("check=$(nodejs --version)"); - if (check != "") { - println("Error: 'node' command is not found, but 'nodejs' command is found. Your NodeJS should be too old."); - bash("exit 1"); - } - - bash("curlCheck=$(curl --version)"); - if (curlCheck == "") { - println("Installing Curl"); - bash("apt --yes install curl"); - } - - println("Installing Node.js 16"); - bash("curl -sL https://deb.nodesource.com/setup_16.x | bash - > log.txt"); - bash("apt --yes install nodejs"); - bash("node -v"); - - bash("nodeCheckAgain=$(node -v)"); - - if (nodeCheckAgain == "") { - println("Error during Node.js installation"); - bash("exit 1"); - } - } - - bash("check=$(git --version)"); - if (check == "") { - println("Installing Git"); - bash("apt --yes install git"); - } -} - -if (type == "local") { - defaultInstallPath = "/opt/uptime-kuma"; - - if (exists("/etc/redhat-release")) { - os = call("cat", "/etc/redhat-release"); - distribution = "rhel"; - - } else if (exists("/etc/issue")) { - bash("os=$(head -n1 /etc/issue | cut -f 1 -d ' ')"); - if (os == "Ubuntu") { - distribution = "ubuntu"; - - // Get ubuntu version - bash(". /etc/lsb-release"); - version = DISTRIB_RELEASE; - } - if (os == "Debian") { - distribution = "debian"; - } - } - - bash("arch=$(uname -i)"); - - println("Your OS: " ++ os); - println("Distribution: " ++ distribution); - println("Version: " ++ version); - println("Arch: " ++ arch); - - if ("$3" != "") { - port = "$3"; - } else { - call("read", "-p", "Listening Port [$defaultPort]: ", "port"); - - if (port == "") { - port = defaultPort; - } - } - - if ("$2" != "") { - installPath = "$2"; - } else { - call("read", "-p", "Installation Path [$defaultInstallPath]: ", "installPath"); - - if (installPath == "") { - installPath = defaultInstallPath; - } - } - - // CentOS - if (distribution == "rhel") { - bash("nodeCheck=$(node -v)"); - - if (nodeCheck != "") { - checkNode(); - } else { - - bash("dnfCheck=$(dnf --version)"); - - // Use yum - if (dnfCheck == "") { - bash("curlCheck=$(curl --version)"); - if (curlCheck == "") { - println("Installing Curl"); - bash("yum -y -q install curl"); - } - - println("Installing Node.js 16"); - bash("curl -sL https://rpm.nodesource.com/setup_16.x | bash - > log.txt"); - bash("yum install -y -q nodejs"); - } else { - bash("curlCheck=$(curl --version)"); - if (curlCheck == "") { - println("Installing Curl"); - bash("dnf -y install curl"); - } - - println("Installing Node.js 16"); - bash("curl -sL https://rpm.nodesource.com/setup_16.x | bash - > log.txt"); - bash("dnf install -y nodejs"); - } - - - bash("node -v"); - - bash("nodeCheckAgain=$(node -v)"); - - if (nodeCheckAgain == "") { - println("Error during Node.js installation"); - bash("exit 1"); - } - } - - bash("check=$(git --version)"); - if (check == "") { - println("Installing Git"); - bash("yum -y -q install git"); - } - - // Ubuntu - } else if (distribution == "ubuntu") { - deb(); - - // Debian - } else if (distribution == "debian") { - deb(); - - } else { - // Unknown distribution - error = 0; - - bash("check=$(git --version)"); - if (check == "") { - error = 1; - println("Error: git is not found!"); - println("help: an installation guide is available at https://git-scm.com/book/en/v2/Getting-Started-Installing-Git"); - } - - bash("check=$(node -v)"); - if (check == "") { - error = 1; - println("Error: node is not found"); - println("help: an installation guide is available at https://nodejs.org/en/download"); - } - - if (error > 0) { - println("Please install above missing software"); - bash("exit 1"); - } - } - - bash("check=$(pm2 --version)"); - if (check == "") { - println("Installing PM2"); - bash("npm install pm2 -g && pm2 install pm2-logrotate"); - bash("pm2 startup"); - } - - - // Check again - bash("check=$(pm2 --version)"); - if (check == "") { - println("Error: pm2 is not found!"); - println("help: an installation guide is available at https://pm2.keymetrics.io/docs/usage/quick-start/"); - bash("exit 1"); - } - - bash("mkdir -p $installPath"); - bash("cd $installPath"); - bash("git clone https://github.com/louislam/uptime-kuma.git ."); - bash("npm run setup"); - - bash("pm2 start server/server.js --name uptime-kuma -- --port=$port"); - -} else { - defaultVolume = "uptime-kuma"; - - bash("check=$(docker -v)"); - if (check == "") { - println("Error: docker is not found!"); - println("help: an installation guide is available at https://docs.docker.com/desktop/"); - bash("exit 1"); - } - - bash("check=$(docker info)"); - - bash("if [[ \"$check\" == *\"Is the docker daemon running\"* ]]; then - \"echo\" \"Error: docker is not running\" - \"echo\" \"help: a troubleshooting guide is available at https://docs.docker.com/config/daemon/troubleshoot/\" - \"exit\" \"1\" - fi"); - - if ("$3" != "") { - port = "$3"; - } else { - call("read", "-p", "Expose Port [$defaultPort]: ", "port"); - - if (port == "") { - port = defaultPort; - } - } - - if ("$2" != "") { - volume = "$2"; - } else { - call("read", "-p", "Volume Name [$defaultVolume]: ", "volume"); - - if (volume == "") { - volume = defaultVolume; - } - } - - println("Port: $port"); - println("Volume: $volume"); - bash("docker volume create $volume"); - bash("docker run -d --restart=always -p $port:3001 -v $volume:/app/data --name uptime-kuma louislam/uptime-kuma:1"); -} - -println("http://localhost:$port"); diff --git a/install.sh b/install.sh deleted file mode 100644 index d965867cb..000000000 --- a/install.sh +++ /dev/null @@ -1,228 +0,0 @@ -# install.sh is generated by ./extra/install.batsh, do not modify it directly. -# "npm run compile-install-script" to compile install.sh -# The command is working on Windows PowerShell and Docker for Windows only. -# curl -o kuma_install.sh https://raw.githubusercontent.com/louislam/uptime-kuma/master/install.sh && sudo bash kuma_install.sh -"echo" "-e" "=====================" -"echo" "-e" "Uptime Kuma Install Script" -"echo" "-e" "=====================" -"echo" "-e" "Supported OS: Ubuntu >= 16.04, Debian and CentOS/RHEL 7/8" -"echo" "-e" "---------------------------------------" -"echo" "-e" "This script is designed for Linux and basic usage." -"echo" "-e" "For advanced usage, please go to https://github.com/louislam/uptime-kuma/wiki/Installation" -"echo" "-e" "---------------------------------------" -"echo" "-e" "" -"echo" "-e" "Local - Install Uptime Kuma on your current machine with git, Node.js and pm2" -"echo" "-e" "Docker - Install Uptime Kuma Docker container" -"echo" "-e" "" -if [ "$1" != "" ]; then - type="$1" -else - "read" "-p" "Which installation method do you prefer? [DOCKER/local]: " "type" -fi -defaultPort="3001" -function checkNode { - local _0 - nodeVersion=$(node -e 'console.log(process.versions.node.split(`.`)[0])') - "echo" "-e" "Node Version: ""$nodeVersion" - _0="12" - if [ $(($nodeVersion <= $_0)) == 1 ]; then - "echo" "-e" "Error: Required Node.js 14" - "exit" "1" -fi -} -function deb { - nodeCheck=$(node -v) - apt --yes update - if [ "$nodeCheck" != "" ]; then - "checkNode" - else - # Old nodejs binary name is "nodejs" - check=$(nodejs --version) - if [ "$check" != "" ]; then - "echo" "-e" "Error: 'node' command is not found, but 'nodejs' command is found. Your NodeJS should be too old." - exit 1 -fi - curlCheck=$(curl --version) - if [ "$curlCheck" == "" ]; then - "echo" "-e" "Installing Curl" - apt --yes install curl -fi - "echo" "-e" "Installing Node.js 16" - curl -sL https://deb.nodesource.com/setup_16.x | bash - > log.txt - apt --yes install nodejs - node -v - nodeCheckAgain=$(node -v) - if [ "$nodeCheckAgain" == "" ]; then - "echo" "-e" "Error during Node.js installation" - exit 1 -fi - fi - check=$(git --version) - if [ "$check" == "" ]; then - "echo" "-e" "Installing Git" - apt --yes install git -fi -} -if [ "$type" == "local" ]; then - defaultInstallPath="/opt/uptime-kuma" - if [ -e "/etc/redhat-release" ]; then - os=$("cat" "/etc/redhat-release") - distribution="rhel" - else - if [ -e "/etc/issue" ]; then - os=$(head -n1 /etc/issue | cut -f 1 -d ' ') - if [ "$os" == "Ubuntu" ]; then - distribution="ubuntu" - # Get ubuntu version - . /etc/lsb-release - version="$DISTRIB_RELEASE" -fi - if [ "$os" == "Debian" ]; then - distribution="debian" -fi -fi - fi - arch=$(uname -i) - "echo" "-e" "Your OS: ""$os" - "echo" "-e" "Distribution: ""$distribution" - "echo" "-e" "Version: ""$version" - "echo" "-e" "Arch: ""$arch" - if [ "$3" != "" ]; then - port="$3" - else - "read" "-p" "Listening Port [$defaultPort]: " "port" - if [ "$port" == "" ]; then - port="$defaultPort" -fi - fi - if [ "$2" != "" ]; then - installPath="$2" - else - "read" "-p" "Installation Path [$defaultInstallPath]: " "installPath" - if [ "$installPath" == "" ]; then - installPath="$defaultInstallPath" -fi - fi - # CentOS - if [ "$distribution" == "rhel" ]; then - nodeCheck=$(node -v) - if [ "$nodeCheck" != "" ]; then - "checkNode" - else - dnfCheck=$(dnf --version) - # Use yum - if [ "$dnfCheck" == "" ]; then - curlCheck=$(curl --version) - if [ "$curlCheck" == "" ]; then - "echo" "-e" "Installing Curl" - yum -y -q install curl -fi - "echo" "-e" "Installing Node.js 16" - curl -sL https://rpm.nodesource.com/setup_16.x | bash - > log.txt - yum install -y -q nodejs - else - curlCheck=$(curl --version) - if [ "$curlCheck" == "" ]; then - "echo" "-e" "Installing Curl" - dnf -y install curl -fi - "echo" "-e" "Installing Node.js 16" - curl -sL https://rpm.nodesource.com/setup_16.x | bash - > log.txt - dnf install -y nodejs - fi - node -v - nodeCheckAgain=$(node -v) - if [ "$nodeCheckAgain" == "" ]; then - "echo" "-e" "Error during Node.js installation" - exit 1 -fi - fi - check=$(git --version) - if [ "$check" == "" ]; then - "echo" "-e" "Installing Git" - yum -y -q install git -fi - # Ubuntu - else - if [ "$distribution" == "ubuntu" ]; then - "deb" - # Debian - else - if [ "$distribution" == "debian" ]; then - "deb" - else - # Unknown distribution - error=$((0)) - check=$(git --version) - if [ "$check" == "" ]; then - error=$((1)) - "echo" "-e" "Error: git is not found!" - "echo" "-e" "help: an installation guide is available at https://git-scm.com/book/en/v2/Getting-Started-Installing-Git" -fi - check=$(node -v) - if [ "$check" == "" ]; then - error=$((1)) - "echo" "-e" "Error: node is not found" - "echo" "-e" "help: an installation guide is available at https://nodejs.org/en/download" -fi - if [ $(($error > 0)) == 1 ]; then - "echo" "-e" "Please install above missing software" - exit 1 -fi - fi - fi - fi - check=$(pm2 --version) - if [ "$check" == "" ]; then - "echo" "-e" "Installing PM2" - npm install pm2 -g && pm2 install pm2-logrotate - pm2 startup -fi - # Check again - check=$(pm2 --version) - if [ "$check" == "" ]; then - "echo" "-e" "Error: pm2 is not found!" - "echo" "-e" "help: an installation guide is available at https://pm2.keymetrics.io/docs/usage/quick-start/" - exit 1 -fi - mkdir -p $installPath - cd $installPath - git clone https://github.com/louislam/uptime-kuma.git . - npm run setup - pm2 start server/server.js --name uptime-kuma -- --port=$port -else - defaultVolume="uptime-kuma" - check=$(docker -v) - if [ "$check" == "" ]; then - "echo" "-e" "Error: docker is not found!" - "echo" "-e" "help: an installation guide is available at https://docs.docker.com/desktop/" - exit 1 -fi - check=$(docker info) - if [[ "$check" == *"Is the docker daemon running"* ]]; then - "echo" "Error: docker is not running" - "echo" "help: a troubleshooting guide is available at https://docs.docker.com/config/daemon/troubleshoot/" - "exit" "1" - fi - if [ "$3" != "" ]; then - port="$3" - else - "read" "-p" "Expose Port [$defaultPort]: " "port" - if [ "$port" == "" ]; then - port="$defaultPort" -fi - fi - if [ "$2" != "" ]; then - volume="$2" - else - "read" "-p" "Volume Name [$defaultVolume]: " "volume" - if [ "$volume" == "" ]; then - volume="$defaultVolume" -fi - fi - "echo" "-e" "Port: $port" - "echo" "-e" "Volume: $volume" - docker volume create $volume - docker run -d --restart=always -p $port:3001 -v $volume:/app/data --name uptime-kuma louislam/uptime-kuma:1 -fi -"echo" "-e" "http://localhost:$port" diff --git a/package.json b/package.json index c0fe6e26b..f11712658 100644 --- a/package.json +++ b/package.json @@ -46,14 +46,6 @@ "mark-as-nightly": "node extra/mark-as-nightly.js", "reset-password": "node extra/reset-password.js", "remove-2fa": "node extra/remove-2fa.js", - "compile-install-script": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command ./extra/compile-install-script.ps1", - "test-install-script-rockylinux": "npm run compile-install-script && docker build --progress plain -f test/test_install_script/rockylinux.dockerfile .", - "test-install-script-centos7": "npm run compile-install-script && docker build --progress plain -f test/test_install_script/centos7.dockerfile .", - "test-install-script-debian": "npm run compile-install-script && docker build --progress plain -f test/test_install_script/debian.dockerfile .", - "test-install-script-debian-buster": "npm run compile-install-script && docker build --progress plain -f test/test_install_script/debian-buster.dockerfile .", - "test-install-script-ubuntu": "npm run compile-install-script && docker build --progress plain -f test/test_install_script/ubuntu.dockerfile .", - "test-install-script-ubuntu1804": "npm run compile-install-script && docker build --progress plain -f test/test_install_script/ubuntu1804.dockerfile .", - "test-install-script-ubuntu1604": "npm run compile-install-script && docker build --progress plain -f test/test_install_script/ubuntu1604.dockerfile .", "simple-dns-server": "node extra/simple-dns-server.js", "simple-mqtt-server": "node extra/simple-mqtt-server.js", "simple-mongo": "docker run --rm -p 27017:27017 mongo", diff --git a/test/test_install_script/alpine3.dockerfile b/test/test_install_script/alpine3.dockerfile deleted file mode 100644 index c42782779..000000000 --- a/test/test_install_script/alpine3.dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM alpine:3 -RUN apk add --update nodejs npm git -COPY ./install.sh . -RUN /bin/sh install.sh local /opt/uptime-kuma 3000 0.0.0.0 diff --git a/test/test_install_script/alpine3.dockerfile.dockerignore b/test/test_install_script/alpine3.dockerfile.dockerignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/test_install_script/centos7.dockerfile b/test/test_install_script/centos7.dockerfile deleted file mode 100644 index 6e50b9192..000000000 --- a/test/test_install_script/centos7.dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM centos:7 - -COPY ./install.sh . -RUN bash install.sh local /opt/uptime-kuma 3000 0.0.0.0 diff --git a/test/test_install_script/centos7.dockerfile.dockerignore b/test/test_install_script/centos7.dockerfile.dockerignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/test_install_script/debian-buster.dockerfile b/test/test_install_script/debian-buster.dockerfile deleted file mode 100644 index cd5e8abb4..000000000 --- a/test/test_install_script/debian-buster.dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM debian:buster-slim - -# Test invalid node version, these commands install nodejs 10 -# RUN apt-get update -# RUN apt --yes install nodejs -# RUN ln -s /usr/bin/nodejs /usr/bin/node -# RUN node -v - -COPY ./install.sh . -RUN bash install.sh local /opt/uptime-kuma 3000 0.0.0.0 diff --git a/test/test_install_script/debian-buster.dockerfile.dockerignore b/test/test_install_script/debian-buster.dockerfile.dockerignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/test_install_script/debian.dockerfile b/test/test_install_script/debian.dockerfile deleted file mode 100644 index 6e1d172ec..000000000 --- a/test/test_install_script/debian.dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM debian:bookworm-slim - -# Test invalid node version, these commands install nodejs 10 -# RUN apt-get update -# RUN apt --yes install nodejs -# RUN ln -s /usr/bin/nodejs /usr/bin/node -# RUN node -v - -COPY ./install.sh . -RUN bash install.sh local /opt/uptime-kuma 3000 0.0.0.0 diff --git a/test/test_install_script/debian.dockerfile.dockerignore b/test/test_install_script/debian.dockerfile.dockerignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/test_install_script/rockylinux.dockerfile b/test/test_install_script/rockylinux.dockerfile deleted file mode 100644 index 884ec473a..000000000 --- a/test/test_install_script/rockylinux.dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM rockylinux:9 - -COPY ./install.sh . -RUN bash install.sh local /opt/uptime-kuma 3000 0.0.0.0 diff --git a/test/test_install_script/rockylinux.dockerfile.dockerignore b/test/test_install_script/rockylinux.dockerfile.dockerignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/test_install_script/ubuntu.dockerfile b/test/test_install_script/ubuntu.dockerfile deleted file mode 100644 index 07d8a25a4..000000000 --- a/test/test_install_script/ubuntu.dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM ubuntu - -# Test invalid node version, these commands install nodejs 10 -# RUN apt-get update -# RUN apt --yes install nodejs -# RUN ln -s /usr/bin/nodejs /usr/bin/node -# RUN node -v - -COPY ./install.sh . -RUN bash install.sh local /opt/uptime-kuma 3000 0.0.0.0 diff --git a/test/test_install_script/ubuntu.dockerfile.dockerignore b/test/test_install_script/ubuntu.dockerfile.dockerignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/test_install_script/ubuntu1604.dockerfile b/test/test_install_script/ubuntu1604.dockerfile deleted file mode 100644 index c6b529abe..000000000 --- a/test/test_install_script/ubuntu1604.dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM ubuntu:16.04 - -# Test invalid node version, these commands install nodejs 10 -#RUN apt --yes install nodejs -# RUN ln -s /usr/bin/nodejs /usr/bin/node -# RUN node -v - -COPY ./install.sh . -RUN bash install.sh local /opt/uptime-kuma 3000 0.0.0.0 diff --git a/test/test_install_script/ubuntu1604.dockerfile.dockerignore b/test/test_install_script/ubuntu1604.dockerfile.dockerignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/test_install_script/ubuntu1804.dockerfile b/test/test_install_script/ubuntu1804.dockerfile deleted file mode 100644 index d41f67ede..000000000 --- a/test/test_install_script/ubuntu1804.dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM ubuntu:18.04 - -COPY ./install.sh . -RUN bash install.sh local /opt/uptime-kuma 3000 0.0.0.0 diff --git a/test/test_install_script/ubuntu1804.dockerfile.dockerignore b/test/test_install_script/ubuntu1804.dockerfile.dockerignore deleted file mode 100644 index e69de29bb..000000000 From df832f15fe21c5afc2d3e1d040bced79790962f2 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Mon, 30 Oct 2023 09:23:47 +0800 Subject: [PATCH 6/9] Add Uzbek language (#3959) * Add uz * Update i18n.js --- src/i18n.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/i18n.js b/src/i18n.js index c33b523e2..8402096ab 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -42,7 +42,8 @@ const languageList = { "yue": "繁體中文 (廣東話 / 粵語)", "ro": "Limba română", "ur": "Urdu", - "ge": "ქართული" + "ge": "ქართული", + "uz": "O'zbek tili", }; let messages = { From fdfb572e09bc6d4c4c0e80bde779cba0dad54ad1 Mon Sep 17 00:00:00 2001 From: Nelson Chan <3271800+chakflying@users.noreply.github.com> Date: Wed, 1 Nov 2023 09:48:13 +0800 Subject: [PATCH 7/9] Fix: Add axios abort signal (#3961) * Fix: Add axios abort signal * Chore: Fix comment --- server/model/monitor.js | 3 ++- server/util-server.js | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index 5dcb7171c..ef71eacc8 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -6,7 +6,7 @@ const { log, UP, DOWN, PENDING, MAINTENANCE, flipStatus, MAX_INTERVAL_SECOND, MI SQL_DATETIME_FORMAT } = require("../../src/util"); const { tcping, ping, checkCertificate, checkStatusCode, getTotalClientInRoom, setting, mssqlQuery, postgresQuery, mysqlQuery, mqttAsync, setSetting, httpNtlm, radius, grpcQuery, - redisPingAsync, mongodbPing, kafkaProducerAsync, getOidcTokenClientCredentials, + redisPingAsync, mongodbPing, kafkaProducerAsync, getOidcTokenClientCredentials, axiosAbortSignal } = require("../util-server"); const { R } = require("redbean-node"); const { BeanModel } = require("redbean-node/dist/bean-model"); @@ -456,6 +456,7 @@ class Monitor extends BeanModel { validateStatus: (status) => { return checkStatusCode(status, this.getAcceptedStatuscodes()); }, + signal: axiosAbortSignal(this.timeout * 1000), }; if (bodyValue) { diff --git a/server/util-server.js b/server/util-server.js index 181073843..ca8b5ce62 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -1095,3 +1095,26 @@ if (process.env.TEST_BACKEND) { return module.exports.__test[functionName]; }; } + +/** + * Generates an abort signal with the specified timeout. + * @param {number} timeoutMs - The timeout in milliseconds. + * @returns {AbortSignal | null} - The generated abort signal, or null if not supported. + */ +module.exports.axiosAbortSignal = (timeoutMs) => { + try { + return AbortSignal.timeout(timeoutMs); + } catch (_) { + // v16-: AbortSignal.timeout is not supported + try { + const abortController = new AbortController(); + + setTimeout(() => abortController.abort(), timeoutMs || 0); + + return abortController.signal; + } catch (_) { + // v15-: AbortController is not supported + return null; + } + } +}; From b534fde26512bb4e6ae674aa92d5447c11e15b2c Mon Sep 17 00:00:00 2001 From: Nelson Chan <3271800+chakflying@users.noreply.github.com> Date: Fri, 3 Nov 2023 21:25:28 +0800 Subject: [PATCH 8/9] Fix: Use ActionSelect for Docker Host & validate input (#3864) * Fix: Use ActionSelect Docker Host & validate input * Fix: Handle docker host deleted while editing * UI: Use add for ActionSelect & prevent delete instead --- server/model/monitor.js | 8 ++++-- src/components/ActionSelect.vue | 22 +++++++++++++-- src/components/DockerHostDialog.vue | 3 +- src/lang/en.json | 2 ++ src/pages/EditMonitor.vue | 44 ++++++++++++++++++++--------- 5 files changed, 59 insertions(+), 20 deletions(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index ef71eacc8..27f52312b 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -673,8 +673,6 @@ class Monitor extends BeanModel { } else if (this.type === "docker") { log.debug("monitor", `[${this.name}] Prepare Options for Axios`); - const dockerHost = await R.load("docker_host", this.docker_host); - const options = { url: `/containers/${this.docker_container}/json`, timeout: this.interval * 1000 * 0.8, @@ -690,6 +688,12 @@ class Monitor extends BeanModel { }), }; + const dockerHost = await R.load("docker_host", this.docker_host); + + if (!dockerHost) { + throw new Error("Failed to load docker host config"); + } + if (dockerHost._dockerType === "socket") { options.socketPath = dockerHost._dockerDaemon; } else if (dockerHost._dockerType === "tcp") { diff --git a/src/components/ActionSelect.vue b/src/components/ActionSelect.vue index ae09e6566..78daebc26 100644 --- a/src/components/ActionSelect.vue +++ b/src/components/ActionSelect.vue @@ -1,9 +1,9 @@