add c10y o11y
This commit is contained in:
parent
3d47eb1552
commit
e97861a45a
5 changed files with 103 additions and 60 deletions
|
|
@ -14,10 +14,6 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
domain = "federated.nexus";
|
domain = "federated.nexus";
|
||||||
settings = {
|
settings = {
|
||||||
cache_capacity_modifier = 1.5;
|
|
||||||
db_cache_capacity_mb = 4096;
|
|
||||||
allow_sticky_events = true;
|
|
||||||
|
|
||||||
admins_list = [
|
admins_list = [
|
||||||
"@nexusbot:federated.nexus"
|
"@nexusbot:federated.nexus"
|
||||||
"@quadradical:federated.nexus"
|
"@quadradical:federated.nexus"
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,10 @@ in
|
||||||
{
|
{
|
||||||
grafana = {
|
grafana = {
|
||||||
enable = true;
|
enable = true;
|
||||||
declarativePlugins = [ ];
|
declarativePlugins = with pkgs.grafanaPlugins; [
|
||||||
|
prometheus
|
||||||
|
];
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
server = {
|
server = {
|
||||||
inherit domain;
|
inherit domain;
|
||||||
|
|
@ -183,6 +186,14 @@ in
|
||||||
hash = "sha256-6bM0mqm1nF7xadc0ojNWIxJXCHio5db97NjENHIpwdI=";
|
hash = "sha256-6bM0mqm1nF7xadc0ojNWIxJXCHio5db97NjENHIpwdI=";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
name = "Continuwuity Stats";
|
||||||
|
options.path = pkgs.fetchurl {
|
||||||
|
name = "continuwuity-stats.json";
|
||||||
|
url = "https://continuwuity.org/guides/grafana-dashboard.json";
|
||||||
|
hash = "sha256-1s7vFEaZMiqH9h//BdrBwtWuYiqlxzUmYwdpMPYyuMo=";
|
||||||
|
};
|
||||||
|
}
|
||||||
{
|
{
|
||||||
name = "Caddy Hosts";
|
name = "Caddy Hosts";
|
||||||
options.path = pkgs.stdenv.mkDerivation {
|
options.path = pkgs.stdenv.mkDerivation {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
{
|
{
|
||||||
|
systemd.services.prometheus.serviceConfig.SupplementaryGroups = [
|
||||||
|
config.services.matrix-continuwuity.group
|
||||||
|
];
|
||||||
|
|
||||||
services.prometheus = {
|
services.prometheus = {
|
||||||
enable = true;
|
enable = true;
|
||||||
listenAddress = "127.0.0.7";
|
listenAddress = "127.0.0.7";
|
||||||
|
|
@ -32,6 +36,19 @@
|
||||||
{ targets = [ "localhost:2019" ]; }
|
{ targets = [ "localhost:2019" ]; }
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
job_name = "continuwuity";
|
||||||
|
metrics_path = "/_continuwuity/metrics";
|
||||||
|
static_configs = [
|
||||||
|
{ targets = [ "localhost" ]; }
|
||||||
|
];
|
||||||
|
relabel_configs = [
|
||||||
|
{
|
||||||
|
target_label = "__unix_socket__";
|
||||||
|
replacement = config.services.matrix-continuwuity.settings.global.unix_socket_path;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
exporters = {
|
exporters = {
|
||||||
|
|
|
||||||
8
flake.lock
generated
8
flake.lock
generated
|
|
@ -163,11 +163,11 @@
|
||||||
"treefmt-nix": "treefmt-nix"
|
"treefmt-nix": "treefmt-nix"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1791595419,
|
"lastModified": 1791801165,
|
||||||
"narHash": "sha256-RS5WNLNGkVHvGu6yHj6iPyV8kctqkddJYh/QqltcZ94=",
|
"narHash": "sha256-jyUFvwEP82yuuhfZ13ei9Syq62PC9fqlKFarHpQU2X8=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "3af5302dd8764d8521db2030a010a80e6ea60664",
|
"rev": "7da0ef6e2b3349b7c83b006a67b5854466dbf910",
|
||||||
"revCount": 7917,
|
"revCount": 7945,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://forgejo.ellis.link/continuwuation/continuwuity"
|
"url": "https://forgejo.ellis.link/continuwuation/continuwuity"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -18,56 +18,75 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config.services =
|
config = {
|
||||||
let
|
systemd.services.caddy.serviceConfig.SupplementaryGroups = [
|
||||||
subdomain = "matrix.${config.quad.matrix.domain}";
|
config.services.matrix-continuwuity.group
|
||||||
socket = "/var/run/continuwuity/continuwuity.sock";
|
];
|
||||||
in
|
|
||||||
{
|
|
||||||
matrix-continuwuity = {
|
|
||||||
enable = config.quad.matrix.enable;
|
|
||||||
package = inputs.continuwuity.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
|
||||||
group = "caddy";
|
|
||||||
settings.global = lib.recursiveUpdate {
|
|
||||||
server_name = config.quad.matrix.domain;
|
|
||||||
unix_socket_path = socket;
|
|
||||||
|
|
||||||
new_user_displayname_suffix = "";
|
services =
|
||||||
|
let
|
||||||
|
subdomain = "matrix.${config.quad.matrix.domain}";
|
||||||
|
socket = "/var/run/continuwuity/continuwuity.sock";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
matrix-continuwuity = {
|
||||||
|
enable = config.quad.matrix.enable;
|
||||||
|
package = inputs.continuwuity.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
||||||
|
settings.global = lib.recursiveUpdate {
|
||||||
|
server_name = config.quad.matrix.domain;
|
||||||
|
unix_socket_path = socket;
|
||||||
|
|
||||||
forbidden_remote_server_names = [ ];
|
new_user_displayname_suffix = "";
|
||||||
ignore_messages_from_server_names = [ ];
|
|
||||||
|
|
||||||
trusted_servers = [
|
forbidden_remote_server_names = [ ];
|
||||||
"starstruck.systems"
|
ignore_messages_from_server_names = [ ];
|
||||||
"maunium.net"
|
|
||||||
"unredacted.org"
|
|
||||||
"matrix.org"
|
|
||||||
];
|
|
||||||
|
|
||||||
startup_netburst = false;
|
trusted_servers = [
|
||||||
admins_from_room = false;
|
"starstruck.systems"
|
||||||
|
"maunium.net"
|
||||||
|
"unredacted.org"
|
||||||
|
"matrix.org"
|
||||||
|
];
|
||||||
|
|
||||||
url_preview_domain_explicit_allowlist = [ "*" ];
|
startup_netburst = false;
|
||||||
url_preview_max_spider_size = 2097152;
|
admins_from_room = false;
|
||||||
|
|
||||||
max_request_size = 256000000;
|
url_preview_domain_explicit_allowlist = [ "*" ];
|
||||||
|
url_preview_max_spider_size = 2097152;
|
||||||
|
|
||||||
dns_cache_entries = 0;
|
cache_capacity_modifier = 1.5;
|
||||||
|
db_cache_capacity_mb = 4096;
|
||||||
|
allow_sticky_events = true;
|
||||||
|
|
||||||
allow_public_room_directory_over_federation = true;
|
allow_prometheus_metrics = true;
|
||||||
lockdown_public_room_directory = true;
|
|
||||||
|
|
||||||
allow_incoming_presence = false;
|
max_request_size = 256000000;
|
||||||
allow_outgoing_presence = false;
|
|
||||||
allow_local_presence = false;
|
|
||||||
|
|
||||||
well_known = {
|
dns_cache_entries = 0;
|
||||||
client = "https://${subdomain}";
|
|
||||||
server = "${subdomain}:443";
|
allow_public_room_directory_over_federation = true;
|
||||||
};
|
lockdown_public_room_directory = true;
|
||||||
} config.quad.matrix.settings;
|
|
||||||
|
allow_incoming_presence = false;
|
||||||
|
allow_outgoing_presence = false;
|
||||||
|
allow_local_presence = false;
|
||||||
|
|
||||||
|
well_known = {
|
||||||
|
client = "https://${subdomain}";
|
||||||
|
server = "${subdomain}:443";
|
||||||
|
};
|
||||||
|
} config.quad.matrix.settings;
|
||||||
|
};
|
||||||
|
|
||||||
|
caddy.virtualHosts."${subdomain}".extraConfig = ''
|
||||||
|
handle /_continuwuity/metrics {
|
||||||
|
respond 404
|
||||||
|
}
|
||||||
|
|
||||||
|
handle {
|
||||||
|
reverse_proxy unix/${socket}
|
||||||
|
}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
};
|
||||||
caddy.virtualHosts."${subdomain}".extraConfig = "reverse_proxy unix/${socket}";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue