renge/mautrix-signal: Allow file transfer

mautrix-whatsapp places a file in /tmp/ for file transfers. However,
signald is running with PrivateTemp=true. This uses systemd’s feature
that allows a unit to share a namespace with another one and places
mautrix-signal in the same namespace as signald, so they share their
private tmp directory.
This commit is contained in:
Simon Bruder 2022-10-16 15:52:08 +02:00
parent f51bc637da
commit 18dab0ab94
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC

View file

@ -85,12 +85,17 @@ in
serviceConfig = { serviceConfig = {
DynamicUser = true; DynamicUser = true;
PrivateTmp = true;
SupplementaryGroups = [ "signald" ]; SupplementaryGroups = [ "signald" ];
StateDirectory = "mautrix-signal"; StateDirectory = "mautrix-signal";
WorkingDirectory = "/var/lib/mautrix-signal"; WorkingDirectory = "/var/lib/mautrix-signal";
ExecStart = "${pkgs.mautrix-signal}/bin/mautrix-signal -c ${generatedConfig}/config.yaml"; ExecStart = "${pkgs.mautrix-signal}/bin/mautrix-signal -c ${generatedConfig}/config.yaml";
Restart = "on-failure"; Restart = "on-failure";
}; };
unitConfig = {
JoinsNamespaceOf = "signald.service";
};
}; };
services.matrix-synapse.settings.app_service_config_files = lib.singleton "${generatedConfig}/registration.yaml"; services.matrix-synapse.settings.app_service_config_files = lib.singleton "${generatedConfig}/registration.yaml";