uptime-kuma: simplified service

This commit is contained in:
eyjhb 2025-02-27 22:37:09 +01:00
parent 46d50954f7
commit a269868d74
Signed by: eyjhb
GPG key ID: 609F508E3239F920
2 changed files with 7 additions and 27 deletions

View file

@ -38,14 +38,13 @@
disks = {
disk = "/dev/sda";
pools.rpool.datasets = {
# zfs create -o quota=1G rpool/safe/svcs/uptime-kuma
# zfs create -o quota=1G rpool/safe/svcs/service-name
"safe/svcs/forgejo" = { mountpoint = "/srv/forgejo"; extra.options.quota = "5G"; };
"safe/svcs/hedgedoc" = { mountpoint = "/srv/hedgedoc"; extra.options.quota = "5G"; };
"safe/svcs/nextcloud" = { mountpoint = "/srv/nextcloud"; extra.options.quota = "5G"; };
"safe/svcs/stalwart" = { mountpoint = "/srv/stalwart"; extra.options.quota = "5G"; };
"safe/svcs/synapse" = { mountpoint = "/srv/synapse"; extra.options.quota = "5G"; };
"safe/svcs/wger" = { mountpoint = "/srv/wger"; extra.options.quota = "5G"; };
"safe/svcs/uptime-kuma" = { mountpoint = "/srv/uptime-kuma"; extra.options.quota = "1G"; };
"safe/svcs/postgresql" = { mountpoint = "/srv/postgresql"; extra.options.quota = "5G"; };
"backup/postgresql" = { mountpoint = "/media/backup/postgresqlbackup"; extra.options.quota = "5G"; };
};

View file

@ -2,17 +2,11 @@
let
svc_domain = "uptime-kuma.${config.mine.shared.settings.domain}";
stateDir = config.mine.zfsMounts."rpool/safe/svcs/uptime-kuma";
in {
services.uptime-kuma = {
enable = true;
appriseSupport = true;
settings = {
DATA_DIR = lib.mkForce stateDir;
};
package = pkgs.uptime-kuma.overrideAttrs (old: rec {
pname = "uptime-kuma";
version = "2.0.0-dev";
@ -47,21 +41,10 @@ in {
});
};
# setup state dir
systemd.services.uptime-kuma.serviceConfig = {
ExecStartPre = [
"+${pkgs.coreutils}/bin/chown %u:%g -R ${stateDir}"
"+${pkgs.coreutils}/bin/chmod 777 -R ${stateDir}"
];
ReadWritePaths = [ stateDir ];
BindPaths = [ stateDir ];
};
# TODO: Could maybe use this instead?
# environment.persistence.root.directories = [
# { directory = "/var/lib/private/lldap"; mode = "0700"; }
# ];
# setup persistence
environment.persistence.root.directories = [
{ directory = "/var/lib/private/uptime-kuma"; mode = "0700"; }
];
# setup ldap user for email
@ -81,8 +64,8 @@ in {
mine.shared.meta.uptime-kuma = {
name = "Uptime Kuma";
description = ''Fancy self-hosted monitoring tool, which supports VARIOUS methods of monitoring, as well as getting notifications. Multiple users is not officially support, so reach out to admins, and they will create a user for you. Abuse will NOT be tolerated.'';
url = svc_domain;
description = ''Fancy self-hosted monitoring tool, which supports VARIOUS methods of monitoring, as well as getting notifications. Multiple users is not officially support, so reach out to admins, and they will create a user for you. Abuse will NOT be tolerated. We have a SMTP account associated with Uptime Kuma, ask for details on how to use this (you're also allowed to to your own member email).'';
url = "https://${svc_domain}";
package = let
pkg = config.services.uptime-kuma.package;
@ -92,6 +75,4 @@ in {
meta = pkg.meta;
};
};
}