Compare commits
43
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b2a3fc5e9 | ||
|
|
e59db61344 | ||
|
|
4be91e3fe6 | ||
|
|
b21ab2c07e | ||
|
|
ba9e059039 | ||
|
|
4493f6ad6c | ||
|
|
ce907a3c4a | ||
|
|
5fc90c6386 | ||
|
|
69a0443f6e | ||
|
|
31a4e77938 | ||
|
|
ea9e14c357 | ||
|
|
1876e3555d | ||
|
|
564441ab06 | ||
|
|
7897cae890 | ||
|
|
f41d89d320 | ||
|
|
773fdeb412 | ||
|
|
59ed487328 | ||
|
|
ca67375a56 | ||
|
|
b51e8f8f45 | ||
|
|
436014726c | ||
|
|
cc408eb56a | ||
|
|
65e0407ed7 | ||
|
|
a2fc13d45b | ||
|
|
185e2f4fe8 | ||
|
|
61d122b455 | ||
|
|
769b0bdf2b | ||
|
|
83b4479bb6 | ||
|
|
fbecd487bd | ||
|
|
80334f05f3 | ||
|
|
616b87296d | ||
|
|
a8930db62c | ||
|
|
e927d30f74 | ||
|
|
f82019e24b | ||
|
|
a443813998 | ||
|
|
9ab54dbf8d | ||
|
|
0d32e289b3 | ||
|
|
c755e8e0e2 | ||
|
|
96faa55289 | ||
|
|
1b7a48d51d | ||
|
|
6dd9c27970 | ||
|
|
eb848af0ad | ||
|
|
99fdef2393 | ||
|
|
53b7cf592c |
+1
-1
@@ -32,7 +32,7 @@ steps:
|
|||||||
from_secret: drone_abra-bot_token
|
from_secret: drone_abra-bot_token
|
||||||
fork: true
|
fork: true
|
||||||
repositories:
|
repositories:
|
||||||
- coop-cloud/auto-recipes-catalogue-json
|
- toolshed/auto-recipes-catalogue-json
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
event: tag
|
event: tag
|
||||||
|
|||||||
+10
-1
@@ -1,8 +1,17 @@
|
|||||||
TYPE=uptime-kuma
|
TYPE=uptime-kuma
|
||||||
|
COMPOSE_FILE="compose.yml"
|
||||||
|
LETS_ENCRYPT_ENV=production
|
||||||
|
|
||||||
DOMAIN=uptime-kuma.example.com
|
DOMAIN=uptime-kuma.example.com
|
||||||
|
|
||||||
## Domain aliases
|
## Domain aliases
|
||||||
#EXTRA_DOMAINS=', `www.uptime-kuma.example.com`'
|
#EXTRA_DOMAINS=', `www.uptime-kuma.example.com`'
|
||||||
|
|
||||||
LETS_ENCRYPT_ENV=production
|
SECRET_DB_PASSWORD_VERSION=v1
|
||||||
|
SECRET_DB_ROOT_PASSWORD_VERSION=v1
|
||||||
|
|
||||||
|
## Enable mariadb, otherwise sqlite will be used
|
||||||
|
#COMPOSE_FILE="$COMPOSE_FILE:compose.mariadb.yml"
|
||||||
|
|
||||||
|
# only for testing branches of uptime-kuma
|
||||||
|
#UPTIME_KUMA_GH_REPO=<branch name>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
name: "Uptime Kuma pull request template"
|
||||||
|
about: "Uptime Kuma pull request template"
|
||||||
|
---
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Thank you for doing recipe maintenance work!
|
||||||
|
Please mark all checklist items which are relevant for your changes.
|
||||||
|
Please remove the checklist items which are not relevant for your changes.
|
||||||
|
Feel free to remove this comment.
|
||||||
|
-->
|
||||||
|
|
||||||
|
* [ ] I have deployed and tested my changes
|
||||||
|
* [ ] I have [updated relevant versions in `abra.sh`](https://docs.coopcloud.tech/maintainers/upgrade/#updating-versions-in-the-abrash)
|
||||||
|
* [ ] I have made my environment variable changes [backwards compatible](https://docs.coopcloud.tech/maintainers/upgrade/#backwards-compatible-environment-variable-changes)
|
||||||
|
* [ ] I ran `abra recipe lint uptime-kuma --chaos` on the PR's branch and fixed the warnings.
|
||||||
|
* [ ] I have added a [release note entry](https://docs.coopcloud.tech/maintainers/upgrade/#creating-new-release-notes)
|
||||||
@@ -1,14 +1,19 @@
|
|||||||
# uptime-kuma
|
# uptime-kuma
|
||||||
|
|
||||||
> One line description of the recipe
|
[](https://build.coopcloud.tech/coop-cloud/uptime-kuma)
|
||||||
|
|
||||||
|
|
||||||
|
> A fancy self-hosted monitoring tool
|
||||||
|
|
||||||
<!-- metadata -->
|
<!-- metadata -->
|
||||||
|
|
||||||
* **Category**: Apps
|
* **Maintainer**: [@stevensting](https://git.coopcloud.tech/stevensting)
|
||||||
* **Status**: 0
|
* **Status**: `stable`
|
||||||
|
* **Category**: Utilities
|
||||||
|
* **Features**: ?
|
||||||
* **Image**: [`uptime-kuma`](https://hub.docker.com/r/uptime-kuma), 4, upstream
|
* **Image**: [`uptime-kuma`](https://hub.docker.com/r/uptime-kuma), 4, upstream
|
||||||
* **Healthcheck**: No
|
* **Healthcheck**: Yes
|
||||||
* **Backups**: No
|
* **Backups**: Yes
|
||||||
* **Email**: No
|
* **Email**: No
|
||||||
* **Tests**: No
|
* **Tests**: No
|
||||||
* **SSO**: No
|
* **SSO**: No
|
||||||
@@ -22,3 +27,10 @@
|
|||||||
* `abra app deploy <app-name>`
|
* `abra app deploy <app-name>`
|
||||||
|
|
||||||
For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech).
|
For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech).
|
||||||
|
|
||||||
|
## MariaDB
|
||||||
|
|
||||||
|
By default uptime-kuma uses a sqlite database. It is possible to switch to a mariadb by:
|
||||||
|
```
|
||||||
|
#COMPOSE_FILE="$COMPOSE_FILE:compose.mariadb.yml"
|
||||||
|
```
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
export APP_ENTRYPOINT_VERSION=v3
|
||||||
|
|
||||||
|
get_all_urls() {
|
||||||
|
echo "select url from monitor" | mariadb -u kuma -p$(cat /run/secrets/db_password) -D kuma | sed 's|https://||' | sed 's|/.*||' | sort
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
---
|
||||||
|
version: "3.8"
|
||||||
|
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
secrets:
|
||||||
|
- db_password
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
environment:
|
||||||
|
- UPTIME_KUMA_DB_TYPE=mariadb
|
||||||
|
- UPTIME_KUMA_DB_HOSTNAME=db
|
||||||
|
- UPTIME_KUMA_DB_PORT=3306
|
||||||
|
- UPTIME_KUMA_DB_NAME=kuma
|
||||||
|
- UPTIME_KUMA_DB_USERNAME=kuma
|
||||||
|
- UPTIME_KUMA_DB_PASSWORD_FILE=/run/secrets/db_password
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: mariadb:11.8
|
||||||
|
environment:
|
||||||
|
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
|
||||||
|
- MYSQL_PASSWORD_FILE=/run/secrets/db_password
|
||||||
|
- MYSQL_USER=kuma
|
||||||
|
- MYSQL_DATABASE=kuma
|
||||||
|
volumes:
|
||||||
|
- mariadb:/var/lib/mysql
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
secrets:
|
||||||
|
- db_password
|
||||||
|
- db_root_password
|
||||||
|
deploy:
|
||||||
|
labels:
|
||||||
|
backupbot.backup: "${ENABLE_BACKUPS:-true}"
|
||||||
|
backupbot.backup.pre-hook: "mariadb-dump --single-transaction -u root -p\"$$(cat /run/secrets/db_root_password)\" kuma | gzip > /var/lib/mysql/dump.sql.gz"
|
||||||
|
backupbot.backup.volumes.mariadb.path: "dump.sql.gz"
|
||||||
|
backupbot.restore.post-hook: "gzip -d /var/lib/mysql/dump.sql.gz && mariadb -u root -p\"$$(cat /run/secrets/db_root_password)\" kuma < /var/lib/mysql/dump.sql && rm -f /var/lib/mysql/dump.sql"
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", 'mariadb-admin -p"$$(cat $MYSQL_ROOT_PASSWORD_FILE)" ping']
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 10
|
||||||
|
start_period: 1m
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
mariadb:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
internal:
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
db_password:
|
||||||
|
external: true
|
||||||
|
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
|
||||||
|
db_root_password:
|
||||||
|
external: true
|
||||||
|
name: ${STACK_NAME}_db_root_password_${SECRET_DB_ROOT_PASSWORD_VERSION}
|
||||||
+23
-10
@@ -3,14 +3,20 @@ version: "3.8"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: louislam/uptime-kuma:1.23.11
|
image: louislam/uptime-kuma:2.2.1
|
||||||
volumes:
|
volumes:
|
||||||
- data:/app/data
|
- data:/app/data
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
|
environment:
|
||||||
|
- UPTIME_KUMA_GH_REPO
|
||||||
|
- UPTIME_KUMA_DB_TYPE=sqlite
|
||||||
|
configs:
|
||||||
|
- source: app_entrypoint
|
||||||
|
target: /docker-entrypoint.sh
|
||||||
|
mode: 0555
|
||||||
|
entrypoint: /docker-entrypoint.sh
|
||||||
deploy:
|
deploy:
|
||||||
# restart_policy:
|
|
||||||
# condition: on-failure
|
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=3001"
|
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=3001"
|
||||||
@@ -21,13 +27,14 @@ services:
|
|||||||
#- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
|
#- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
|
||||||
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
|
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
|
||||||
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
|
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
|
||||||
- "coop-cloud.${STACK_NAME}.version=0.4.2+1.23.11"
|
- "coop-cloud.${STACK_NAME}.version=3.0.0+2.2.1"
|
||||||
# healthcheck:
|
- "backupbot.backup=${ENABLE_BACKUPS:-true}"
|
||||||
# test: ["CMD-SHELL", 'curl localhost:3001']
|
healthcheck:
|
||||||
# interval: 30s
|
test: "curl -L localhost:3001"
|
||||||
# timeout: 10s
|
interval: 30s
|
||||||
# retries: 5
|
timeout: 10s
|
||||||
# start_period: 2m
|
retries: 5
|
||||||
|
start_period: 2m
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
data:
|
data:
|
||||||
@@ -35,3 +42,9 @@ volumes:
|
|||||||
networks:
|
networks:
|
||||||
proxy:
|
proxy:
|
||||||
external: true
|
external: true
|
||||||
|
|
||||||
|
configs:
|
||||||
|
app_entrypoint:
|
||||||
|
name: ${STACK_NAME}_app_entrypoint_${APP_ENTRYPOINT_VERSION}
|
||||||
|
file: entrypoint.sh.tmpl
|
||||||
|
template_driver: golang
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
file_env() {
|
||||||
|
local var="$1"
|
||||||
|
local fileVar="${var}_FILE"
|
||||||
|
local def="${2:-}"
|
||||||
|
|
||||||
|
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
|
||||||
|
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local val="$def"
|
||||||
|
|
||||||
|
if [ "${!var:-}" ]; then
|
||||||
|
val="${!var}"
|
||||||
|
elif [ "${!fileVar:-}" ]; then
|
||||||
|
val="$(< "${!fileVar}")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
export "$var"="$val"
|
||||||
|
unset "$fileVar"
|
||||||
|
}
|
||||||
|
|
||||||
|
#file_env "UPTIME_KUMA_DB_PASSWORD"
|
||||||
|
|
||||||
|
# upstream startup command
|
||||||
|
cd /app
|
||||||
|
node server/server.js
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
!!BREAKING CHANGE!!
|
||||||
|
|
||||||
|
this version is using self-built docker image for uptime kuma to incorporate mariadb which is not officially supported yet. Performance with sqlite was really bad and uptime kuma became unusable at some point. Upgrading to this version requires manually exporting sqlite database and converting it to mariadb. Additionally there's been changes to the database structure between last published version in this so it's not enough to just export the tables, you actually need to add a bunch of fields. And importing groups and other tables is a big hassle, better stick to just `monitor`...
|
||||||
|
|
||||||
|
Here's some python to help you with this.
|
||||||
|
|
||||||
|
```
|
||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
og = open("original.sql", "r")
|
||||||
|
new = open("ported.sql", "w")
|
||||||
|
|
||||||
|
for line in og:
|
||||||
|
newline = line
|
||||||
|
if line.startswith("INSERT INTO monitor VALUES"):
|
||||||
|
newarr = line[27:-3].split(",")
|
||||||
|
if len(newarr) == 77:
|
||||||
|
kafka_producer_ssl_and_topic = ["0", "0"]
|
||||||
|
arr = newarr[:66] + kafka_producer_ssl_and_topic + newarr[66:75] + ["'keyword'", "NULL", "NULL", "'2c'", "NULL", "0", "'{}'"]
|
||||||
|
newline = "INSERT INTO monitor VALUES(" + ",".join(arr) + ");\n"
|
||||||
|
else:
|
||||||
|
newline = "--" + line
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
new.writelines(newline)
|
||||||
|
|
||||||
|
og.close()
|
||||||
|
new.close()
|
||||||
|
```
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
sqlite is the default database now, check the README.md on how to configure mariadb
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
In case you are currently using MariaDb instead of the internal sqlite, you need to activate the usage of compose.mariadb.yaml in your env file. (compare .env.sample) Reason for this is that the mariadb container was removed from compose.yml
|
||||||
Executable
+21
@@ -0,0 +1,21 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
og = open("original.sql", "r")
|
||||||
|
new = open("ported.sql", "w")
|
||||||
|
|
||||||
|
for line in og:
|
||||||
|
newline = line
|
||||||
|
if line.startswith("INSERT INTO monitor VALUES"):
|
||||||
|
newarr = line[27:-3].split(",")
|
||||||
|
if len(newarr) == 77:
|
||||||
|
kafka_producer_ssl_and_topic = ["0", "0"]
|
||||||
|
arr = newarr[:66] + kafka_producer_ssl_and_topic + newarr[66:75] + ["'keyword'", "NULL", "NULL", "'2c'", "NULL", "0", "'{}'"]
|
||||||
|
newline = "INSERT INTO monitor VALUES(" + ",".join(arr) + ");\n"
|
||||||
|
else:
|
||||||
|
newline = "--" + line
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
new.writelines(newline)
|
||||||
|
|
||||||
|
og.close()
|
||||||
|
new.close()
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
|
"extends": [
|
||||||
|
"config:recommended"
|
||||||
|
],
|
||||||
|
"reviewers": [
|
||||||
|
"stevensting"
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user