From e97fd64eb80fd4d3162489f4cc8699c1ba68e50f Mon Sep 17 00:00:00 2001 From: Matthew Nickson Date: Wed, 15 Feb 2023 22:18:36 +0000 Subject: [PATCH 1/5] Added documentation for louislam/uptime-kuma#2558 Signed-off-by: Matthew Nickson --- APIKeys.md | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 APIKeys.md diff --git a/APIKeys.md b/APIKeys.md new file mode 100644 index 0000000..381b82a --- /dev/null +++ b/APIKeys.md @@ -0,0 +1,65 @@ +# API Keys + +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 Key management page, +accessible from the drop down menu, just below the maintenance link. This +page will show you all of your API keys, including expired keys. The +green button in the top left can be used to add a new key. + +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 +management 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 management 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 password field as it is not used. From 788923ec28503d5b669078eee7eb0617da441546 Mon Sep 17 00:00:00 2001 From: Yannick Zwijsen Date: Fri, 24 Feb 2023 18:28:49 +0100 Subject: [PATCH 2/5] add Azure AppService with persistent storage --- 🔧-How-to-Install.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/🔧-How-to-Install.md b/🔧-How-to-Install.md index e6dbf0d..63a443d 100644 --- a/🔧-How-to-Install.md +++ b/🔧-How-to-Install.md @@ -181,6 +181,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) From 28158ca06bd6eb1c641de4f94f2f216faedbc108 Mon Sep 17 00:00:00 2001 From: Matthew Nickson Date: Sun, 26 Feb 2023 18:19:31 +0000 Subject: [PATCH 3/5] Updated API Key docs to match new UI Updated the API Key docs to match the UI changes made in 11fa690e0915b9be166b861cf704c76db864e59d Signed-off-by: Matthew Nickson --- APIKeys.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/APIKeys.md b/APIKeys.md index 381b82a..654fe84 100644 --- a/APIKeys.md +++ b/APIKeys.md @@ -5,10 +5,8 @@ Prometheus metrics endpoint. ## Adding an API key -Management of API keys is done through the API Key management page, -accessible from the drop down menu, just below the maintenance link. This -page will show you all of your API keys, including expired keys. The -green button in the top left can be used to add a new 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 @@ -26,7 +24,7 @@ authentication for endpoints will be permanently disabled. ## Disabling keys It is possible to temporarily disable keys. This can be done through the -management page. This will prevent the key from being used for +settings page. This will prevent the key from being used for authentication until it is enabled again. ## Expired keys @@ -34,7 +32,7 @@ authentication until it is enabled again. 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 management page. +delete button from the settings page. ## Authenticating using an API key From 01237b4fa9166877ed736fd5e7b9fdd08d48ca55 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Thu, 2 Mar 2023 16:45:54 +0800 Subject: [PATCH 4/5] Rename --- APIKeys.md => API-Keys.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename APIKeys.md => API-Keys.md (100%) diff --git a/APIKeys.md b/API-Keys.md similarity index 100% rename from APIKeys.md rename to API-Keys.md From 705b78e014714ef7fe108e90b80db51beac05db5 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Thu, 2 Mar 2023 16:47:57 +0800 Subject: [PATCH 5/5] Update --- API-Keys.md | 1 + _Sidebar.md | 1 + 2 files changed, 2 insertions(+) diff --git a/API-Keys.md b/API-Keys.md index 654fe84..879371b 100644 --- a/API-Keys.md +++ b/API-Keys.md @@ -1,4 +1,5 @@ # API Keys +(Version >= 1.21.0) API keys can be used to access secured HTTP APIs, including the Prometheus metrics endpoint. diff --git a/_Sidebar.md b/_Sidebar.md index 6754173..0c21e97 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)