Skip to content

Commit d8ea025

Browse files
committed
matrix-synapse: try to fix image thumbnail issue
1 parent 0e8d674 commit d8ea025

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

nixos/optional-apps/matrix-synapse/matrix-synapse.nix

+25-4
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,8 @@
2525
];
2626

2727
settings = {
28-
max_upload_size = "500M";
2928
public_baseurl = "https://matrix.lantian.pub";
3029
server_name = config.networking.domain;
31-
url_preview_enabled = true;
32-
media_store_path = "${config.services.matrix-synapse.dataDir}/media";
3330
account_threepid_delegates = {
3431
msisdn = "https://vector.im";
3532
};
@@ -61,6 +58,27 @@
6158
}
6259
];
6360

61+
enable_media_repo = true;
62+
media_store_path = "${config.services.matrix-synapse.dataDir}/media";
63+
media_storage_providers = [
64+
{
65+
module = "file_system";
66+
store_local = false;
67+
store_remote = true;
68+
store_synchronous = true;
69+
config.directory = "${config.services.matrix-synapse.dataDir}/remote-media";
70+
}
71+
];
72+
max_upload_size = "500M";
73+
dynamic_thumbnails = true;
74+
url_preview_enabled = true;
75+
url_preview_ip_range_blacklist = LT.constants.reserved.IPv4 ++ LT.constants.reserved.IPv6;
76+
url_preview_ip_range_whitelist =
77+
LT.constants.dn42.IPv4
78+
++ LT.constants.dn42.IPv6
79+
++ LT.constants.neonetwork.IPv4
80+
++ LT.constants.neonetwork.IPv6;
81+
6482
modules = [
6583
{
6684
module = "matrix_http_rendezvous_synapse.SynapseRendezvousModule";
@@ -222,5 +240,8 @@
222240
noIndex.enable = true;
223241
};
224242

225-
systemd.tmpfiles.rules = [ "d /var/lib/matrix-synapse/media 755 matrix-synapse matrix-synapse" ];
243+
systemd.tmpfiles.rules = [
244+
"d /var/lib/matrix-synapse/media 755 matrix-synapse matrix-synapse"
245+
"d /var/lib/matrix-synapse/remote-media 755 matrix-synapse matrix-synapse"
246+
];
226247
}

0 commit comments

Comments
 (0)