Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

services/matrix: Adjust proxy settings and automatically purge remote media #38

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions services/matrix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ in {
"synapse/registration_shared_secret".owner = "matrix-synapse";
};

services.nginx.virtualHosts = {
"chat.${baseDomain}" = {
enableACME = true;
forceSSL = true;
services.nginx = {
recommendedProxySettings = true;
virtualHosts = {
"chat.${baseDomain}" = {
enableACME = true;
forceSSL = true;

root = pkgs.element-web.override {
root = pkgs.element-web.override {
# Somewhat duplicate of the stuff in website.nix but I am
# not sure if we absolutely need to dedup this, just out of complexity perspective
conf = {
Expand Down Expand Up @@ -60,6 +62,7 @@ in {
# locations."/_synapse/admin".proxyPass = "http://[::1]:${toString matrixPort}";
};
};
};

services.postgresql = {
enable = true;
Expand All @@ -86,7 +89,6 @@ in {
static-auth-secret-file = config.sops.secrets."coturn_static_auth_secret".path;
};

# TODO: Use media storage volume on prod
services.matrix-synapse = {
enable = true;
plugins = [
Expand Down Expand Up @@ -144,6 +146,12 @@ in {
user_mapping_provider.module = "matrix_synapse_saml_mapper.SamlMappingProvider";
};
password_config.enabled = false;
media_retention = {
# Since clearing remote media does the trick for now when it comes to purging old media
# keeping local media for virtually unlimited time (for now, may change in the future).
local_media_lifetime = "10y";
remote_media_lifetime = "90d";
};
};
extraConfigFiles = let
format = (pkgs.formats.yaml {}).generate;
Expand Down
Loading