From 7528722942b6bd8f3425e71c5604e1f96d9cf7f5 Mon Sep 17 00:00:00 2001 From: Crony Akatsuki Date: Sat, 10 May 2025 20:14:39 +0200 Subject: [PATCH] feat(thor): add plausible, analytics. --- modules/servers/thor/default.nix | 1 + modules/servers/thor/plausible.nix | 26 ++++++++++++++++++++++++++ modules/servers/thor/secrets.nix | 3 +++ secrets/plausible.age | Bin 0 -> 827 bytes secrets/secrets.nix | 1 + 5 files changed, 31 insertions(+) create mode 100644 modules/servers/thor/plausible.nix create mode 100644 secrets/plausible.age diff --git a/modules/servers/thor/default.nix b/modules/servers/thor/default.nix index abd108d..55a635f 100644 --- a/modules/servers/thor/default.nix +++ b/modules/servers/thor/default.nix @@ -3,5 +3,6 @@ ./changedetection-io.nix ./forgejo.nix ./secrets.nix + ./plausible.nix ]; } diff --git a/modules/servers/thor/plausible.nix b/modules/servers/thor/plausible.nix new file mode 100644 index 0000000..616a7ab --- /dev/null +++ b/modules/servers/thor/plausible.nix @@ -0,0 +1,26 @@ +{config, ...}: { + services.plausible = { + enable = true; + server = { + baseUrl = "https://plausible.cronyakatsuki.xyz"; + secretKeybaseFile = "${config.age.secrets.plausible.path}"; + }; + }; + + services.traefik.dynamicConfigOptions.http = { + services.plausible.loadBalancer.servers = [ + { + url = "http://localhost:8000"; + } + ]; + + routers.plausible = { + rule = "Host(`plausible.cronyakatsuki.xyz`)"; + tls = { + certResolver = "porkbun"; + }; + service = "plausible"; + entrypoints = "websecure"; + }; + }; +} diff --git a/modules/servers/thor/secrets.nix b/modules/servers/thor/secrets.nix index 60e4651..9db06d3 100644 --- a/modules/servers/thor/secrets.nix +++ b/modules/servers/thor/secrets.nix @@ -4,6 +4,9 @@ forgejo-db = { file = ../../../secrets/forgejo-db.age; }; + plausible = { + file = ../../../secrets/plausible.age; + }; }; }; } diff --git a/secrets/plausible.age b/secrets/plausible.age new file mode 100644 index 0000000000000000000000000000000000000000..eee1c05e2779984a3131d6ee55d0079031cd59d5 GIT binary patch literal 827 zcmYdHPt{G$OD?J`D9Oyv)5|YP*Do{V(zR14F3!+RO))YxHMCSP3NXp@E?4j{H!r9N z4JmUg*Dm(-u5z!+swg(M$VkjDsSFPej0kl0P4x}PDljvuNaw2X_b_xacgid+)lTs? zvM38lwX`g7P0PuyuypeX3=44#HF0(=tV;FG@-NPWj%_%+8-4Wfk9DRS6a7TrZl(M|cT%S^}?Bd`MlSH2ge@mmt zeC#3bJX0;rk}5*Ot2{$pBYlI7O2TsV zt31<;f+Nvw^Dj3DaW7YhD2epfHtWr(9t9-)6v_fDA9te#P`{`!*EnMu=^S><&H&D-};VyDo42L8vQ qH#_4j+LM1R7L9evUo)$|^#7Ek#>(d||D_5aZ|=R+^5u6;mInYswi_$} literal 0 HcmV?d00001 diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 4b30ac4..51f4a65 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -20,4 +20,5 @@ in { "rclone.age".publicKeys = systems ++ users; "navidrome.age".publicKeys = systems ++ users; "forgejo-db.age".publicKeys = systems ++ users; + "plausible.age".publicKeys = systems ++ users; }