feat(matrix): improve dendrite & element config
This commit is contained in:
parent
1e229baafd
commit
d20e8f5cd2
|
@ -4,7 +4,12 @@ let
|
||||||
inherit (config.services) dendrite;
|
inherit (config.services) dendrite;
|
||||||
server_name = "felschr.com";
|
server_name = "felschr.com";
|
||||||
domain = "matrix.${server_name}";
|
domain = "matrix.${server_name}";
|
||||||
connectionString = "postgresql:///dendrite?host=/run/postgresql";
|
database = {
|
||||||
|
connection_string = "postgresql:///dendrite?host=/run/postgresql";
|
||||||
|
max_open_conns = 10;
|
||||||
|
max_idle_conns = 2;
|
||||||
|
conn_max_lifetime = -1;
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
age.secrets.dendrite-private-key = {
|
age.secrets.dendrite-private-key = {
|
||||||
file = ../../secrets/dendrite/privateKey.age;
|
file = ../../secrets/dendrite/privateKey.age;
|
||||||
|
@ -19,26 +24,22 @@ in {
|
||||||
enable = true;
|
enable = true;
|
||||||
environmentFile = config.age.secrets.dendrite-env.path;
|
environmentFile = config.age.secrets.dendrite-env.path;
|
||||||
settings = {
|
settings = {
|
||||||
app_service_api.database.connection_string = connectionString;
|
app_service_api.database = database;
|
||||||
federation_api.database.connection_string = connectionString;
|
federation_api.database = database;
|
||||||
key_server.database.connection_string = connectionString;
|
key_server.database = database;
|
||||||
media_api.database.connection_string = connectionString;
|
media_api.database = database;
|
||||||
mscs.database.connection_string = connectionString;
|
mscs.database = database;
|
||||||
room_server.database.connection_string = connectionString;
|
room_server.database = database;
|
||||||
sync_api.database.connection_string = connectionString;
|
sync_api.database = database;
|
||||||
user_api.account_database.connection_string = connectionString;
|
user_api.account_database = database;
|
||||||
user_api.device_database.connection_string = connectionString;
|
|
||||||
|
|
||||||
client_api.registration_shared_secret = "$REGISTRATION_SHARED_SECRET";
|
client_api.registration_shared_secret = "$REGISTRATION_SHARED_SECRET";
|
||||||
|
|
||||||
# 2 megabytes in bytes
|
media_api.max_file_size_bytes = 10485760; # 10 MB
|
||||||
media_api.max_file_size_bytes = 2097152;
|
|
||||||
|
|
||||||
mscs.mscs = [
|
mscs.mscs = [
|
||||||
# spaces
|
"msc2836" # threads
|
||||||
"msc2836"
|
"msc2946" # space summaries
|
||||||
# threads
|
|
||||||
"msc2946"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
federation_api.key_perspectives = [{
|
federation_api.key_perspectives = [{
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
let inherit (config.services.dendrite.settings.global) server_name;
|
let
|
||||||
|
inherit (config.services.dendrite.settings.global) server_name;
|
||||||
|
matrix_host = "matrix.${server_name}";
|
||||||
in {
|
in {
|
||||||
services.nginx.virtualHosts."element.felschr.com" = {
|
services.nginx.virtualHosts."element.felschr.com" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
@ -8,8 +10,8 @@ in {
|
||||||
root = pkgs.element-web.override {
|
root = pkgs.element-web.override {
|
||||||
conf = {
|
conf = {
|
||||||
default_server_config."m.homeserver" = {
|
default_server_config."m.homeserver" = {
|
||||||
"base_url" = "https://matrix.${server_name}";
|
base_url = "https://${matrix_host}";
|
||||||
"server_name" = "${server_name}";
|
server_name = "${server_name}";
|
||||||
};
|
};
|
||||||
disable_guests = true;
|
disable_guests = true;
|
||||||
features = {
|
features = {
|
||||||
|
@ -19,7 +21,13 @@ in {
|
||||||
feature_group_calls = true;
|
feature_group_calls = true;
|
||||||
};
|
};
|
||||||
show_labs_settings = true;
|
show_labs_settings = true;
|
||||||
roomDirectory.servers = [ "matrix.org" "gitter.im" "libera.chat" ];
|
roomDirectory.servers =
|
||||||
|
[ server_name "matrix.org" "gitter.im" "libera.chat" ];
|
||||||
|
enable_presence_by_hs_url = {
|
||||||
|
"https://${matrix_host}" = false;
|
||||||
|
"https://matrix.org" = false;
|
||||||
|
"https://matrix-client.matrix.org" = false;
|
||||||
|
};
|
||||||
jitsi.preferred_domain = "meet.element.io";
|
jitsi.preferred_domain = "meet.element.io";
|
||||||
element_call.url = "https://call.element.io";
|
element_call.url = "https://call.element.io";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue