From 979f6c87396de24ba44cba7571330a55b683a33d Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Fri, 27 Sep 2024 14:35:52 +0300 Subject: [PATCH] feat(systems/hosts/oci): umami --- systems/hosts/oci/default.nix | 1 + systems/hosts/oci/umami.nix | 36 ++++++++++++++++++++++++++++++++ systems/hosts/proxy/haproxy.conf | 2 +- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 systems/hosts/oci/umami.nix diff --git a/systems/hosts/oci/default.nix b/systems/hosts/oci/default.nix index cc5522d..4b0791d 100644 --- a/systems/hosts/oci/default.nix +++ b/systems/hosts/oci/default.nix @@ -3,6 +3,7 @@ registryUIPort = 5080; in { imports = [ + ./umami.nix ./websites.nix ]; diff --git a/systems/hosts/oci/umami.nix b/systems/hosts/oci/umami.nix new file mode 100644 index 0000000..a4a3ba2 --- /dev/null +++ b/systems/hosts/oci/umami.nix @@ -0,0 +1,36 @@ +{pkgs, ...}: let + umamiPort = 3000; +in { + networking.firewall.allowedTCPPorts = [ + umamiPort + ]; + + services.postgresql = { + package = pkgs.postgresql_16; + enable = true; + enableTCPIP = true; + authentication = "host umami umami 127.0.0.1/32 trust"; + ensureDatabases = ["umami"]; + ensureUsers = [ + { + name = "umami"; + ensureDBOwnership = true; + } + ]; + }; + + virtualisation.oci-containers.containers."umami" = { + image = "ghcr.io/umami-software/umami:postgresql-v2.13.2"; + extraOptions = [ + "--network=host" + ]; + hostname = "umami"; + environment = { + PORT = toString umamiPort; + DATABASE_TYPE = "postgresql"; + DATABASE_URL = "postgresql://umami:umami@127.0.0.1:5432/umami"; + DISABLE_TELEMETRY = "1"; + PRIVATE_MODE = "1"; + }; + }; +} diff --git a/systems/hosts/proxy/haproxy.conf b/systems/hosts/proxy/haproxy.conf index ee15de8..8b4b349 100644 --- a/systems/hosts/proxy/haproxy.conf +++ b/systems/hosts/proxy/haproxy.conf @@ -102,4 +102,4 @@ backend be_registry server registry 10.1.1.10:5000 backend be_umami - server umami 10.1.1.10:8700 + server umami 10.1.2.9:3000 -- 2.44.1