From b667f8bf3f3b8664f2a24f37b527d292c75673d3 Mon Sep 17 00:00:00 2001 From: xinyangli Date: Wed, 4 Dec 2024 16:34:51 +0800 Subject: [PATCH] thorite: scrape forgejo and hedgedoc --- machines/biotite/services/forgejo.nix | 3 +++ machines/biotite/services/hedgedoc.nix | 1 + machines/thorite/monitoring.nix | 34 +++++++++++++++++++++----- machines/thorite/restic.nix | 2 +- 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/machines/biotite/services/forgejo.nix b/machines/biotite/services/forgejo.nix index 8e09910..43a73d8 100644 --- a/machines/biotite/services/forgejo.nix +++ b/machines/biotite/services/forgejo.nix @@ -38,6 +38,9 @@ let UPDATE_AVATAR = false; OPENID_CONNECT_SCOPES = "openid profile email groups"; }; + metrics = { + ENABLED = true; + }; other = { SHOW_FOOTER_VERSION = false; }; diff --git a/machines/biotite/services/hedgedoc.nix b/machines/biotite/services/hedgedoc.nix index f71594a..dc89296 100644 --- a/machines/biotite/services/hedgedoc.nix +++ b/machines/biotite/services/hedgedoc.nix @@ -30,6 +30,7 @@ in scope = "openid email profile"; clientID = "hedgedoc"; }; + enableStatsApi = true; allowAnonymous = false; defaultPermission = "private"; }; diff --git a/machines/thorite/monitoring.nix b/machines/thorite/monitoring.nix index ce565a6..65442d2 100644 --- a/machines/thorite/monitoring.nix +++ b/machines/thorite/monitoring.nix @@ -1,5 +1,19 @@ -{ config, my-lib, ... }: +{ + config, + lib, + my-lib, + ... +}: with my-lib; +let + inherit (my-lib.settings) + minifluxUrl + gotosocialUrl + hedgedocDomain + forgejoDomain + ; + removeHttps = s: lib.removePrefix "https://" s; +in { config = { sops = { @@ -73,16 +87,24 @@ with my-lib; { inherit passwordFile; name = "gotosocial"; - address = "gts.xiny.li"; + address = removeHttps gotosocialUrl; } { inherit passwordFile; name = "miniflux"; - address = "rss.xiny.li"; + address = removeHttps minifluxUrl; + } + { + name = "hedgedoc"; + address = hedgedocDomain; + } + { + name = "forgejo"; + address = forgejoDomain; } { name = "ntfy"; - address = "ntfy.xiny.li"; + address = "ntfy.xinyang.life"; } { name = "grafana-eu"; @@ -109,11 +131,11 @@ with my-lib; ++ (mkBlackboxScrapes [ { hostAddress = "thorite.coho-tet.ts.net"; - targetAddresses = probeList ++ [ "49.13.13.122:22" ]; + targetAddresses = probeList ++ [ "49.13.13.122:443" ]; } { hostAddress = "massicot.coho-tet.ts.net"; - targetAddresses = probeList ++ [ "45.142.178.32:22" ]; + targetAddresses = probeList ++ [ "45.142.178.32:443" ]; } { hostAddress = "weilite.coho-tet.ts.net"; diff --git a/machines/thorite/restic.nix b/machines/thorite/restic.nix index ef21c66..d359304 100644 --- a/machines/thorite/restic.nix +++ b/machines/thorite/restic.nix @@ -36,7 +36,7 @@ in btrfsRoots = [ ]; }; - services.postgresqlBackup = { + services.postgresqlBackup = lib.mkIf config.services.postgresql.enable { enable = true; compression = "zstd"; compressionLevel = 9;