mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 18:41:34 +01:00
caddy: Rename option metrics.port to metricsPort
This commit is contained in:
parent
2b4a8ddb51
commit
9f4b5b73ed
2 changed files with 5 additions and 5 deletions
|
|
@ -134,7 +134,7 @@ in
|
||||||
text = ''
|
text = ''
|
||||||
prometheus.scrape "caddy" {
|
prometheus.scrape "caddy" {
|
||||||
targets = [{
|
targets = [{
|
||||||
__address__ = "localhost:${builtins.toString config.custom.services.caddy.metrics.port}",
|
__address__ = "localhost:${builtins.toString config.custom.services.caddy.metricsPort}",
|
||||||
job = "caddy",
|
job = "caddy",
|
||||||
instance = constants.hostname,
|
instance = constants.hostname,
|
||||||
}]
|
}]
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ in
|
||||||
enable = lib.mkEnableOption "" // {
|
enable = lib.mkEnableOption "" // {
|
||||||
default = virtualHosts != { };
|
default = virtualHosts != { };
|
||||||
};
|
};
|
||||||
metrics.port = lib.mkOption {
|
metricsPort = lib.mkOption {
|
||||||
type = lib.types.port;
|
type = lib.types.port;
|
||||||
default = 49514;
|
default = 49514;
|
||||||
};
|
};
|
||||||
|
|
@ -66,7 +66,7 @@ in
|
||||||
config = lib.mkIf (virtualHosts != [ ]) (
|
config = lib.mkIf (virtualHosts != [ ]) (
|
||||||
lib.mkMerge [
|
lib.mkMerge [
|
||||||
{
|
{
|
||||||
meta.ports.tcp.list = [ cfg.metrics.port ];
|
meta.ports.tcp.list = [ cfg.metricsPort ];
|
||||||
|
|
||||||
services.caddy = {
|
services.caddy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -82,7 +82,7 @@ in
|
||||||
admin off
|
admin off
|
||||||
metrics { per_host }
|
metrics { per_host }
|
||||||
'';
|
'';
|
||||||
virtualHosts.":${builtins.toString cfg.metrics.port}" = {
|
virtualHosts.":${builtins.toString cfg.metricsPort}" = {
|
||||||
logFormat = "";
|
logFormat = "";
|
||||||
extraConfig = "metrics /metrics";
|
extraConfig = "metrics /metrics";
|
||||||
};
|
};
|
||||||
|
|
@ -171,8 +171,8 @@ in
|
||||||
value = {
|
value = {
|
||||||
logFormat = "output file ${config.services.caddy.logDir}/${value.domain}.log { mode 640 }";
|
logFormat = "output file ${config.services.caddy.logDir}/${value.domain}.log { mode 640 }";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
bind tailscale/${getSubdomain value.domain}
|
|
||||||
encode
|
encode
|
||||||
|
bind tailscale/${getSubdomain value.domain}
|
||||||
reverse_proxy localhost:${builtins.toString value.port} ${
|
reverse_proxy localhost:${builtins.toString value.port} ${
|
||||||
lib.optionalString (value.extraReverseProxyConfig != "") "{ ${value.extraReverseProxyConfig} }"
|
lib.optionalString (value.extraReverseProxyConfig != "") "{ ${value.extraReverseProxyConfig} }"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue