diff --git a/kubernetes/main/apps/media/qbittorrent/app/externalsecret.yaml b/kubernetes/main/apps/media/qbittorrent/app/externalsecret.yaml index b1441bb3b..028e43308 100644 --- a/kubernetes/main/apps/media/qbittorrent/app/externalsecret.yaml +++ b/kubernetes/main/apps/media/qbittorrent/app/externalsecret.yaml @@ -87,3 +87,59 @@ spec: dataFrom: - extract: key: secrets/api-keys +--- +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/external-secrets.io/externalsecret_v1beta1.json +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: qbittorrent-gatus-ep +spec: + secretStoreRef: + kind: ClusterSecretStore + name: vault-backend + target: + name: qbittorrent-gatus-ep + template: + metadata: + labels: + gatus.io/enabled: "true" + engineVersion: v2 + data: + config.yaml: | + endpoints: + - name: "qbittorrent-login" + group: guarded + url: "https://qbittorrent.${PUBLIC_DOMAIN}/api/v2/auth/login" + method: POST + body: + username: {{ .QBITTORRENT_USERNAME }} + password: {{ .QBITTORRENT_PASSWORD }} + interval: 5m + ui: + hide-hostname: true + hide-url: true + conditions: + - "[STATUS] == 200" + headers: + Content-Type: "application/x-www-form-urlencoded" + # Save cookies after login for further requests + save-cookies: true + cookie-name: qbittorrent_session_cookie + + - name: "qbittorrent-version" + group: guarded + url: "https://qbittorrent.${PUBLIC_DOMAIN}/api/v2/app/version" + interval: 5m + ui: + hide-hostname: true + hide-url: true + conditions: + - "[STATUS] == 200" + alerts: + - type: pushover + headers: + Accept: application/json + Cookie: "qbt_session={{ .qbittorrent_session_cookie }}" + dataFrom: + - extract: + key: secrets/qbittorrent diff --git a/kubernetes/main/apps/media/qbittorrent/app/kustomization.yaml b/kubernetes/main/apps/media/qbittorrent/app/kustomization.yaml index 9446bee6c..f832c1883 100644 --- a/kubernetes/main/apps/media/qbittorrent/app/kustomization.yaml +++ b/kubernetes/main/apps/media/qbittorrent/app/kustomization.yaml @@ -6,7 +6,6 @@ resources: - ./externalsecret.yaml - ./helmrelease.yaml - ./volsync.yaml - - ../../../../templates/gatus/guarded configMapGenerator: - name: qbittorrent-loki-rules files: diff --git a/kubernetes/main/apps/media/qbittorrent/ks.yaml b/kubernetes/main/apps/media/qbittorrent/ks.yaml index 63f922ccf..502f68fe9 100644 --- a/kubernetes/main/apps/media/qbittorrent/ks.yaml +++ b/kubernetes/main/apps/media/qbittorrent/ks.yaml @@ -20,7 +20,3 @@ spec: wait: false interval: 30m timeout: 5m - postBuild: - substitute: - APP: *app - GATUS_SUBDOMAIN: qbittorrent