From fc56e5ff3e9aae08bc05675c748cee20385fbc8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 25 Mar 2023 16:05:30 +0100 Subject: [PATCH] matrix: add element, fix ldap login --- hosts/matrix/default.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/hosts/matrix/default.nix b/hosts/matrix/default.nix index 79d57d99..3a2e2a0e 100644 --- a/hosts/matrix/default.nix +++ b/hosts/matrix/default.nix @@ -1,4 +1,4 @@ -{ config, libS, pkgs, ... }: +{ config, lib, libS, pkgs, ... }: { c3d2.deployment.server = "server10"; @@ -12,6 +12,10 @@ services = { matrix-synapse = { enable = true; + element-web = { + enable = true; + domain = "element.c3d2.de"; + }; extraConfigFiles = [ config.sops.secrets."matrix-synapse/config".path ]; @@ -22,7 +26,6 @@ settings = { admin_contact = "mailto:mail@c3d2.de"; email = { - client_base_url = "https://element.c3d2.de/"; enable_notifs = true; notif_for_new_users = false; notif_from = "Your Friendly %(app)s homeserver "; @@ -55,7 +58,6 @@ serve_server_wellknown = true; url_preview_enabled = true; user_ips_max_age = "7d"; - web_client_location = "https://element.c3d2.de"; }; }; @@ -64,15 +66,21 @@ virtualHosts."matrix.c3d2.de" = { forceSSL = true; enableACME = true; - locations."/".proxyPass = "http://localhost:8008"; + locations = { + "/".proxyPass = "http://127.0.0.1:8008"; + "^~ /_synapse/admin/".return = "403"; + }; }; }; + portunus.addToHosts = true; + postgresql = { enable = true; ensureUsers = [{ name = "matrix-synapse"; }]; + # TODO: move into nixos-modules? initialScript = pkgs.writeText "synapse-init.sql" '' CREATE ROLE "matrix-synapse" WITH LOGIN; CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse"