conduit: Add new conduit service

This commit is contained in:
Tristan Daniël Maat 2022-10-21 20:48:14 +01:00
parent 3e13b575b0
commit c56de6cf7e
Signed by: tlater
GPG key ID: 49670FD774E43268
5 changed files with 94 additions and 2 deletions
configuration/services

View file

@ -0,0 +1,53 @@
{config, ...}: let
cfg = config.services.matrix-conduit;
domain = "matrix.${config.services.nginx.domain}";
in {
services.matrix-conduit = {
enable = true;
settings.global = {
address = "127.0.0.1";
server_name = domain;
database_backend = "rocksdb";
};
};
services.nginx.virtualHosts."${domain}" = {
enableACME = true;
listen = [
{
addr = "0.0.0.0";
port = 443;
ssl = true;
}
{
addr = "[::0]";
port = 443;
ssl = true;
}
{
addr = "0.0.0.0";
port = 8448;
ssl = true;
}
{
addr = "[::0]";
port = 8488;
ssl = true;
}
];
addSSL = true;
extraConfig = ''
merge_slashes off;
'';
locations."/_matrix" = {
proxyPass = "http://${cfg.settings.global.address}:${toString cfg.settings.global.port}";
# Recommended by conduit
extraConfig = ''
proxy_buffering off;
'';
};
};
}