From 5d8270ebfff8c1961ec476482bafbc9decc3c5f1 Mon Sep 17 00:00:00 2001 From: Rory& Date: Sun, 9 Jun 2024 12:28:09 +0200 Subject: Bunch of changes --- host/Rory-nginx/configuration.nix | 5 ++- host/Rory-nginx/services/matrix/conduit.nix | 48 +++++++++++++--------- host/Rory-nginx/services/matrix/synapse.nix | 2 +- .../Rory-nginx/services/nginx/rory.gay/conduit.nix | 4 ++ host/Rory-nginx/services/prometheus.nix | 8 ++++ 5 files changed, 45 insertions(+), 22 deletions(-) create mode 100644 host/Rory-nginx/services/prometheus.nix (limited to 'host') diff --git a/host/Rory-nginx/configuration.nix b/host/Rory-nginx/configuration.nix index edbcd6d..995e5f2 100755 --- a/host/Rory-nginx/configuration.nix +++ b/host/Rory-nginx/configuration.nix @@ -13,9 +13,10 @@ ./services/discordbots.nix ./services/matrix/root.nix ./services/nginx/nginx.nix - ./services/jitsi.nix + #./services/jitsi.nix ./services/cgit.nix - ./services/ollama.nix + #./services/ollama.nix + ./services/prometheus.nix ]; users.groups.ocp = {}; networking = { diff --git a/host/Rory-nginx/services/matrix/conduit.nix b/host/Rory-nginx/services/matrix/conduit.nix index 463c936..e425cc4 100755 --- a/host/Rory-nginx/services/matrix/conduit.nix +++ b/host/Rory-nginx/services/matrix/conduit.nix @@ -1,13 +1,22 @@ { config, pkgs, lib, conduit, ... }: { - services.matrix-conduit = { - package = conduit.packages.${pkgs.system}.default; + services.grapevine = { + #package = conduit.packages.${pkgs.system}.default; enable = true; - settings.global = { - address = "127.0.0.1"; + settings = { + conduit_compat = true; +# address = "127.0.0.1"; server_name = "conduit.rory.gay"; + listen = [ + { + type = "tcp"; + address = "127.0.0.1"; + port = 6167; + } + ]; + database_backend = "rocksdb"; # rocksdb_optimize_for_spinning_disks = false; # rocksdb_max_log_file_size = 33554432; @@ -46,24 +55,25 @@ allow_check_for_updates = false; allow_registration = false; -# log = "info,state_res=info"; + #log = "info"; + #log_format = "full"; #log = "debug"; }; }; - systemd.services.matrix-conduit-reg-token = { - description = "Random registration token for Conduit."; - before = ["conduit.service"]; # So the registration can be used by Conduit. - after = ["matrix-synapse-reg-token.service"]; - - script = '' - mkdir -p /run/systemd/system/conduit.service.d - echo Environment=\"CONDUIT_REGISTRATION_TOKEN=$(cat /var/lib/matrix-synapse/registration_shared_secret.txt)\" > /run/systemd/system/conduit.service.d/override.conf - systemctl daemon-reload''; - serviceConfig = { - User = "root"; - Group = "root"; - }; - }; +# systemd.services.matrix-conduit-reg-token = { +# description = "Random registration token for Conduit."; +# before = ["grapevine.service"]; # So the registration can be used by Conduit. +# after = ["matrix-synapse-reg-token.service"]; +# +# script = '' +# mkdir -p /run/systemd/system/conduit.service.d +# echo Environment=\"CONDUIT_REGISTRATION_TOKEN=$(cat /var/lib/matrix-synapse/registration_shared_secret.txt)\" > /run/systemd/system/grapevine.service.d/override.conf +# systemctl daemon-reload''; +# serviceConfig = { +# User = "root"; +# Group = "root"; +# }; +# }; } diff --git a/host/Rory-nginx/services/matrix/synapse.nix b/host/Rory-nginx/services/matrix/synapse.nix index 9e7c2a2..ce8a476 100755 --- a/host/Rory-nginx/services/matrix/synapse.nix +++ b/host/Rory-nginx/services/matrix/synapse.nix @@ -49,7 +49,7 @@ in global_factor = 50000.0; cache_entry_ttl = "24h"; expire_caches = true; - sync_response_cache_duration = "6h"; + sync_response_cache_duration = "15s"; #6h cache_autotuning = { max_cache_memory_usage = "65536M"; target_cache_memory_usage = "32768M"; diff --git a/host/Rory-nginx/services/nginx/rory.gay/conduit.nix b/host/Rory-nginx/services/nginx/rory.gay/conduit.nix index 32087c3..feaa77a 100755 --- a/host/Rory-nginx/services/nginx/rory.gay/conduit.nix +++ b/host/Rory-nginx/services/nginx/rory.gay/conduit.nix @@ -20,6 +20,10 @@ more_set_headers 'Content-Length: 0'; return 204; } + # We want to wait for 15 minutes here... + proxy_read_timeout 54000; + proxy_connect_timeout 54000; + proxy_send_timeout 54000; ''; }; #locations."/_synapse/client".proxyPass = "http://192.168.1.5:8008"; diff --git a/host/Rory-nginx/services/prometheus.nix b/host/Rory-nginx/services/prometheus.nix new file mode 100644 index 0000000..1a5d346 --- /dev/null +++ b/host/Rory-nginx/services/prometheus.nix @@ -0,0 +1,8 @@ +{ ... } : + +{ + services.prometheus = { + enable = true; + port = 9001; + }; +} -- cgit 1.4.1