diff --git a/OpenRC-Script.md b/OpenRC-Script.md new file mode 100644 index 0000000..5799ba6 --- /dev/null +++ b/OpenRC-Script.md @@ -0,0 +1,66 @@ +For Alpine/postmarketOS/Gentoo/Artix, you can create an OpenRC service as +`/etc/init.d/uptime-kuma`: + +```sh +#!/sbin/openrc-run + +description="Uptime Kuma self-hosted monitoring tool" + +# Change $directory to path to uptime-kuma +directory=${directory:-/usr/share/uptime-kuma} +pidfile=${pidfile:-/run/$RC_SVCNAME.pid} + +log_dir="/var/log/$RC_SVCNAME" +output_log="${output_log:-$log_dir/output.log}" +error_log="${error_log:-$log_dir/error.log}" + +command=${command:-/usr/bin/node} +command_args="$directory/server/server.js" +command_user=${command_user:-uptime-kuma:uptime-kuma} +command_background=true + +depend() { + need net +} + +start_pre() { + checkpath --owner=$command_user --directory $log_dir \ + $directory/data \ + $directory/data/upload + checkpath --owner=$command_user --file $log_dir/*.log \ + $directory/data/error.log \ + $directory/data/kuma.db +} + +start_post() { + # Wait for the server to be started + sleep 10 +} +``` + +Set the script to executable. + +```sh +sudo chmod 755 /etc/init.d/uptime-kuma +``` + +Create a user and group `uptime-kuma:uptime-kuma` for the service. + +```sh +sudo addgroup -S uptime-kuma +sudo adduser -S -D -h /var/lib/uptime-kuma -s /sbin/nologin -G uptime-kuma -g uptime-kuma uptime-kuma +``` + +If the database is not initialized, it has to be run fisrt. + +```sh +cd /usr/share/uptime-kuma +sudo -u uptime-kuma node server/server.js +``` + +Start the service and add it to default runlevel if prefered. + +```sh +sudo rc-service uptime-kuma start +sudo rc-update add uptime-kuma +``` diff --git a/Reverse-Proxy.md b/Reverse-Proxy.md index ca5e24c..4dfecc5 100644 --- a/Reverse-Proxy.md +++ b/Reverse-Proxy.md @@ -69,9 +69,10 @@ With SSL: ProxyPass / http://localhost:3001/ RewriteEngine on - RewriteCond %{HTTP:Upgrade} websocket [NC] - RewriteCond %{HTTP:Connection} upgrade [NC] - RewriteRule ^/?(.*) "ws://localhost:3001/$1" [P,L] + RewriteCond %{HTTP:Upgrade} =websocket + RewriteRule /(.*) ws://localhost:3001/$1 [P,L] + RewriteCond %{HTTP:Upgrade} !=websocket + RewriteRule /(.*) http://localhost:3001/$1 [P,L] ``` diff --git a/Troubleshooting.md b/Troubleshooting.md new file mode 100644 index 0000000..75552b8 --- /dev/null +++ b/Troubleshooting.md @@ -0,0 +1,16 @@ + +## Uptime Kuma reports DOWN, but I can access. + +If your Uptime Kuma reports DOWN of your service, sometimes you would like to know it is a bug of Uptime Kuma or your own Docker network issue. + +Go into your container's bash. + +``` +docker exec -it uptime-kuma bash +``` + +Then you can test with these commands for example: +``` +curl https://google.com +ping google.com +``` diff --git a/πŸ†™-How-to-Update.md b/πŸ†™-How-to-Update.md index 6342075..d4770d6 100644 --- a/πŸ†™-How-to-Update.md +++ b/πŸ†™-How-to-Update.md @@ -34,7 +34,7 @@ cd # Update from git git fetch --all -git checkout 1.17.0 --force +git checkout 1.17.1 --force # Install dependencies and prebuilt npm install --production diff --git a/πŸ”§-How-to-Install.md b/πŸ”§-How-to-Install.md index 5685f66..68946a5 100644 --- a/πŸ”§-How-to-Install.md +++ b/πŸ”§-How-to-Install.md @@ -132,6 +132,15 @@ https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy See more [here](https://github.com/louislam/uptime-kuma/tree/k8s-unofficial/kubernetes) +### ☸️ OpenShift 4 and Kubernetes Helm 3 Chart (Unofficial) + +> Note: This Chart relies on a repackaged OCI Container Image, which lets *uptime-kuma* run as **non-root** user. \ +> The entire repackage process is automated via GitHub Actions and renovate-bot keeps everything up to date. (feel free to audit it yourself) + +The Containerfile used to rebundle *uptime-kuma*: [rootless Containerfile](https://github.com/k3rnelpan1c-dev/uptime-kuma-helm/blob/main/container/Containerfile) + +https://github.com/k3rnelpan1c-dev/uptime-kuma-helm + ### Ansible (Unofficial) https://github.com/louislam/uptime-kuma/tree/ansible-unofficial/ansible