about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEmile <git@emile.space>2024-12-03 22:01:41 +0100
committerEmile <git@emile.space>2024-12-03 22:01:41 +0100
commit473abad6b754d53cc885668cef2059e5bf90dc0c (patch)
tree186e2550126761b71dac8ee75ed319cf729702a9
parent68116e7be505999ecc408c0d95ea4342045f2798 (diff)
(corrino) added goatcounter service
-rw-r--r--nix/hosts/corrino/ports.nix1
-rw-r--r--nix/hosts/corrino/www/stats.emile.space.nix22
2 files changed, 23 insertions, 0 deletions
diff --git a/nix/hosts/corrino/ports.nix b/nix/hosts/corrino/ports.nix
index b83b118..10ae593 100644
--- a/nix/hosts/corrino/ports.nix
+++ b/nix/hosts/corrino/ports.nix
@@ -23,6 +23,7 @@
     netbox = 8001;
     restic = 8002;
     nocodb = 8003;
+    goatcounter = 8004;
     r2wars-web = 8089;
     ctf = 8338;
     magic-hash = 8339;
diff --git a/nix/hosts/corrino/www/stats.emile.space.nix b/nix/hosts/corrino/www/stats.emile.space.nix
new file mode 100644
index 0000000..056c2ec
--- /dev/null
+++ b/nix/hosts/corrino/www/stats.emile.space.nix
@@ -0,0 +1,22 @@
+{ config, pkgs, ... }:
+
+{
+  services.nginx.virtualHosts."stats.emile.space" = {
+    forceSSL = true;
+    enableACME = true;
+    locations = {
+      "/" = {
+        proxyPass = "http://[::1]:${toString config.services.goatcounter.port}";
+      };
+    };
+  };
+
+  services.goatcounter = {
+    enable = true;
+    package = pkgs.goatcounter;
+
+    proxy = true;
+    address = "[::1]";
+    port = config.emile.ports.goatcounter;
+  };
+}