From 2dbbb6b2954ba724bded137990f28a1b354124c9 Mon Sep 17 00:00:00 2001 From: Jade Ellis Date: Sun, 10 Nov 2024 16:18:49 +0000 Subject: [PATCH] Uptime Kuma --- servers/ansible/playbook.yaml | 8 +++ servers/containers/autokuma.container | 52 +++++++++++++++++++ .../jade-website-frontend.container | 2 + servers/containers/uptime-kuma.container | 50 ++++++++++++++++++ 4 files changed, 112 insertions(+) create mode 100644 servers/containers/autokuma.container create mode 100644 servers/containers/uptime-kuma.container diff --git a/servers/ansible/playbook.yaml b/servers/ansible/playbook.yaml index b8e666de..78bf69c7 100644 --- a/servers/ansible/playbook.yaml +++ b/servers/ansible/playbook.yaml @@ -84,6 +84,14 @@ file: path: /var/opt/matrix-sed state: directory + - name: Creates uptime-kuma state directory + file: + path: /var/opt/uptime-kuma + state: directory + - name: Creates autokuma state directory + file: + path: /var/opt/autokuma + state: directory # - name: install linux-system-roles diff --git a/servers/containers/autokuma.container b/servers/containers/autokuma.container new file mode 100644 index 00000000..4c67b791 --- /dev/null +++ b/servers/containers/autokuma.container @@ -0,0 +1,52 @@ + + + +[Unit] +Description=AutoKuma +Wants=network-online.target +After=network-online.target + +[Container] +ContainerName=autokuma +NoNewPrivileges=true +Image=ghcr.io/bigboot/autokuma:latest +# ReadOnly=true +Volume=/var/opt/autokuma:/data:z,U +Volume=/run/podman/podman.sock:/var/run/docker.sock:z +AutoUpdate=registry +Network=web.network + +Label="traefik.enable=false" + +Environment=AUTOKUMA__KUMA__URL=https://uptime-kuma.ellis.link +Environment="AUTOKUMA__KUMA__USERNAME=jade" +Environment="AUTOKUMA__KUMA__PASSWORD=N3oPQ8aJ8rYh0PKTI6O0Kwz5GNIBy31Uhusy" +Environment=AUTOKUMA__DOCKER__HOSTS=unix:///var/run/docker.sock +Environment=AUTOKUMA__SNIPPETS__WEB='\ + {{ container_name }}_http.http.name: {{ container_name }} HTTP\n\ + {{ container_name }}_http.http.url: https://{{ args[0] }}{% if args[1] %}:{{ args[1] }}{% endif %}\n\ + {{ container_name }}_docker.docker.name: {{ container_name }} Docker\n\ + {{ container_name }}_docker.docker.docker_container: {{ container_name }}\n\ + {{ container_name }}_docker.docker.docker_host: 1' + +Label="homepage.group=Services" +Label="homepage.name=AutoKuma" +Label="homepage.description=Configure uptime monitoring" + + + +StopTimeout=10 + +[Service] + +Restart=on-failure +RestartSec=5 + +TimeoutStopSec=2m +TimeoutStartSec=2m + +# StartLimitInterval=1m +StartLimitBurst=5 + +[Install] +WantedBy=default.target \ No newline at end of file diff --git a/servers/containers/jade-website-frontend.container b/servers/containers/jade-website-frontend.container index 745e4dad..46b366f1 100644 --- a/servers/containers/jade-website-frontend.container +++ b/servers/containers/jade-website-frontend.container @@ -41,6 +41,8 @@ Label="homepage.href=https://jade.ellis.link/" Label="homepage.siteMonitor=https://jade.ellis.link/" Label="homepage.description=My personal website!" +Label=kuma.__web='"jade.ellis.link"' + [Service] Restart=on-failure TimeoutStartSec=900 diff --git a/servers/containers/uptime-kuma.container b/servers/containers/uptime-kuma.container new file mode 100644 index 00000000..050938d3 --- /dev/null +++ b/servers/containers/uptime-kuma.container @@ -0,0 +1,50 @@ + + + +[Unit] +Description=Uptime Kuma +Wants=network-online.target +After=network-online.target + +[Container] +ContainerName=uptime-kuma +NoNewPrivileges=true +Image=docker.io/louislam/uptime-kuma:1 +# ReadOnly=true +Volume=/var/opt/uptime-kuma:/app/data:z,U +Volume=/run/podman/podman.sock:/var/run/docker.sock:z +AutoUpdate=registry +Network=web.network + +Label="traefik.enable=true" +Label="traefik.http.routers.uptime-kuma.rule=Host(`uptime-kuma.ellis.link`)" +Label="traefik.http.services.uptime-kuma.loadbalancer.server.port=3001" + +Label="traefik.http.routers.uptime-kuma.entrypoints=https" + +Label="traefik.http.routers.uptime-kuma.middlewares=default@file" + +Label="homepage.group=Public" +Label="homepage.name=Uptime Kuma" +Label="homepage.href=https://uptime-kuma.ellis.link" +Label="homepage.siteMonitor=https://uptime-kuma.ellis.link" +Label="homepage.description=Uptime monitoring" + +# Label="kuma.uptime-kuma.http.name=Uptime Kuma" +Label=kuma.__web='"uptime-kuma.ellis.link"' + +StopTimeout=100 + +[Service] + +Restart=on-failure +RestartSec=5 + +TimeoutStopSec=2m +TimeoutStartSec=2m + +# StartLimitInterval=1m +StartLimitBurst=5 + +[Install] +WantedBy=default.target \ No newline at end of file