Compare commits

..

No commits in common. "d85e4b1593ed562bea891c67682bb2536bb8c04f" and "60e779085e760688e0af675587a8733dd0a767cb" have entirely different histories.

4 changed files with 9 additions and 29 deletions

View File

@ -30,7 +30,6 @@
errors.routes = config.caddy.blocks; errors.routes = config.caddy.blocks;
# logs = { }; # Uncomment to collect access logs # logs = { }; # Uncomment to collect access logs
}; };
apps.http.servers.metrics = { }; # Enables Prometheus metrics
apps.tls.automation.policies = config.caddy.tlsPolicies; apps.tls.automation.policies = config.caddy.tlsPolicies;
logging.logs.main = { logging.logs.main = {
encoder = { format = "console"; }; encoder = { format = "console"; };
@ -48,8 +47,6 @@
networking.firewall.allowedTCPPorts = [ 80 443 ]; networking.firewall.allowedTCPPorts = [ 80 443 ];
networking.firewall.allowedUDPPorts = [ 443 ]; networking.firewall.allowedUDPPorts = [ 443 ];
prometheus.scrapeTargets = [ "127.0.0.1:2019" ];
}; };
} }

View File

@ -41,11 +41,11 @@ in {
config = lib.mkIf config.cloudflare.enable { config = lib.mkIf config.cloudflare.enable {
# Forces Caddy to error if coming from a non-Cloudflare IP # Forces Caddy to error if coming from a non-Cloudflare IP
caddy.routes = [{ caddy.blocks = [{
match = [{ not = [{ remote_ip.ranges = cloudflareIpRanges; }]; }]; match = [{ not = [{ remote_ip.ranges = cloudflareIpRanges; }]; }];
handle = [{ handle = [{
handler = "static_response"; handler = "static_response";
status_code = "403"; abort = true;
}]; }];
}]; }];

View File

@ -5,25 +5,13 @@
services.jellyfin.group = "media"; services.jellyfin.group = "media";
users.users.jellyfin = { isSystemUser = true; }; users.users.jellyfin = { isSystemUser = true; };
caddy.routes = [ caddy.routes = [{
{
match = [{
host = [ config.hostnames.stream ];
path = [ "/metrics*" ];
}];
handle = [{
handler = "static_response";
status_code = "403";
}];
}
{
match = [{ host = [ config.hostnames.stream ]; }]; match = [{ host = [ config.hostnames.stream ]; }];
handle = [{ handle = [{
handler = "reverse_proxy"; handler = "reverse_proxy";
upstreams = [{ dial = "localhost:8096"; }]; upstreams = [{ dial = "localhost:8096"; }];
}]; }];
} }];
];
# Create videos directory, allow anyone in Jellyfin group to manage it # Create videos directory, allow anyone in Jellyfin group to manage it
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
@ -47,9 +35,6 @@
users.users.jellyfin.extraGroups = users.users.jellyfin.extraGroups =
[ "render" "video" ]; # Access to /dev/dri [ "render" "video" ]; # Access to /dev/dri
# Requires MetricsEnable is true in /var/lib/jellyfin/config/system.xml
prometheus.scrapeTargets = [ "127.0.0.1:8096" ];
}; };
} }

View File

@ -38,8 +38,6 @@
services.prometheus = { services.prometheus = {
exporters.node.enable = config.prometheus.exporters.enable; exporters.node.enable = config.prometheus.exporters.enable;
exporters.node.enabledCollectors = [ ];
exporters.node.disabledCollectors = [ "cpufreq" ];
exporters.systemd.enable = config.prometheus.exporters.enable; exporters.systemd.enable = config.prometheus.exporters.enable;
exporters.process.enable = config.prometheus.exporters.enable; exporters.process.enable = config.prometheus.exporters.enable;
exporters.process.settings.process_names = [ exporters.process.settings.process_names = [