diff --git a/3rd-Party-Addons.md b/3rd-Party-Addons.md index a90e2e9..7560297 100644 --- a/3rd-Party-Addons.md +++ b/3rd-Party-Addons.md @@ -2,4 +2,5 @@ A list of 3rd party addons, plugins or related side projects. Feel free to add your project here by making a pull request in this wiki repo: https://github.com/louislam/uptime-kuma-wiki -- [Streamdeck Uptime Kuma](https://github.com/MarlBurroW/Streamdeck-Uptime-Kuma) - An Uptime Kuma plugin for Elgato Streamdeck \ No newline at end of file +- [Streamdeck Uptime Kuma](https://github.com/MarlBurroW/Streamdeck-Uptime-Kuma) - An Uptime Kuma plugin for Elgato Streamdeck +- [xBarApp Uptime Kuma](https://github.com/mariogarridopt/xBar-Uptime-Kuma) - An Uptime Kuma plugin for xBarApp for Mac diff --git a/API-Keys.md b/API-Keys.md new file mode 100644 index 0000000..60e935e --- /dev/null +++ b/API-Keys.md @@ -0,0 +1,64 @@ +# API Keys +(Version >= 1.21.0) + +API keys can be used to access secured HTTP APIs, including the +Prometheus metrics endpoint. + +## Adding an API key + +Management of API keys is done through the API Keys page in settings +This page will show you all of your API keys, including expired keys. + +You can set the name of the key, as well as it's expiry date, or +optionally set the key to never expire. When you click generate, you +will be shown the API key in a pop up dialog, you should make sure to +make a copy of the key as it will not be shown again. The API key cannot +be used to access the web interface but you should treat API keys like +you treat your passwords as they can still be used to access potentially +sensitive data. + +Note: whilst basic authentication will continue to work after you +update, you will be unable to use basic authentication as soon as you +add your first API key. After you have added your first API key, basic +authentication for endpoints will be permanently disabled. + +## Disabling keys + +It is possible to temporarily disable keys. This can be done through the +settings page. This will prevent the key from being used for +authentication until it is enabled again. + +## Expired keys + +If a key has expired, it will not be automatically deleted. This is to +aid in debugging systems that suddenly stop working. You can delete an +expired key, or any key for that matter, by simply hitting the red +delete button from the settings page. + +## Authenticating using an API key + +Authentication is done by passing the API key in the `Authorization` +header. For example, here is a request made with curl to the `metrics` +endpoint. + +``` +curl -u":" uptime.kuma/metrics +``` + +Note, the `:` is required before the key as basic authentication +requires a username and password separated by a `:`, however we don't +make use of the username field. + +Here is an example config for Prometheus: + +``` + - job_name: 'uptime' + scrape_interval: 30s + scheme: http + static_configs: + - targets: ['uptime.url'] + basic_auth: + password: +``` + +Note: we don't need to set a username field as it is not used. diff --git a/Environment-Variables.md b/Environment-Variables.md index ec86ec2..2e5b86a 100644 --- a/Environment-Variables.md +++ b/Environment-Variables.md @@ -1,14 +1,26 @@ +(1.20.0) For non-Docker users, you can create a new file named `.env` in the root directory. The format is like this: + +```.env +UPTIME_KUMA_HOST=127.0.0.1 +UPTIME_KUMA_PORT=8080 +``` + +Server Argument Usage: +```bash +node server/server.js --host=127.0.0.1 --port=8080 +``` + ## Server Environment Variables | Environment Variable | Server Argument | Description | Default | | ------------------------------------------ | -------------------------- | --------------------------------------------------------------------- | ---------: | -| `DATA_DIR` | `data-dir` | Set the directory where the data should be stored (could be relative) | `./data/` | -| `UPTIME_KUMA_HOST` or `HOST` | `host` | Host to bind to, could be an ip. | `::` | -| `UPTIME_KUMA_PORT` or `PORT` | `port` | Port to listen to | `3001` | -| `UPTIME_KUMA_SSL_KEY` or `SSL_KEY` | `ssl-key` | Path to SSL key | | -| `UPTIME_KUMA_SSL_CERT` or `SSL_CERT` | `ssl-cert` | Path to SSL certificate | | -| `UPTIME_KUMA_CLOUDFLARED_TOKEN` | `cloudflared-token` | Cloudflare Tunnel Token (Available in 1.14.0) | | -| `UPTIME_KUMA_DISABLE_FRAME_SAMEORIGIN` | `disable-frame-sameorigin` | By default, Uptime Kuma is not allowed in iframe if the domain name is not the same as the parent. It protects your Uptime Kuma to be a phishing website. If you don't need this protection, you can set it to `true` | `false` | +| `DATA_DIR` | `--data-dir=` | Set the directory where the data should be stored (could be relative) | `./data/` | +| `UPTIME_KUMA_HOST` or `HOST` | `--host=` | Host to bind to, could be an ip. | `::` | +| `UPTIME_KUMA_PORT` or `PORT` | `--port=` | Port to listen to | `3001` | +| `UPTIME_KUMA_SSL_KEY` or `SSL_KEY` | `--ssl-key=` | Path to SSL key | | +| `UPTIME_KUMA_SSL_CERT` or `SSL_CERT` | `--ssl-cert=` | Path to SSL certificate | | +| `UPTIME_KUMA_CLOUDFLARED_TOKEN` | `--cloudflared-token=` | (1.14.0) Cloudflare Tunnel Token | | +| `UPTIME_KUMA_DISABLE_FRAME_SAMEORIGIN` | `--disable-frame-sameorigin=` | By default, Uptime Kuma is not allowed in iframe if the domain name is not the same as the parent. It protects your Uptime Kuma to be a phishing website. If you don't need this protection, you can set it to `true` | `false` | | `NODE_EXTRA_CA_CERTS` | | Add your self-signed ca certs. (e.g. /cert/path/CAcert.pem) [Read more](https://github.com/louislam/uptime-kuma/issues/1380) | | | `NODE_TLS_REJECT_UNAUTHORIZED` | | Ignore all TLS errors | `0` | | `NODE_OPTIONS` | | Set it to `--insecure-http-parser`, if you encountered error `Invalid header value char` when your website using WAF | | @@ -25,7 +37,8 @@ | Environment variable | Server argument | Description | Default | | ------------------------------------------ | -------------------------- | --------------------------------------------------------------------- | ---------: | -| `NODE_ENV` | | Set the NodeJS environment flag | production | +| `NODE_ENV` | | Set the NodeJS environment flag. `development`, `production` | production | | `UPTIME_KUMA_LOG_RESPONSE_BODY_MONITOR_ID` | | Monitor ID - If provided, it will output the monitor's response to your console | | -| `UPTIME_KUMA_HIDE_LOG` | | (1.15.0) Examples: debug_monitor,info_monitor,debug_cert,warn_monitor | | +| `UPTIME_KUMA_HIDE_LOG` | | (1.15.0) Examples: `debug_monitor,info_monitor,debug_cert,warn_monitor` | | | `SQL_LOG` | | Set `1` to enable | | | +| `UPTIME_KUMA_ENABLE_EMBEDDED_MARIADB`| | (2.0.0) Set `1` to enable | | | diff --git a/Home.md b/Home.md index 978e0f2..c476384 100644 --- a/Home.md +++ b/Home.md @@ -48,4 +48,6 @@ https://github.com/louislam/uptime-kuma-wiki * (2022-03-02) Docker Pull is over 25M! 14,050 Stargazers! * (2022-04-10) 15,629 Stargazers! * (2022-10-09) 21,975 Stargazers! Over 20K! Another Milestone!🐻👍 - +* (2023-01-09) {"⭐": 27783, "🐳": 31688853 } +* (2023-02-06) let starCount = 29141; let dockerPullCount = 32185677; +* (2023-02-26) `
30,063
32,606,170
` \ No newline at end of file diff --git a/OpenRC-Script.md b/OpenRC-Script.md index 8874c83..0465960 100644 --- a/OpenRC-Script.md +++ b/OpenRC-Script.md @@ -11,8 +11,9 @@ 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}" +logfile=${logfile:-$log_dir/$RC_SVCNAME.log} +output_log="${output_log:-$logfile}" +error_log="${error_log:-$logfile}" command=${command:-/usr/bin/node} command_args="$directory/server/server.js" @@ -27,9 +28,12 @@ start_pre() { checkpath --owner=$command_user --directory $log_dir \ $directory/data \ $directory/data/upload - checkpath --owner=$command_user --file $log_dir/*.log \ + checkpath --owner=$command_user --file $logfile \ $directory/data/error.log + [ ! -e $directory/data/kuma.db ] && + cp $directory/db/kuma.db $directory/data/ + checkpath --owner=$command_user --mode 600 --file $directory/data/kuma.db* } @@ -52,14 +56,7 @@ 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. +Start the service and add it to default runlevel if preferred. ```sh sudo rc-service uptime-kuma start diff --git a/Status-Page.md b/Status-Page.md index 4f401d7..6d8c29f 100644 --- a/Status-Page.md +++ b/Status-Page.md @@ -2,8 +2,8 @@ ## Things You Should Know - Status page is intended for public users to check the status of your services -- Status page will caches result for 60 seconds -- Status page is just like a traditional web page. Update won't be so responsive like the dashboard does. +- Status page will caches result for 5 minutes +- Status page is just like a traditional web page. Updates won't be as responsive as the dashboard. - Status page will refresh the page every 5 minutes - `default` is a special slug - `http://example.com/status` is pointing to `http://example.com/status/default` diff --git a/Troubleshooting.md b/Troubleshooting.md index 2b50807..7893d78 100644 --- a/Troubleshooting.md +++ b/Troubleshooting.md @@ -5,20 +5,18 @@ If your Uptime Kuma reports DOWN of your service, sometimes you would like to kn Go into your container's bash. -``` +```bash docker exec -it uptime-kuma bash ``` -Then you can test with these commands for example: +Install `curl` + +```bash +apt update && apt --yes install curl ``` + +Then you can test with these commands for example: +```bash curl https://google.com ping google.com ``` - -If running a ping results in a DNS-related error, try configuring your container to run using the host's network. To do this, run the `docker run` command with the `--network="host"` flag. For example: - -``` -docker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma --network="host" louislam/uptime-kuma:1 -``` - -More information here: https://docs.docker.com/engine/reference/run/#network-host diff --git a/_Sidebar.md b/_Sidebar.md index d1a3b0d..bc22992 100644 --- a/_Sidebar.md +++ b/_Sidebar.md @@ -14,6 +14,7 @@ - [How to Monitor Docker Containers](https://github.com/louislam/uptime-kuma/wiki/How-to-Monitor-Docker-Containers) - [Maintenance](https://github.com/louislam/uptime-kuma/wiki/Maintenance) - [3rd Party Addons](https://github.com/louislam/uptime-kuma/wiki/3rd-Party-Addons) +- [API Keys](https://github.com/louislam/uptime-kuma/wiki/API-Keys) ## Network - [Reverse Proxy](https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy) @@ -27,7 +28,7 @@ ## Development & Contributions - [CONTRIBUTING Rules & Guide](https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md) -- [How to Translation](https://github.com/louislam/uptime-kuma/tree/master/src/languages) +- [How to Translate](https://github.com/louislam/uptime-kuma/tree/master/src/lang#how-to-translate) - [Setup Development Environment](https://github.com/louislam/uptime-kuma/wiki/Setup-Development-Environment) - [Test Pull Requests](https://github.com/louislam/uptime-kuma/wiki/Test-Pull-Requests) - [Development Side Notes](https://github.com/louislam/uptime-kuma/wiki/Development-Side-Notes) @@ -35,3 +36,4 @@ ## More - [Supported Versions](https://github.com/louislam/uptime-kuma/blob/master/SECURITY.md) - [MIT License](https://github.com/louislam/uptime-kuma/blob/master/LICENSE) +- [Videos By Youtubers](https://www.youtube.com/playlist?list=PLjfSRxTTcLFm0mAw3fKNZzieXixScm9th) diff --git a/🆙-How-to-Update.md b/🆙-How-to-Update.md index 90a9c12..0b1ddb1 100644 --- a/🆙-How-to-Update.md +++ b/🆙-How-to-Update.md @@ -34,10 +34,10 @@ cd # Update from git git fetch --all -git checkout 1.19.2 --force +git checkout 1.20.2 --force # Install dependencies and prebuilt -npm install --omit=dev +npm install --production npm run download-dist # Restart diff --git a/🔧-How-to-Install.md b/🔧-How-to-Install.md index a2a9ed4..7e35019 100644 --- a/🔧-How-to-Install.md +++ b/🔧-How-to-Install.md @@ -187,6 +187,11 @@ https://haci.io/posts/uptime-kuma-azure-container-instance/ Unofficial tutorial by Leandro: https://www.leandroscardua.com/blog/deploy-uptime-kuma-on-azure/ +### Install on Azure AppService with persistent storage + +Unofficial bicep deployment script by Yannick Zwijsen: +https://github.com/yzwijsen/deploy-uptime-kuma-azure + ### SQLite S3 persistent storage with Litestream.io [![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/UfDasl?referralCode=373)