mirror of
https://github.com/nmasur/dotfiles
synced 2025-04-24 16:12:25 +00:00
Compare commits
2 Commits
60e779085e
...
d85e4b1593
Author | SHA1 | Date | |
---|---|---|---|
|
d85e4b1593 | ||
|
6ea99eca5d |
@ -30,6 +30,7 @@
|
|||||||
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"; };
|
||||||
@ -47,6 +48,8 @@
|
|||||||
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" ];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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.blocks = [{
|
caddy.routes = [{
|
||||||
match = [{ not = [{ remote_ip.ranges = cloudflareIpRanges; }]; }];
|
match = [{ not = [{ remote_ip.ranges = cloudflareIpRanges; }]; }];
|
||||||
handle = [{
|
handle = [{
|
||||||
handler = "static_response";
|
handler = "static_response";
|
||||||
abort = true;
|
status_code = "403";
|
||||||
}];
|
}];
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
@ -5,13 +5,25 @@
|
|||||||
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 ]; }];
|
{
|
||||||
handle = [{
|
match = [{
|
||||||
handler = "reverse_proxy";
|
host = [ config.hostnames.stream ];
|
||||||
upstreams = [{ dial = "localhost:8096"; }];
|
path = [ "/metrics*" ];
|
||||||
}];
|
}];
|
||||||
}];
|
handle = [{
|
||||||
|
handler = "static_response";
|
||||||
|
status_code = "403";
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
match = [{ host = [ config.hostnames.stream ]; }];
|
||||||
|
handle = [{
|
||||||
|
handler = "reverse_proxy";
|
||||||
|
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 = [
|
||||||
@ -35,6 +47,9 @@
|
|||||||
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" ];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,8 @@
|
|||||||
|
|
||||||
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 = [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user