From 0d366ed8e8c72cf6c2421ef7c285364ca648cf1a Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Fri, 20 Sep 2024 11:09:19 +0300 Subject: [PATCH] feat: add lothlorien matrix --- systems/hosts/proxy/haproxy.conf | 7 +++++++ systems/hosts/social/default.nix | 26 ++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/systems/hosts/proxy/haproxy.conf b/systems/hosts/proxy/haproxy.conf index c05eef7..50d15c1 100644 --- a/systems/hosts/proxy/haproxy.conf +++ b/systems/hosts/proxy/haproxy.conf @@ -37,6 +37,10 @@ frontend http-in use_backend be_liljamocom_webfinger if host_liljamocom liljamocom_webfinger use_backend be_liljamocom if host_liljamocom + acl host_lothloriensocial req.hdr(Host) lothlorien.social + acl lothlorien_social_matrix path_beg /_matrix + use_backend be_lothlorien_matrix if host_lothloriensocial lothlorien_social_matrix + acl host_alderaanfi req.hdr(Host) alderaan.fi acl alderaanfi_matrix path_beg /_matrix use_backend be_alderaan_matrix if host_alderaanfi alderaanfi_matrix @@ -91,6 +95,9 @@ backend be_akkoma backend be_akkomamedia server akkoma 10.1.2.17:4000 +backend be_lothlorien_matrix + server conduwuit 10.1.2.17:6167 + # liljamo.dev backend be_liljamodev server liljamodev 10.1.1.10:8110 diff --git a/systems/hosts/social/default.nix b/systems/hosts/social/default.nix index b4ebd76..e9fffd4 100644 --- a/systems/hosts/social/default.nix +++ b/systems/hosts/social/default.nix @@ -1,11 +1,14 @@ { config, + inputs, pkgs, ... }: let + domain = "lothlorien.social"; akkomaPort = 4000; + conduitPort = 6167; in { - networking.firewall.allowedTCPPorts = [akkomaPort]; + networking.firewall.allowedTCPPorts = [akkomaPort conduitPort]; services.postgresql = { package = pkgs.postgresql_16; @@ -45,11 +48,30 @@ in { "Pleroma.Web.Endpoint".http.ip = "0.0.0.0"; "Pleroma.Web.Endpoint".http.port = akkomaPort; - "Pleroma.Web.Endpoint".url.host = "lothlorien.social"; + "Pleroma.Web.Endpoint".url.host = domain; "Pleroma.Web.Endpoint".url.port = 443; }; }; }; + services.matrix-conduit = { + package = inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.conduwuit; + enable = true; + # https://github.com/girlbossceo/conduwuit/blob/main/conduwuit-example.toml + settings.global = { + address = "0.0.0.0"; + allow_check_for_updates = true; + allow_encryption = true; + allow_federation = true; + allow_registration = false; + database_backend = "rocksdb"; + max_request_size = 50000000; + new_user_displayname_suffix = ""; + port = conduitPort; + server_name = domain; + trusted_servers = ["matrix.org"]; + }; + }; + system.stateVersion = "24.05"; } -- 2.44.1