undo
This commit is contained in:
parent
da3e1912aa
commit
c184fa321b
1 changed files with 1 additions and 48 deletions
|
|
@ -3,14 +3,12 @@
|
||||||
let
|
let
|
||||||
secretName = "grafanaSecret";
|
secretName = "grafanaSecret";
|
||||||
passwordName = "grafanaPassword";
|
passwordName = "grafanaPassword";
|
||||||
mailPasswordName = "mailPassword";
|
|
||||||
credentialDirectory = "/run/credentials/grafana.service/";
|
credentialDirectory = "/run/credentials/grafana.service/";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
systemd.services.grafana.serviceConfig.LoadCredential = [
|
systemd.services.grafana.serviceConfig.LoadCredential = [
|
||||||
"${secretName}:${config.age.secrets."grafanaSecret.age".path}"
|
"${secretName}:${config.age.secrets."grafanaSecret.age".path}"
|
||||||
"${passwordName}:${config.age.secrets."grafanaPassword.age".path}"
|
"${passwordName}:${config.age.secrets."grafanaPassword.age".path}"
|
||||||
"${mailPasswordName}:${config.age.secrets."smtpPassword.age".path}"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
services =
|
services =
|
||||||
|
|
@ -36,18 +34,9 @@ in
|
||||||
admin_password = "$__file{${credentialDirectory}${passwordName}}";
|
admin_password = "$__file{${credentialDirectory}${passwordName}}";
|
||||||
};
|
};
|
||||||
|
|
||||||
smtp = {
|
|
||||||
enabled = true;
|
|
||||||
host = "mail.henryhiles.com";
|
|
||||||
user = config.services.caddy.email;
|
|
||||||
password = "$__file{${credentialDirectory}${mailPasswordName}}";
|
|
||||||
from_address = "alerts@federated.nexus";
|
|
||||||
from_name = "Grafana Alerts";
|
|
||||||
};
|
|
||||||
|
|
||||||
"auth.anonymous".enabled = true;
|
"auth.anonymous".enabled = true;
|
||||||
users.default_theme = "system";
|
|
||||||
analytics.feedback_links_enabled = false;
|
analytics.feedback_links_enabled = false;
|
||||||
|
users.default_theme = "system";
|
||||||
dashboards.default_home_dashboard_path = toString (import ../../../lib/status.nix attrs);
|
dashboards.default_home_dashboard_path = toString (import ../../../lib/status.nix attrs);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -73,42 +62,6 @@ in
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
alerting = {
|
|
||||||
contactPoints = [
|
|
||||||
{
|
|
||||||
name = "Email";
|
|
||||||
receivers = [
|
|
||||||
{
|
|
||||||
type = "email";
|
|
||||||
uid = "email";
|
|
||||||
settings.addresses = config.services.grafana.settings.smtp.user;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
settings = {
|
|
||||||
policies = [
|
|
||||||
{
|
|
||||||
orgId = 1;
|
|
||||||
receiver = "grafana-default-email";
|
|
||||||
group_by = [ "..." ];
|
|
||||||
matchers = [
|
|
||||||
"alertname = Watchdog"
|
|
||||||
"severity =~ \"warning|critical\""
|
|
||||||
];
|
|
||||||
mute_time_intervals = [
|
|
||||||
"abc"
|
|
||||||
];
|
|
||||||
group_wait = "30s";
|
|
||||||
group_interval = "5m";
|
|
||||||
repeat_interval = "4h";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
caddy.virtualHosts."${domain}".extraConfig =
|
caddy.virtualHosts."${domain}".extraConfig =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue