Merge branch 'louislam:master' into master

etec-masterofsynapse 2023-04-04 16:45:29 +02:00 committed by GitHub
commit 08fe2ea69e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 119 additions and 37 deletions

@ -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 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 - [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

64
API-Keys.md Normal file

@ -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":<key>" 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: <api key>
```
Note: we don't need to set a username field as it is not used.

@ -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 ## Server Environment Variables
| Environment Variable | Server Argument | Description | Default | | Environment Variable | Server Argument | Description | Default |
| ------------------------------------------ | -------------------------- | --------------------------------------------------------------------- | ---------: | | ------------------------------------------ | -------------------------- | --------------------------------------------------------------------- | ---------: |
| `DATA_DIR` | `data-dir` | Set the directory where the data should be stored (could be relative) | `./data/` | | `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_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_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_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_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_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` | | `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_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_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 | | | `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 | | 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_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 | | | | `SQL_LOG` | | Set `1` to enable | | |
| `UPTIME_KUMA_ENABLE_EMBEDDED_MARIADB`| | (2.0.0) Set `1` to enable | | |

@ -48,4 +48,6 @@ https://github.com/louislam/uptime-kuma-wiki
* (2022-03-02) Docker Pull is over 25M! 14,050 Stargazers! * (2022-03-02) Docker Pull is over 25M! 14,050 Stargazers!
* (2022-04-10) 15,629 Stargazers! * (2022-04-10) 15,629 Stargazers!
* (2022-10-09) 21,975 Stargazers! Over 20K! Another Milestone!🐻👍 * (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) `<div class="⭐">30,063</div><div class="🐳">32,606,170</div>`

@ -11,8 +11,9 @@ directory=${directory:-/usr/share/uptime-kuma}
pidfile=${pidfile:-/run/$RC_SVCNAME.pid} pidfile=${pidfile:-/run/$RC_SVCNAME.pid}
log_dir="/var/log/$RC_SVCNAME" log_dir="/var/log/$RC_SVCNAME"
output_log="${output_log:-$log_dir/output.log}" logfile=${logfile:-$log_dir/$RC_SVCNAME.log}
error_log="${error_log:-$log_dir/error.log}" output_log="${output_log:-$logfile}"
error_log="${error_log:-$logfile}"
command=${command:-/usr/bin/node} command=${command:-/usr/bin/node}
command_args="$directory/server/server.js" command_args="$directory/server/server.js"
@ -27,9 +28,12 @@ start_pre() {
checkpath --owner=$command_user --directory $log_dir \ checkpath --owner=$command_user --directory $log_dir \
$directory/data \ $directory/data \
$directory/data/upload $directory/data/upload
checkpath --owner=$command_user --file $log_dir/*.log \ checkpath --owner=$command_user --file $logfile \
$directory/data/error.log $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* 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 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. Start the service and add it to default runlevel if preferred.
```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 ```sh
sudo rc-service uptime-kuma start sudo rc-service uptime-kuma start

@ -2,8 +2,8 @@
## Things You Should Know ## Things You Should Know
- Status page is intended for public users to check the status of your services - Status page is intended for public users to check the status of your services
- Status page will caches result for 60 seconds - Status page will caches result for 5 minutes
- Status page is just like a traditional web page. Update won't be so responsive like the dashboard does. - 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 - Status page will refresh the page every 5 minutes
- `default` is a special slug - `default` is a special slug
- `http://example.com/status` is pointing to `http://example.com/status/default` - `http://example.com/status` is pointing to `http://example.com/status/default`

@ -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. Go into your container's bash.
``` ```bash
docker exec -it uptime-kuma 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 curl https://google.com
ping 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

@ -14,6 +14,7 @@
- [How to Monitor Docker Containers](https://github.com/louislam/uptime-kuma/wiki/How-to-Monitor-Docker-Containers) - [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) - [Maintenance](https://github.com/louislam/uptime-kuma/wiki/Maintenance)
- [3rd Party Addons](https://github.com/louislam/uptime-kuma/wiki/3rd-Party-Addons) - [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 ## Network
- [Reverse Proxy](https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy) - [Reverse Proxy](https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy)
@ -27,7 +28,7 @@
## Development & Contributions ## Development & Contributions
- [CONTRIBUTING Rules & Guide](https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md) - [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) - [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) - [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) - [Development Side Notes](https://github.com/louislam/uptime-kuma/wiki/Development-Side-Notes)
@ -35,3 +36,4 @@
## More ## More
- [Supported Versions](https://github.com/louislam/uptime-kuma/blob/master/SECURITY.md) - [Supported Versions](https://github.com/louislam/uptime-kuma/blob/master/SECURITY.md)
- [MIT License](https://github.com/louislam/uptime-kuma/blob/master/LICENSE) - [MIT License](https://github.com/louislam/uptime-kuma/blob/master/LICENSE)
- [Videos By Youtubers](https://www.youtube.com/playlist?list=PLjfSRxTTcLFm0mAw3fKNZzieXixScm9th)

@ -34,10 +34,10 @@ cd <uptime-kuma-directory>
# Update from git # Update from git
git fetch --all git fetch --all
git checkout 1.19.2 --force git checkout 1.20.2 --force
# Install dependencies and prebuilt # Install dependencies and prebuilt
npm install --omit=dev npm install --production
npm run download-dist npm run download-dist
# Restart # Restart

@ -187,6 +187,11 @@ https://haci.io/posts/uptime-kuma-azure-container-instance/
Unofficial tutorial by Leandro: Unofficial tutorial by Leandro:
https://www.leandroscardua.com/blog/deploy-uptime-kuma-on-azure/ 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 ### SQLite S3 persistent storage with Litestream.io
[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/UfDasl?referralCode=373) [![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/UfDasl?referralCode=373)