Completed the part with caddy. Problems with exporterr and api keys

This commit is contained in:
pazpi 2024-09-10 19:51:27 +02:00
parent 58d5c8a812
commit 4e649d4344
6 changed files with 147 additions and 20 deletions

View file

@ -4,25 +4,45 @@
lib,
...
}:
let
tailscaleMagicDNS = "neon-dory.ts.net";
in
{
age.secrets = {
tailscale-authKey.file = ../../secrets/tailscale-authKey.age;
cloudflare-tegola-apiKey = {
file = ../../secrets/cloudflare-tegola-apiKey.age;
mode = "440";
owner = config.services.caddy.user;
group = config.services.caddy.group;
};
};
my = {
utils.commons.enable = true;
networking.tailscale = {
enable = true;
exitNode = "vps";
authKeyFile = config.age.secrets.tailscale-authKey.path;
services.media-mgr = {
exportMetrics.enable = true;
proxy = {
enable = true;
domain = "tegola.pro";
host = "arr.internal";
};
};
monitoring = {
prometheus = {
enable = true;
proxy = {
domain = "tegola.pro";
host = "metrics.internal";
};
};
};
networking = {
tailscale = {
enable = true;
magicDNSDomain = tailscaleMagicDNS;
authKeyFile = config.age.secrets.tailscale-authKey.path;
};
caddy.enable = true;
};
virtualisation = {
@ -38,11 +58,24 @@
services = {
openssh.enable = true;
prometheus = {
enable = true;
};
prometheus.scrapeConfigs = [
{
job_name = "metrics-host";
static_configs = [
{ targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ]; }
];
}
];
prometheus.exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" ];
};
};
};
networking.nameservers = [ "192.168.1.2" ];
system.stateVersion = "24.05";
}