uptime-kuma: simplified service
This commit is contained in:
parent
46d50954f7
commit
a269868d74
2 changed files with 7 additions and 27 deletions
|
@ -38,14 +38,13 @@
|
||||||
disks = {
|
disks = {
|
||||||
disk = "/dev/sda";
|
disk = "/dev/sda";
|
||||||
pools.rpool.datasets = {
|
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/forgejo" = { mountpoint = "/srv/forgejo"; extra.options.quota = "5G"; };
|
||||||
"safe/svcs/hedgedoc" = { mountpoint = "/srv/hedgedoc"; 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/nextcloud" = { mountpoint = "/srv/nextcloud"; extra.options.quota = "5G"; };
|
||||||
"safe/svcs/stalwart" = { mountpoint = "/srv/stalwart"; 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/synapse" = { mountpoint = "/srv/synapse"; extra.options.quota = "5G"; };
|
||||||
"safe/svcs/wger" = { mountpoint = "/srv/wger"; 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"; };
|
"safe/svcs/postgresql" = { mountpoint = "/srv/postgresql"; extra.options.quota = "5G"; };
|
||||||
"backup/postgresql" = { mountpoint = "/media/backup/postgresqlbackup"; extra.options.quota = "5G"; };
|
"backup/postgresql" = { mountpoint = "/media/backup/postgresqlbackup"; extra.options.quota = "5G"; };
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,17 +2,11 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
svc_domain = "uptime-kuma.${config.mine.shared.settings.domain}";
|
svc_domain = "uptime-kuma.${config.mine.shared.settings.domain}";
|
||||||
|
|
||||||
stateDir = config.mine.zfsMounts."rpool/safe/svcs/uptime-kuma";
|
|
||||||
in {
|
in {
|
||||||
services.uptime-kuma = {
|
services.uptime-kuma = {
|
||||||
enable = true;
|
enable = true;
|
||||||
appriseSupport = true;
|
appriseSupport = true;
|
||||||
|
|
||||||
settings = {
|
|
||||||
DATA_DIR = lib.mkForce stateDir;
|
|
||||||
};
|
|
||||||
|
|
||||||
package = pkgs.uptime-kuma.overrideAttrs (old: rec {
|
package = pkgs.uptime-kuma.overrideAttrs (old: rec {
|
||||||
pname = "uptime-kuma";
|
pname = "uptime-kuma";
|
||||||
version = "2.0.0-dev";
|
version = "2.0.0-dev";
|
||||||
|
@ -47,21 +41,10 @@ in {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
# setup state dir
|
# setup persistence
|
||||||
systemd.services.uptime-kuma.serviceConfig = {
|
environment.persistence.root.directories = [
|
||||||
ExecStartPre = [
|
{ directory = "/var/lib/private/uptime-kuma"; mode = "0700"; }
|
||||||
"+${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 ldap user for email
|
# setup ldap user for email
|
||||||
|
@ -81,8 +64,8 @@ in {
|
||||||
|
|
||||||
mine.shared.meta.uptime-kuma = {
|
mine.shared.meta.uptime-kuma = {
|
||||||
name = "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.'';
|
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 = svc_domain;
|
url = "https://${svc_domain}";
|
||||||
|
|
||||||
package = let
|
package = let
|
||||||
pkg = config.services.uptime-kuma.package;
|
pkg = config.services.uptime-kuma.package;
|
||||||
|
@ -92,6 +75,4 @@ in {
|
||||||
meta = pkg.meta;
|
meta = pkg.meta;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue