From 06bd495dd9bad4e73157def741279f42529be5e4 Mon Sep 17 00:00:00 2001 From: emily Date: Sat, 2 Nov 2024 15:59:22 +0100 Subject: [PATCH] akkoma: various stuff --- config/services/akkoma/default.nix | 34 +++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/config/services/akkoma/default.nix b/config/services/akkoma/default.nix index af03b23..c9d0d85 100644 --- a/config/services/akkoma/default.nix +++ b/config/services/akkoma/default.nix @@ -7,6 +7,7 @@ }; services.akkoma = { enable = true; + extraPackages = with pkgs; [ exiftool ffmpeg-headless imagemagick ]; extraStatic."emoji/blobs.gg" = pkgs.akkoma-emoji.blobs_gg; extraStatic."static/styles.json" = pkgs.writeText "styles.json" (builtins.toJSON { @@ -130,7 +131,7 @@ }; ":media_preview_proxy" = { - enabled = false; + enabled = true; thumbnail_max_width = 1920; thumbnail_max_height = 1080; min_content_length = 128 * 1024; @@ -145,10 +146,13 @@ "Pleroma.Upload.Filter.AnonymizeFilename" ]; - ":mrf".policies = map mkRaw [ - "Pleroma.Web.ActivityPub.MRF.SimplePolicy" - "Pleroma.Web.ActivityPub.MRF.ObjectAgePolicy" - ]; + ":mrf" = { + transparency = true; + policies = map mkRaw [ + "Pleroma.Web.ActivityPub.MRF.SimplePolicy" + "Pleroma.Web.ActivityPub.MRF.ObjectAgePolicy" + ]; + }; ":mrf_simple" = { reject = mkMap { @@ -177,13 +181,12 @@ }; }; - ":mrf_object_age".threshold = 90 * 24 * 3600; + ":mrf_object_age".threshold = 180 * 24 * 3600; ":frontend_configurations" = { pleroma_fe = mkMap { background = "/images/sylvia-ritter-15012323.avif"; collapseMessageWithSubject = true; - hideSiteFavicon = true; streaming = true; webPushNotifications = true; useStreamingApi = true; @@ -195,7 +198,7 @@ modalOnRepeat = true; minimalScopesMode = true; redirectRootNoLogin = "/about"; - translationLanguage = "EN"; + translationLanguage = "en"; theme = "elly-mod"; }; }; @@ -239,11 +242,21 @@ ''; }; kyouma.nginx.virtualHosts = { - "florp.social".locations."/".proxyPass = "http://unix:/run/akkoma/socket"; + "florp.social" = { + locations."/" = { + proxyPass = "http://unix:/run/akkoma/socket"; + proxyWebsockets = true; + }; + locations."^/media(/.*)$".return = "308 https://media.florp.social$1"; + locations."^/proxy(/.*)$".return = "308 https://cache.florp.social$1"; + }; "media.florp.social" = { useACMEHost = "florp.social"; - locations."/".proxyPass = "http://unix:/run/akkoma/socket"; + locations."/" = { + proxyPass = "http://unix:/run/akkoma/socket"; + extraConfig = "rewrite ^(?!/media)(.*)$ /media$1;"; + }; }; "cache.florp.social" = { @@ -251,6 +264,7 @@ locations."/" = { proxyPass = "http://unix:/run/akkoma/socket"; extraConfig = '' + rewrite ^(?!/proxy)(.*)$ /proxy$1; proxy_cache akkoma_media_cache; # Cache objects in slices of 1 MiB