19 Commits

Author SHA1 Message Date
b51e8f8f45 Merge pull request 'Added backup flags to compose.yml' (#4) from bb2-backups into main
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #4
2025-06-05 15:26:01 +00:00
436014726c Added mariadb bb2 labels to compose.yml 2025-04-01 18:00:39 +01:00
cc408eb56a Set backups to YES in README 2025-04-01 17:58:36 +01:00
65e0407ed7 Added backup flags to compose.yml 2025-04-01 17:55:31 +01:00
a2fc13d45b feat: add command to list all monitored urls
Some checks failed
continuous-integration/drone/push Build is failing
2025-03-04 20:57:04 +01:00
185e2f4fe8 chore: publish 2.0.0+2.0.0-beta.1 release
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/tag Build is passing
2025-02-26 17:00:14 +01:00
61d122b455 feat: switch to upstream image (#3)
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #3
Reviewed-by: yksflip <flip@yksflip.de>
Co-authored-by: p4u1 <p4u1_f4u1@riseup.net>
Co-committed-by: p4u1 <p4u1_f4u1@riseup.net>
2025-02-26 15:57:07 +00:00
769b0bdf2b Update .drone.yml
Some checks failed
continuous-integration/drone/push Build is failing
2025-01-08 10:09:13 -08:00
83b4479bb6 chore: publish 1.0.2+latest release
Some checks failed
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is failing
2024-11-14 14:18:24 +01:00
fbecd487bd chore: publish 1.0.1+latest release
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/tag Build is passing
2024-11-14 14:13:04 +01:00
80334f05f3 chore: publish 1.0.0+latest release
Some checks failed
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is failing
2024-11-14 13:42:48 +01:00
616b87296d Merge branch 'mariadb'
Some checks failed
continuous-integration/drone/push Build is failing
2024-11-14 13:34:50 +01:00
a8930db62c fix: change image 2024-10-11 11:52:02 +02:00
e927d30f74 feat: fully working mariadb 2024-10-10 18:03:24 +02:00
f82019e24b chore: bump entrypoint version
Some checks failed
continuous-integration/drone/push Build is failing
2024-10-08 14:41:17 +02:00
a443813998 fix: invalid secret name 2024-10-08 14:41:17 +02:00
9ab54dbf8d add mariadb support 2024-10-08 14:41:16 +02:00
3wc
96faa55289 Add db volume
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-02 13:54:04 -04:00
3wc
1b7a48d51d chore: publish 0.5.1+1.23.11-alpine release
All checks were successful
continuous-integration/drone/tag Build is passing
2024-07-02 13:04:01 -04:00
9 changed files with 126 additions and 14 deletions

View File

@ -32,7 +32,7 @@ steps:
from_secret: drone_abra-bot_token
fork: true
repositories:
- coop-cloud/auto-recipes-catalogue-json
- toolshed/auto-recipes-catalogue-json
trigger:
event: tag

View File

@ -1,4 +1,6 @@
TYPE=uptime-kuma
COMPOSE_FILE="compose.yml"
LETS_ENCRYPT_ENV=production
DOMAIN=uptime-kuma.example.com
@ -8,4 +10,6 @@ DOMAIN=uptime-kuma.example.com
SECRET_DB_PASSWORD_VERSION=v1
SECRET_DB_ROOT_PASSWORD_VERSION=v1
LETS_ENCRYPT_ENV=production
## Enable mariadb
#COMPOSE_FILE="$COMPOSE_FILE:compose.mariadb.yml"

View File

@ -8,7 +8,7 @@
* **Status**: 0
* **Image**: [`uptime-kuma`](https://hub.docker.com/r/uptime-kuma), 4, upstream
* **Healthcheck**: No
* **Backups**: No
* **Backups**: Yes
* **Email**: No
* **Tests**: No
* **SSO**: No
@ -22,3 +22,10 @@
* `abra app deploy <app-name>`
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:
```
#COMPOSE_FILE="$COMPOSE_FILE:compose.mariadb.yml"
```

View File

@ -1 +1,5 @@
export APP_ENTRYPOINT_VERSION=v1
export APP_ENTRYPOINT_VERSION=v2
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
}

43
compose.mariadb.yml Normal file
View File

@ -0,0 +1,43 @@
---
version: "3.8"
services:
app:
secrets:
- db_password
environment:
- UPTIME_KUMA_GH_REPO=louislam:uptime-kuma
- 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.7
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
volumes:
mariadb:
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}

View File

@ -3,7 +3,7 @@ version: "3.8"
services:
app:
image: kn0fl00k/uptime-kuma:unstable003
image: louislam/uptime-kuma:2.0.0-beta.1
volumes:
- data:/app/data
secrets:
@ -13,12 +13,9 @@ services:
- proxy
environment:
- UPTIME_KUMA_GH_REPO=louislam:uptime-kuma
- 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
- UPTIME_KUMA_DB_TYPE=sqlite
depends_on:
- db
configs:
- source: app_entrypoint
target: /docker-entrypoint.sh
@ -38,15 +35,15 @@ services:
#- "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.SSLHost=${DOMAIN}"
- "coop-cloud.${STACK_NAME}.version=0.5.0+1.23.11"
- "coop-cloud.${STACK_NAME}.version=2.0.0+2.0.0-beta.1"
healthcheck:
test: 'curl -L localhost:3001'
test: "curl -L localhost:3001"
interval: 30s
timeout: 10s
retries: 5
start_period: 2m
db:
image: mariadb:10.8
image: mariadb:11.7
environment:
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
- MYSQL_PASSWORD_FILE=/run/secrets/db_password
@ -59,6 +56,12 @@ services:
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"
volumes:
mariadb:

29
release/1.0.0+latest Normal file
View File

@ -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()
```

View File

@ -0,0 +1 @@
sqlite is the default database now, check the README.md on how to configure mariadb

21
release/convertmonitor.py Executable file
View File

@ -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()