From 63e99af32c43df806ab445f23389877d7baeacad Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Mon, 25 Sep 2023 13:59:43 +0200 Subject: [PATCH] Add lokidoki --- roles/cloud/templates/docker-compose.yml.j2 | 10 +++++++ .../dolibarr/templates/docker-compose.yml.j2 | 10 +++++++ .../templates/docker-compose.yml.j2 | 5 ++++ roles/matrix/templates/docker-compose.yml.j2 | 30 +++++++++++++++++++ roles/metrics/templates/docker-compose.yml | 13 ++++++-- roles/n8n/templates/docker-compose.yml.j2 | 10 +++++++ .../templates/docker-compose.yml.j2 | 5 ++++ roles/traefik/templates/docker-compose.yml | 2 +- .../templates/docker-compose.yml.j2 | 5 ++++ .../templates/docker-compose.yml.j2 | 5 ++++ roles/whoami/templates/docker-compose.yml.j2 | 5 ++++ .../wireguard/templates/docker-compose.yml.j2 | 5 ++++ 12 files changed, 102 insertions(+), 3 deletions(-) diff --git a/roles/cloud/templates/docker-compose.yml.j2 b/roles/cloud/templates/docker-compose.yml.j2 index 108878b..4b88011 100644 --- a/roles/cloud/templates/docker-compose.yml.j2 +++ b/roles/cloud/templates/docker-compose.yml.j2 @@ -13,6 +13,11 @@ services: - POSTGRES_PASSWORD=nextcloud - POSTGRES_DB=nextcloud - POSTGRES_USER=nextcloud + logging: + driver: loki + options: + loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push" + mode: non-blocking nextcloud: image: nextcloud @@ -57,6 +62,11 @@ services: - POSTGRES_USER=nextcloud - POSTGRES_HOST=db - OVERWRITEPROTOCOL=https + logging: + driver: loki + options: + loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push" + mode: non-blocking networks: internal: diff --git a/roles/dolibarr/templates/docker-compose.yml.j2 b/roles/dolibarr/templates/docker-compose.yml.j2 index 857ab7a..408ba63 100644 --- a/roles/dolibarr/templates/docker-compose.yml.j2 +++ b/roles/dolibarr/templates/docker-compose.yml.j2 @@ -10,6 +10,11 @@ services: - {{ server.work_dir }}/dolibarr/db:/var/lib/mysql networks: - internal + logging: + driver: loki + options: + loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push" + mode: non-blocking dolibarr: image: tuxgasy/dolibarr:latest @@ -39,6 +44,11 @@ services: - "traefik.http.routers.dolibarr-secure.tls.certresolver=sslResolver" - "traefik.http.routers.dolibarr-secure.middlewares=private-network@file" - "traefik.docker.network=proxy" + logging: + driver: loki + options: + loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push" + mode: non-blocking networks: internal: diff --git a/roles/home_assistant/templates/docker-compose.yml.j2 b/roles/home_assistant/templates/docker-compose.yml.j2 index 625b56e..2377b95 100644 --- a/roles/home_assistant/templates/docker-compose.yml.j2 +++ b/roles/home_assistant/templates/docker-compose.yml.j2 @@ -22,3 +22,8 @@ services: # - "traefik.http.routers.homeassistant-secure.service=homeassistant" - "traefik.http.routers.homeassistant-secure.middlewares=private-network@file" - "traefik.http.services.homeassistant.loadbalancer.server.port=8123" + logging: + driver: loki + options: + loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push" + mode: non-blocking diff --git a/roles/matrix/templates/docker-compose.yml.j2 b/roles/matrix/templates/docker-compose.yml.j2 index 59e32b2..6afd161 100644 --- a/roles/matrix/templates/docker-compose.yml.j2 +++ b/roles/matrix/templates/docker-compose.yml.j2 @@ -13,6 +13,11 @@ services: - POSTGRES_USER=synapse - POSTGRES_PASSWORD=WRyu2kuArNjRxojstqpg7EfcoUP9zoka - POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C + logging: + driver: loki + options: + loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push" + mode: non-blocking synapse: image: matrixdotorg/synapse:latest @@ -35,6 +40,11 @@ services: - "traefik.http.routers.matrix-secure.tls.certresolver=sslResolver" - "traefik.port=8008" - "traefik.docker.network=proxy" + logging: + driver: loki + options: + loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push" + mode: non-blocking well-kwown: image: nginx:latest @@ -55,6 +65,11 @@ services: - "traefik.http.routers.matrix-wellknown.tls.certresolver=sslResolver" - "traefik.http.routers.matrix-wellknown.middlewares=cors-headers@docker" - "traefik.docker.network=proxy" + logging: + driver: loki + options: + loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push" + mode: non-blocking # BRIDGE mautrix-facebook: @@ -65,6 +80,11 @@ services: - internal volumes: - {{ server.work_dir }}/matrix/mautrix_facebook:/data + logging: + driver: loki + options: + loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push" + mode: non-blocking mautrix-instagram: container_name: mautrix-instagram @@ -74,6 +94,11 @@ services: - internal volumes: - {{ server.work_dir }}/matrix/mautrix_instagram:/data + logging: + driver: loki + options: + loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push" + mode: non-blocking mautrix-discord: container_name: mautrix-discord @@ -83,6 +108,11 @@ services: - internal volumes: - {{ server.work_dir }}/matrix/mautrix_discord:/data + logging: + driver: loki + options: + loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push" + mode: non-blocking networks: internal: diff --git a/roles/metrics/templates/docker-compose.yml b/roles/metrics/templates/docker-compose.yml index 3843aec..2f3d9c9 100644 --- a/roles/metrics/templates/docker-compose.yml +++ b/roles/metrics/templates/docker-compose.yml @@ -37,10 +37,19 @@ services: command: -config.file=/etc/loki/config.yml volumes: - {{ server.work_dir }}/loki/config:/etc/loki - ports: - - 3100:3100 networks: - metrics + labels: + - traefik.enable=true + - traefik.http.routers.loki-secure.entrypoints=https + - traefik.http.routers.loki-secure.rule=Host(`loki.{{ server.domain }}`) + - traefik.http.middlewares.loki-auth.basicauth.users=lokidoki:$$2y$$05$$HHJS7jsXv9g.1AsZX6f0jeFP.CrfGuvm1qoj/V8d/iXrX9oTKbDH2 + - traefik.http.routers.loki-secure.middlewares=loki-auth + - traefik.http.routers.loki-secure.tls=true + - traefik.http.routers.loki-secure.tls.certresolver=sslResolver + - traefik.http.routers.loki-secure.service=loki + - traefik.http.services.loki.loadbalancer.server.port=3100 + - traefik.docker.network=proxy promtail: image: grafana/promtail:latest diff --git a/roles/n8n/templates/docker-compose.yml.j2 b/roles/n8n/templates/docker-compose.yml.j2 index bddea37..5f9210d 100644 --- a/roles/n8n/templates/docker-compose.yml.j2 +++ b/roles/n8n/templates/docker-compose.yml.j2 @@ -13,6 +13,11 @@ services: - POSTGRES_PASSWORD=n8n - POSTGRES_DB=n8n - POSTGRES_USER=n8n + logging: + driver: loki + options: + loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push" + mode: non-blocking n8n: image: n8nio/n8n @@ -40,6 +45,11 @@ services: - DB_POSTGRESDB_DATABASE=n8n - DB_POSTGRESDB_USER=n8n - DB_POSTGRESDB_PASSWORD=n8n + logging: + driver: loki + options: + loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push" + mode: non-blocking networks: internal: diff --git a/roles/protonmail/templates/docker-compose.yml.j2 b/roles/protonmail/templates/docker-compose.yml.j2 index 2ca4c3b..044ac67 100644 --- a/roles/protonmail/templates/docker-compose.yml.j2 +++ b/roles/protonmail/templates/docker-compose.yml.j2 @@ -9,6 +9,11 @@ services: - protonmail volumes: - {{ server.work_dir }}/protonmail/base:/root + logging: + driver: loki + options: + loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push" + mode: non-blocking networks: protonmail: diff --git a/roles/traefik/templates/docker-compose.yml b/roles/traefik/templates/docker-compose.yml index d914e8a..6a30458 100644 --- a/roles/traefik/templates/docker-compose.yml +++ b/roles/traefik/templates/docker-compose.yml @@ -48,7 +48,7 @@ services: logging: driver: loki options: - loki-url: "http://localhost:3100/loki/api/v1/push" + loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push" mode: non-blocking networks: diff --git a/roles/vaultwarden/templates/docker-compose.yml.j2 b/roles/vaultwarden/templates/docker-compose.yml.j2 index cdfdf02..a288f67 100644 --- a/roles/vaultwarden/templates/docker-compose.yml.j2 +++ b/roles/vaultwarden/templates/docker-compose.yml.j2 @@ -48,6 +48,11 @@ services: - traefik.http.routers.bitwarden-websocket-http.middlewares=redirect-https - traefik.http.routers.bitwarden-websocket-http.service=bitwarden-websocket - traefik.http.services.bitwarden-websocket.loadbalancer.server.port=3012 + logging: + driver: loki + options: + loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push" + mode: non-blocking networks: internal: diff --git a/roles/watchtower/templates/docker-compose.yml.j2 b/roles/watchtower/templates/docker-compose.yml.j2 index 815be17..f54c0d2 100644 --- a/roles/watchtower/templates/docker-compose.yml.j2 +++ b/roles/watchtower/templates/docker-compose.yml.j2 @@ -7,3 +7,8 @@ services: container_name: watchtower volumes: - /var/run/docker.sock:/var/run/docker.sock + logging: + driver: loki + options: + loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push" + mode: non-blocking \ No newline at end of file diff --git a/roles/whoami/templates/docker-compose.yml.j2 b/roles/whoami/templates/docker-compose.yml.j2 index d8099ff..9095d12 100644 --- a/roles/whoami/templates/docker-compose.yml.j2 +++ b/roles/whoami/templates/docker-compose.yml.j2 @@ -15,6 +15,11 @@ services: - "traefik.http.routers.whoami-secure.tls.certresolver=sslResolver" - "traefik.http.routers.whoami-secure.middlewares=private-network@file" - "traefik.docker.network=proxy" + logging: + driver: loki + options: + loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push" + mode: non-blocking networks: proxy: diff --git a/roles/wireguard/templates/docker-compose.yml.j2 b/roles/wireguard/templates/docker-compose.yml.j2 index 9832017..21d3724 100644 --- a/roles/wireguard/templates/docker-compose.yml.j2 +++ b/roles/wireguard/templates/docker-compose.yml.j2 @@ -49,6 +49,11 @@ services: proxy: {} vpn: ipv4_address: {{ server.vpn.dns_ip }} + logging: + driver: loki + options: + loki-url: "https://lokidoki:vEGH5Z5siWgcDkNknvCVzPCyqhHSBJCBjeBRZJvxUP8SdgfxJ6AqCGutCWugGsx5@loki.mrdev023.fr/loki/api/v1/push" + mode: non-blocking networks: proxy: