matrix: setup delegation and misc configs
This commit is contained in:
@@ -5,6 +5,9 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
matrix_hostname = "matrix.${service_configs.https.domain}";
|
||||
in
|
||||
{
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
@@ -12,6 +15,12 @@
|
||||
virtualHosts = {
|
||||
${service_configs.https.domain} = {
|
||||
extraConfig = ''
|
||||
|
||||
header /.well-known/matrix/* Content-Type application/json
|
||||
header /.well-known/matrix/* Access-Control-Allow-Origin *
|
||||
respond /.well-known/matrix/server `{"m.server": "${matrix_hostname}:443"}`
|
||||
respond /.well-known/matrix/client `{"m.server":{"base_url":"https://${matrix_hostname}"},"m.homeserver":{"base_url":"https://${matrix_hostname}"},"org.matrix.msc3575.proxy":{"base_url":"https://${config.services.matrix-conduit.settings.global.server_name}"}}`
|
||||
|
||||
root * ${service_configs.https.data_dir}
|
||||
file_server browse
|
||||
'';
|
||||
@@ -52,12 +61,12 @@
|
||||
file_server browse
|
||||
'';
|
||||
|
||||
"${config.services.matrix-conduit.settings.global.server_name}".extraConfig = ''
|
||||
"${matrix_hostname}".extraConfig = ''
|
||||
reverse_proxy :${builtins.toString config.services.matrix-conduit.settings.global.port}
|
||||
'';
|
||||
|
||||
# Exact duplicate of matrix.gardling.com
|
||||
"${config.services.matrix-conduit.settings.global.server_name}:8448".extraConfig =
|
||||
"${matrix_hostname}:8448".extraConfig =
|
||||
config.services.caddy.virtualHosts."${config.services.matrix-conduit.settings.global.server_name
|
||||
}".extraConfig;
|
||||
};
|
||||
|
||||
@@ -18,12 +18,17 @@
|
||||
|
||||
settings.global = {
|
||||
port = 6167;
|
||||
server_name = "matrix.${service_configs.https.domain}";
|
||||
# server_name = "matrix.${service_configs.https.domain}";
|
||||
server_name = service_configs.https.domain;
|
||||
database_backend = "rocksdb";
|
||||
allow_registration = true;
|
||||
|
||||
new_user_displayname_suffix = "";
|
||||
|
||||
trusted_servers = [
|
||||
"matrix.org"
|
||||
"constellatory.net"
|
||||
"tchncs.de"
|
||||
"envs.net"
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user