feat(koi): made umami a proper service

This commit is contained in:
alina 🌸 2024-11-16 01:28:16 +03:00
parent 52e5d6cdeb
commit fb28e9e133
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
3 changed files with 46 additions and 4 deletions

View file

@ -1,14 +1,56 @@
{ ... }: { abs, config, ... }:
{ let
# todo - move this from an ad-hoc docker compose to a proper service secrets = import (abs "lib/secrets.nix");
UID = 1116;
in {
# todo 2: update UMAMI_HOST in teisu-env # todo 2: update UMAMI_HOST in teisu-env
imports = [
(secrets.declare [
{
name = "umami-env";
owner = "umami";
}
])
];
users.users.umami = {
isNormalUser = true;
uid = UID;
};
services.postgresql.ensureUsers = [
{ name = "umami"; ensureDBOwnership = true; }
];
services.postgresql.ensureDatabases = [ "umami" ];
desu.postgresql.ensurePasswords.umami = "umami";
systemd.services.docker-umami.after = [ "postgresql.service" ];
virtualisation.oci-containers.containers.umami = {
image = "ghcr.io/umami-software/umami:postgresql-v2.13.2";
environment = {
DATABASE_TYPE = "postgresql";
DATABASE_URL = "postgresql://umami:umami@172.17.0.1:5432/umami";
DISABLE_TELEMETRY = "1";
DISABLE_UPDATES = "1";
};
environmentFiles = [
(secrets.file config "umami-env")
];
user = "${builtins.toString UID}";
};
services.nginx.virtualHosts."zond.tei.su" = { services.nginx.virtualHosts."zond.tei.su" = {
forceSSL = true; forceSSL = true;
useACMEHost = "tei.su"; useACMEHost = "tei.su";
locations."/" = { locations."/" = {
proxyPass = "http://umami.umami.docker:3000$request_uri"; proxyPass = "http://umami.docker:3000$request_uri";
}; };
}; };
} }

Binary file not shown.

BIN
secrets/umami-env.age Normal file

Binary file not shown.