Compare commits
No commits in common. "main" and "mariadb" have entirely different histories.
@ -32,7 +32,7 @@ steps:
|
|||||||
from_secret: drone_abra-bot_token
|
from_secret: drone_abra-bot_token
|
||||||
fork: true
|
fork: true
|
||||||
repositories:
|
repositories:
|
||||||
- toolshed/auto-recipes-catalogue-json
|
- coop-cloud/auto-recipes-catalogue-json
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
event: tag
|
event: tag
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
TYPE=uptime-kuma
|
TYPE=uptime-kuma
|
||||||
COMPOSE_FILE="compose.yml"
|
|
||||||
LETS_ENCRYPT_ENV=production
|
|
||||||
|
|
||||||
DOMAIN=uptime-kuma.example.com
|
DOMAIN=uptime-kuma.example.com
|
||||||
|
|
||||||
@ -10,6 +8,4 @@ DOMAIN=uptime-kuma.example.com
|
|||||||
SECRET_DB_PASSWORD_VERSION=v1
|
SECRET_DB_PASSWORD_VERSION=v1
|
||||||
SECRET_DB_ROOT_PASSWORD_VERSION=v1
|
SECRET_DB_ROOT_PASSWORD_VERSION=v1
|
||||||
|
|
||||||
|
LETS_ENCRYPT_ENV=production
|
||||||
## Enable mariadb
|
|
||||||
#COMPOSE_FILE="$COMPOSE_FILE:compose.mariadb.yml"
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* **Status**: 0
|
* **Status**: 0
|
||||||
* **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**: No
|
||||||
* **Backups**: Yes
|
* **Backups**: No
|
||||||
* **Email**: No
|
* **Email**: No
|
||||||
* **Tests**: No
|
* **Tests**: No
|
||||||
* **SSO**: No
|
* **SSO**: No
|
||||||
@ -22,10 +22,3 @@
|
|||||||
* `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:
|
|
||||||
```
|
|
||||||
#COMPOSE_FILE="$COMPOSE_FILE:compose.mariadb.yml"
|
|
||||||
```
|
|
||||||
|
6
abra.sh
6
abra.sh
@ -1,5 +1 @@
|
|||||||
export APP_ENTRYPOINT_VERSION=v2
|
export APP_ENTRYPOINT_VERSION=v1
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
@ -1,43 +0,0 @@
|
|||||||
---
|
|
||||||
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}
|
|
21
compose.yml
21
compose.yml
@ -3,7 +3,7 @@ version: "3.8"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: louislam/uptime-kuma:2.0.0-beta.1
|
image: git.coopcloud.tech/coop-cloud-chaos-patchs/uptime-kuma:latest
|
||||||
volumes:
|
volumes:
|
||||||
- data:/app/data
|
- data:/app/data
|
||||||
secrets:
|
secrets:
|
||||||
@ -13,7 +13,12 @@ services:
|
|||||||
- proxy
|
- proxy
|
||||||
environment:
|
environment:
|
||||||
- UPTIME_KUMA_GH_REPO=louislam:uptime-kuma
|
- UPTIME_KUMA_GH_REPO=louislam:uptime-kuma
|
||||||
- UPTIME_KUMA_DB_TYPE=sqlite
|
- 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:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
configs:
|
configs:
|
||||||
@ -35,15 +40,15 @@ 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=2.0.0+2.0.0-beta.1"
|
- "coop-cloud.${STACK_NAME}.version=0.6.0+latest"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: "curl -L localhost:3001"
|
test: 'curl -L localhost:3001'
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 5
|
retries: 5
|
||||||
start_period: 2m
|
start_period: 2m
|
||||||
db:
|
db:
|
||||||
image: mariadb:11.7
|
image: mariadb:11.5
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
|
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
|
||||||
- MYSQL_PASSWORD_FILE=/run/secrets/db_password
|
- MYSQL_PASSWORD_FILE=/run/secrets/db_password
|
||||||
@ -56,12 +61,6 @@ services:
|
|||||||
secrets:
|
secrets:
|
||||||
- db_password
|
- db_password
|
||||||
- db_root_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:
|
volumes:
|
||||||
mariadb:
|
mariadb:
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
!!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()
|
|
||||||
```
|
|
@ -1 +0,0 @@
|
|||||||
sqlite is the default database now, check the README.md on how to configure mariadb
|
|
@ -1,21 +0,0 @@
|
|||||||
#!/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()
|
|
Loading…
x
Reference in New Issue
Block a user