forked from pub-solar/infra
fix(matrix-synapse): make sure to find element in
list of config.services.matrix-synapse.settings.listeners that sets type = "metrics" instead of just using the first element in the list
This commit is contained in:
parent
62429bca08
commit
69b976607f
|
@ -55,7 +55,6 @@ in
|
||||||
compress = false;
|
compress = false;
|
||||||
names = [
|
names = [
|
||||||
"federation"
|
"federation"
|
||||||
"metrics"
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
@ -63,6 +62,20 @@ in
|
||||||
type = "http";
|
type = "http";
|
||||||
x_forwarded = true;
|
x_forwarded = true;
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
bind_addresses = [
|
||||||
|
"127.0.0.1"
|
||||||
|
];
|
||||||
|
port = 8012;
|
||||||
|
resources = [
|
||||||
|
{
|
||||||
|
names = [
|
||||||
|
"metrics"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
type = "metrics";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
account_threepid_delegates.msisdn = "";
|
account_threepid_delegates.msisdn = "";
|
||||||
|
|
|
@ -1,7 +1,14 @@
|
||||||
{ config, flake, lib, ... }:
|
{ config, flake, lib, ... }:
|
||||||
let
|
let
|
||||||
# Get port from first element in list of matrix-synapse listeners
|
# Find element in list config.services.matrix-synapse.settings.listeners
|
||||||
synapsePort = "${toString (lib.findFirst (listener: listener.port != null) "" config.services.matrix-synapse.settings.listeners).port}";
|
# that sets type = "metrics"
|
||||||
|
listenerWithMetrics = lib.findFirst
|
||||||
|
(listener:
|
||||||
|
listener.type == "metrics")
|
||||||
|
(throw "Found no matrix-synapse.settings.listeners.*.type containing string metrics")
|
||||||
|
config.services.matrix-synapse.settings.listeners
|
||||||
|
;
|
||||||
|
synapseMetricsPort = "${toString listenerWithMetrics.port}";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
age.secrets.nachtigall-metrics-nginx-basic-auth = {
|
age.secrets.nachtigall-metrics-nginx-basic-auth = {
|
||||||
|
@ -18,7 +25,7 @@ in
|
||||||
proxyPass = "http://127.0.0.1:${toString(config.services.prometheus.exporters.node.port)}";
|
proxyPass = "http://127.0.0.1:${toString(config.services.prometheus.exporters.node.port)}";
|
||||||
};
|
};
|
||||||
locations."/_synapse/metrics" = {
|
locations."/_synapse/metrics" = {
|
||||||
proxyPass = "http://127.0.0.1:${synapsePort}";
|
proxyPass = "http://127.0.0.1:${synapseMetricsPort}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue