2021-09-22 10:16:11 +02:00
|
|
|
{ config, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
services.matrix-synapse = {
|
|
|
|
enable = true;
|
2021-09-22 15:31:20 +02:00
|
|
|
withJemalloc = true;
|
2022-08-23 20:31:09 +02:00
|
|
|
extraConfigFiles = [ config.secrets.files.synapse_extra_config.file ];
|
2023-10-13 13:32:53 +02:00
|
|
|
sliding-sync = {
|
|
|
|
enable = true;
|
|
|
|
settings.SYNCV3_SERVER = "https://graven.dev";
|
2023-10-16 07:56:23 +02:00
|
|
|
environmentFile = builtins.toString config.secrets.files.synapse_sliding_sync_env.file;
|
2023-10-13 13:32:53 +02:00
|
|
|
};
|
2022-08-03 08:57:34 +02:00
|
|
|
settings = {
|
|
|
|
server_name = "graven.dev";
|
|
|
|
enable_registration = false;
|
|
|
|
registration_shared_secret = builtins.toString config.secrets.files.synapse_registration_shared_secret.file;
|
|
|
|
turn_shared_secret = builtins.toString config.secrets.files.turn_shared_secret.file;
|
|
|
|
max_upload_size = "100M";
|
|
|
|
database.name = "psycopg2";
|
|
|
|
database.args.user = "synapse";
|
|
|
|
database.args.database = "synapse";
|
|
|
|
turn_uris = [
|
|
|
|
"turn:turn.graven.dev:3478?transport=udp"
|
|
|
|
"turn:turn.graven.dev:3478?transport=tcp"
|
|
|
|
"turn:turn.graven.dev:3479?transport=udp"
|
|
|
|
"turn:turn.graven.dev:3479?transport=tcp"
|
|
|
|
"turns:turn.graven.dev:5349?transport=udp"
|
|
|
|
"turns:turn.graven.dev:5349?transport=tcp"
|
|
|
|
"turns:turn.graven.dev:5350?transport=udp"
|
|
|
|
"turns:turn.graven.dev:5350?transport=tcp"
|
|
|
|
];
|
|
|
|
report_stats = true;
|
|
|
|
logConfig = ''
|
|
|
|
version: 1
|
2021-09-22 10:16:11 +02:00
|
|
|
|
2022-08-03 08:57:34 +02:00
|
|
|
formatters:
|
|
|
|
precise:
|
|
|
|
format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s - %(message)s'
|
2021-09-22 10:16:11 +02:00
|
|
|
|
2022-08-03 08:57:34 +02:00
|
|
|
handlers:
|
|
|
|
console:
|
|
|
|
class: logging.StreamHandler
|
|
|
|
formatter: precise
|
2021-09-22 10:16:11 +02:00
|
|
|
|
2022-08-03 08:57:34 +02:00
|
|
|
loggers:
|
|
|
|
synapse.storage.SQL:
|
|
|
|
# beware: increasing this to DEBUG will make synapse log sensitive
|
|
|
|
# information such as access tokens.
|
|
|
|
level: WARN
|
2021-09-22 10:16:11 +02:00
|
|
|
|
2022-08-03 08:57:34 +02:00
|
|
|
root:
|
|
|
|
level: WARN
|
|
|
|
handlers: [console]
|
2021-09-22 10:16:11 +02:00
|
|
|
|
2022-08-03 08:57:34 +02:00
|
|
|
disable_existing_loggers: false
|
|
|
|
'';
|
|
|
|
listeners = [
|
|
|
|
{
|
|
|
|
port = 8008;
|
|
|
|
bind_addresses = ["127.0.0.1"];
|
|
|
|
type = "http";
|
|
|
|
tls = false;
|
|
|
|
x_forwarded = true;
|
|
|
|
resources = [
|
|
|
|
{
|
|
|
|
names = [ "client" "federation" ];
|
|
|
|
compress = false;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2021-09-22 10:16:11 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|