wynne: ntfy - setup metrics
This commit is contained in:
parent
9ec873c100
commit
d9bac706e3
2 changed files with 30 additions and 7 deletions
|
@ -30,6 +30,14 @@ in
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
scrapeConfigs = [
|
scrapeConfigs = [
|
||||||
|
{
|
||||||
|
job_name = "ntfy";
|
||||||
|
scheme = "https";
|
||||||
|
metrics_path = "/ntfy-metrics";
|
||||||
|
static_configs = [
|
||||||
|
{ targets = [ "wynne.labs.adtya.xyz" ]; }
|
||||||
|
];
|
||||||
|
}
|
||||||
{
|
{
|
||||||
job_name = "caddy";
|
job_name = "caddy";
|
||||||
scheme = "https";
|
scheme = "https";
|
||||||
|
|
|
@ -1,16 +1,24 @@
|
||||||
_:
|
{ lib, config, ... }:
|
||||||
let
|
let
|
||||||
inherit (import ../../../shared/caddy-helpers.nix) logFormat;
|
inherit (import ../../../shared/caddy-helpers.nix) logFormat;
|
||||||
domainName = "ntfy.acomputer.lol";
|
domainName = "ntfy.acomputer.lol";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
services = {
|
services = {
|
||||||
caddy.virtualHosts."${domainName}" = {
|
caddy.virtualHosts = {
|
||||||
|
"${domainName}" = {
|
||||||
logFormat = logFormat domainName;
|
logFormat = logFormat domainName;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
reverse_proxy 127.0.0.1:8080
|
reverse_proxy 127.0.0.1:8080
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
"${config.networking.hostName}.labs.adtya.xyz" = {
|
||||||
|
logFormat = logFormat domainName;
|
||||||
|
extraConfig = ''
|
||||||
|
reverse_proxy /ntfy-metrics 127.0.0.1:8081
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
frp.settings.proxies = [
|
frp.settings.proxies = [
|
||||||
{
|
{
|
||||||
|
@ -33,6 +41,7 @@ in
|
||||||
settings = {
|
settings = {
|
||||||
base-url = "https://${domainName}";
|
base-url = "https://${domainName}";
|
||||||
listen-http = "127.0.0.1:8080";
|
listen-http = "127.0.0.1:8080";
|
||||||
|
metrics-listen-http = "127.0.0.1:8081";
|
||||||
auth-file = "/mnt/data/ntfy-sh/user.db";
|
auth-file = "/mnt/data/ntfy-sh/user.db";
|
||||||
attachment-cache-dir = "/mnt/data/ntfy-sh/attachments";
|
attachment-cache-dir = "/mnt/data/ntfy-sh/attachments";
|
||||||
cache-file = "/mnt/data/ntfy-sh/cache-file.db";
|
cache-file = "/mnt/data/ntfy-sh/cache-file.db";
|
||||||
|
@ -42,5 +51,11 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
systemd.services.ntfy-sh.unitConfig.RequiresMountsFor = [ "/mnt/data" ];
|
systemd.services.ntfy-sh.unitConfig.RequiresMountsFor = [ "/mnt/data" ];
|
||||||
systemd.services.ntfy-sh.serviceConfig.WorkingDirectory = [ "/mnt/data/ntfy-sh" ];
|
systemd.services.ntfy-sh.serviceConfig.WorkingDirectory = "/mnt/data/ntfy-sh";
|
||||||
|
systemd.services.ntfy-sh.serviceConfig.User = "ntfy-sh";
|
||||||
|
systemd.services.ntfy-sh.serviceConfig.Group = "ntfy-sh";
|
||||||
|
systemd.services.ntfy-sh.serviceConfig.DynamicUser = lib.mkForce false;
|
||||||
|
users.users.ntfy-sh.home = "/mnt/data/ntfy-sh";
|
||||||
|
users.users.ntfy-sh.createHome = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue