From ff8630ece54b09c931b9449fd082cb48659a1f58 Mon Sep 17 00:00:00 2001 From: emily Date: Thu, 14 Nov 2024 11:00:02 +0100 Subject: [PATCH 1/4] Thank you domi --- config/services/akkoma/default.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/config/services/akkoma/default.nix b/config/services/akkoma/default.nix index ff1a6f4..d6c3243 100644 --- a/config/services/akkoma/default.nix +++ b/config/services/akkoma/default.nix @@ -27,7 +27,9 @@ extraStatic."static/themes/elly-mod.json" = pkgs.writeText "elly-mod.json" (builtins.readFile ./elly-mod.json); extraStatic."static/custom.css" = pkgs.writeText "custom.css" '' - .tos-content img { max-width: 100%; } + .tos-content img, .terms-of-service img { + max-width: 100%; + } ''; extraStatic."static/terms-of-service.html" = inputs.florp-about.packages.${pkgs.system}.default; @@ -79,10 +81,10 @@ limit = 69420; description_limit = 69420; remote_limit = 131072; - upload_limit = 160 * 1024 * 1024; - avatar_upload_limit = 16 * 1024 * 1024; - background_upload_limit = 32 * 1024 * 1024; - banner_upload_limit = 32 * 1024 * 1024; + upload_limit = 256 * 1024 * 1024; + avatar_upload_limit = 4 * 1024 * 1024; + background_upload_limit = 8 * 1024 * 1024; + banner_upload_limit = 8 * 1024 * 1024; registrations_open = true; registration_reason_length = 2048; account_approval_required = true; @@ -198,7 +200,6 @@ webPushNotifications = true; useStreamingApi = true; scopeCopy = true; - showFeaturesPanel = false; subjectLineBehavior = "masto"; alwaysShowSubjectInput = true; postContentType = "text/markdown"; From f436f8fcdb6a9116546b69f5e5a524fa4e0b5ff2 Mon Sep 17 00:00:00 2001 From: emily Date: Thu, 14 Nov 2024 16:46:00 +0100 Subject: [PATCH 2/4] florp: move moderation into its own repo --- config/services/akkoma/default.nix | 47 +++++------------------------- flake.lock | 29 +++++++++++++++--- flake.nix | 8 +++-- 3 files changed, 38 insertions(+), 46 deletions(-) diff --git a/config/services/akkoma/default.nix b/config/services/akkoma/default.nix index d6c3243..9901e50 100644 --- a/config/services/akkoma/default.nix +++ b/config/services/akkoma/default.nix @@ -1,5 +1,10 @@ { config, inputs, lib, pkgs, ... }: { - sops.secrets."services/akkoma/mailerPassword" = { + imports = [ + inputs.florp-moderation.nixosModules.default + # Moderated instances. See https://woof.rip/florp/moderation for more information. + inputs.florp-moderation.nixosModules.florp + ]; + sops.secrets."services/akkoma/mailerPassword" = { sopsFile = ../../../secrets/services/akkoma.yaml; }; sops.secrets."services/akkoma/deepl" = { @@ -51,9 +56,7 @@ }; }; services.akkoma.config = let - inherit ((pkgs.formats.elixirConf { }).lib) mkRaw mkAtom mkTuple; - - mapAttrsToListOfTuple = attr: lib.mapAttrsToList (name: value: mkTuple [ name value ]) attr; + inherit ((pkgs.formats.elixirConf { }).lib) mkRaw mkAtom; mkMapOfPredefinedKeys = set: let string = value: "\"${(lib.escape [ "\\" "#" "\"" ]) value}\""; @@ -150,45 +153,9 @@ ]; ":mrf".policies = map mkRaw [ - "Pleroma.Web.ActivityPub.MRF.SimplePolicy" - "Pleroma.Web.ActivityPub.MRF.ObjectAgePolicy" "Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy" ]; - ":mrf_simple" = { - reject = mapAttrsToListOfTuple { - "bae.st" = "transphobia, queerphobia"; - "brighteon.social" = "transphobia, right‐wing extremism"; - "detroitriotcity.com" = "transphobia, queerphobia"; - "freeatlantis.com" = "harassment"; - "freespeechextremist.com" = "N/A"; - "gab.com" = "N/A"; - "gleasonator.com" = "transphobia"; - "kitsunemimi.club" = "transphobia"; - "kiwifarms.*" = "harassment"; - "poa.st" = "queerphobia, racism, right‐wing extremism"; - "seal.cafe" = "transphobia"; - "social.quodverum.com" = "N/A"; - "spinster.xyz" = "transphobia"; - "truthsocial.co.in" = "N/A"; - "varishangout.net" = "transphobia"; - "activitypub-troll.cf" = "N/A"; - "misskey-forkbomb.cf" = "security"; - "repl.co" = "N/A"; - "rape.pet" = "CSAM"; - "childlove.space" = "CSAM"; - "pedo.school" = "CSAM"; - "loli.church" = "transphobia"; - "usasa.ky" = "spam"; - "tickler.cc" = "spam"; - "shitposter.club" = "transphobia"; - }; - - followers_only = mapAttrsToListOfTuple { - "bitcoinhackers.org" = "annoying"; - }; - }; - ":mrf_object_age".threshold = 180 * 24 * 3600; ":frontend_configurations" = { diff --git a/flake.lock b/flake.lock index 5369a18..3a26391 100644 --- a/flake.lock +++ b/flake.lock @@ -437,11 +437,11 @@ ] }, "locked": { - "lastModified": 1731279732, - "narHash": "sha256-eZllHPzbjvTNrzImqtDrs0k1LsIIeTlp8MMN9SxMvvE=", + "lastModified": 1731582952, + "narHash": "sha256-hnvqHeekGal+hml6BQB254LsJn+Vk5QNKzkIu8rH/xs=", "ref": "refs/heads/main", - "rev": "2f1130b23576a403b9b1d70d6431649bfa044621", - "revCount": 8, + "rev": "f283dba73f777746e1675126f8fa4c5b1fd06152", + "revCount": 10, "type": "git", "url": "https://woof.rip/florp/about.git" }, @@ -470,6 +470,26 @@ "url": "https://woof.rip/florp/branding.git" } }, + "florp-moderation": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1731607870, + "narHash": "sha256-zWCDVjtia0h/sCMUrmuedhxB/DgG2EkYwpviL1etcLU=", + "ref": "refs/heads/main", + "rev": "f8765b410ad0496a82cc294c68aec701e6d391be", + "revCount": 5, + "type": "git", + "url": "https://woof.rip/florp/moderation.git" + }, + "original": { + "type": "git", + "url": "https://woof.rip/florp/moderation.git" + } + }, "fromYaml": { "flake": false, "locked": { @@ -1038,6 +1058,7 @@ "flake-utils": "flake-utils", "florp-about": "florp-about", "florp-branding": "florp-branding", + "florp-moderation": "florp-moderation", "home-manager": "home-manager", "hydra": "hydra", "kyouma-www": "kyouma-www", diff --git a/flake.nix b/flake.nix index 63d1431..df0cbed 100644 --- a/flake.nix +++ b/flake.nix @@ -21,12 +21,16 @@ url = "github:wobcom/fernglas"; inputs.flake-utils.follows = "flake-utils"; }; + florp-about = { + url = "git+https://woof.rip/florp/about.git"; + inputs.nixpkgs.follows = "nixpkgs"; + }; florp-branding = { url = "git+https://woof.rip/florp/branding.git"; inputs.nixpkgs.follows = "nixpkgs"; }; - florp-about = { - url = "git+https://woof.rip/florp/about.git"; + florp-moderation = { + url = "git+https://woof.rip/florp/moderation.git"; inputs.nixpkgs.follows = "nixpkgs"; }; home-manager = { From 018d5f4cd48c963df836e4d30808de9dc7569db2 Mon Sep 17 00:00:00 2001 From: emily Date: Thu, 14 Nov 2024 18:16:49 +0100 Subject: [PATCH 3/4] admin-fe: disable unused features --- config/services/akkoma/default.nix | 8 +++++++- pkgs/akkoma-admin-fe/default.nix | 7 +++++++ pkgs/akkoma-admin-fe/disable-options.patch | 12 ++++++++++++ pkgs/overlay.nix | 1 + 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 pkgs/akkoma-admin-fe/default.nix create mode 100644 pkgs/akkoma-admin-fe/disable-options.patch diff --git a/config/services/akkoma/default.nix b/config/services/akkoma/default.nix index 9901e50..002e8c6 100644 --- a/config/services/akkoma/default.nix +++ b/config/services/akkoma/default.nix @@ -49,7 +49,7 @@ ref = "5f0339ce00"; }; admin = { - package = pkgs.akkoma-frontends.admin-fe; + package = pkgs.akkoma-admin-fe; name = "admin-fe"; ref = "stable"; }; @@ -247,6 +247,12 @@ }; locations."^/media(/.*)$".return = "308 https://media.florp.social$1"; locations."^/proxy(/.*)$".return = "308 https://cache.florp.social$1"; + locations."= /api/v1/pleroma/admin/config" = { + return = ''200 "\{\"error\":\"You must enable configurable_from_database in your config file.\"\}"''; + extraConfig = '' + types { } default_type "application/json; charset=utf-8"; + ''; + }; }; "media.florp.social" = { diff --git a/pkgs/akkoma-admin-fe/default.nix b/pkgs/akkoma-admin-fe/default.nix new file mode 100644 index 0000000..e4fa685 --- /dev/null +++ b/pkgs/akkoma-admin-fe/default.nix @@ -0,0 +1,7 @@ +{ + akkoma-frontends +}: + +akkoma-frontends.admin-fe.overrideAttrs { + patches = [ ./disable-options.patch ]; +} diff --git a/pkgs/akkoma-admin-fe/disable-options.patch b/pkgs/akkoma-admin-fe/disable-options.patch new file mode 100644 index 0000000..6441cad --- /dev/null +++ b/pkgs/akkoma-admin-fe/disable-options.patch @@ -0,0 +1,12 @@ +diff --git a/config/prod.env.js b/config/prod.env.js +index 7acb93a2..ea500e99 100644 +--- a/config/prod.env.js ++++ b/config/prod.env.js +@@ -2,6 +2,6 @@ module.exports = { + NODE_ENV: '"production"', + ENV_CONFIG: '"prod"', + BASE_API: '"https://api-prod"', +- DISABLED_FEATURES: '[""]', ++ DISABLED_FEATURES: '["settings","media-proxy-cache","relays"]', + ASSETS_PUBLIC_PATH: '/pleroma/admin/' + } diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix index 8934f1c..5a40d24 100644 --- a/pkgs/overlay.nix +++ b/pkgs/overlay.nix @@ -6,6 +6,7 @@ final: prev: { librespeed-rust = final.callPackage ./librespeed-rust/default.nix {}; librespeed-go = final.callPackage ./librespeed-go/default.nix {}; akkoma-fe-domi = final.callPackage ./akkoma-fe-domi/default.nix {}; + akkoma-admin-fe = final.callPackage ./akkoma-admin-fe/default.nix {}; nginxQuic = prev.nginxQuic.override { withSlice = true; # Use zlib because zlib-ng uses larger buffers then nginx preallocates. From 9cbf6f95580c1c52eff6943d13f0193e20c256ed Mon Sep 17 00:00:00 2001 From: Update Bot Date: Fri, 15 Nov 2024 04:20:43 +0100 Subject: [PATCH 4/4] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'florp-moderation': 'git+https://woof.rip/florp/moderation.git?ref=refs/heads/main&rev=f8765b410ad0496a82cc294c68aec701e6d391be' (2024-11-14) → 'git+https://woof.rip/florp/moderation.git?ref=refs/heads/main&rev=32e1061cb2ef3cd0eab0bd99f062a2776a73d459' (2024-11-14) • Updated input 'home-manager': 'github:nix-community/home-manager/35b055009afd0107b69c286fca34d2ad98940d57' (2024-11-13) → 'github:nix-community/home-manager/1d0862ee2d7c6f6cd720d6f32213fa425004be10' (2024-11-14) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/76612b17c0ce71689921ca12d9ffdc9c23ce40b2' (2024-11-09) → 'github:nixos/nixpkgs/dc460ec76cbff0e66e269457d7b728432263166c' (2024-11-11) • Updated input 'nixvim': 'github:nix-community/nixvim/f11a877bcc1d66cc8bd7990c704f91c1e99c7d08' (2024-11-13) → 'github:nix-community/nixvim/24fe0dd2478643fcd4dd57c9570b4614fac80144' (2024-11-14) • Updated input 'nixvim/git-hooks': 'github:cachix/git-hooks.nix/d70155fdc00df4628446352fc58adc640cd705c2' (2024-11-05) → 'github:cachix/git-hooks.nix/cd1af27aa85026ac759d5d3fccf650abe7e1bbf0' (2024-11-11) • Updated input 'nixvim/nix-darwin': 'github:lnl7/nix-darwin/5c74ab862c8070cbf6400128a1b56abb213656da' (2024-11-09) → 'github:lnl7/nix-darwin/6c71c49e2448e51ad830ed211024e6d0edc50116' (2024-11-12) • Updated input 'nixvim/nuschtosSearch': 'github:NuschtOS/search/ef493352f9e1f051e01a55c062731503a6b36b4e' (2024-11-08) → 'github:NuschtOS/search/135d202e032be70c93b6d7d53592ef4799d6efde' (2024-11-11) • Updated input 'stylix': 'github:danth/stylix/be94701ce7b746cb020e667f71492e398ed470f4' (2024-11-13) → 'github:danth/stylix/e0a278871b63b1800ccdda568861b5324dd93797' (2024-11-14) --- flake.lock | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/flake.lock b/flake.lock index 3a26391..00e4500 100644 --- a/flake.lock +++ b/flake.lock @@ -477,11 +477,11 @@ ] }, "locked": { - "lastModified": 1731607870, - "narHash": "sha256-zWCDVjtia0h/sCMUrmuedhxB/DgG2EkYwpviL1etcLU=", + "lastModified": 1731611636, + "narHash": "sha256-Do8vpR8JTpkPr9vxf1aRzhb4/cUBjg5twPyGDyezxJw=", "ref": "refs/heads/main", - "rev": "f8765b410ad0496a82cc294c68aec701e6d391be", - "revCount": 5, + "rev": "32e1061cb2ef3cd0eab0bd99f062a2776a73d459", + "revCount": 7, "type": "git", "url": "https://woof.rip/florp/moderation.git" }, @@ -523,11 +523,11 @@ ] }, "locked": { - "lastModified": 1730814269, - "narHash": "sha256-fWPHyhYE6xvMI1eGY3pwBTq85wcy1YXqdzTZF+06nOg=", + "lastModified": 1731363552, + "narHash": "sha256-vFta1uHnD29VUY4HJOO/D6p6rxyObnf+InnSMT4jlMU=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "d70155fdc00df4628446352fc58adc640cd705c2", + "rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0", "type": "github" }, "original": { @@ -582,11 +582,11 @@ ] }, "locked": { - "lastModified": 1731535640, - "narHash": "sha256-2EckCJn4wxran/TsRiCOFcmVpep2m9EBKl99NBh2GnM=", + "lastModified": 1731604581, + "narHash": "sha256-Qq2YZZaDTB3FZLWU/Hgh1uuWlUBl3cMLGB99bm7rFUM=", "owner": "nix-community", "repo": "home-manager", - "rev": "35b055009afd0107b69c286fca34d2ad98940d57", + "rev": "1d0862ee2d7c6f6cd720d6f32213fa425004be10", "type": "github" }, "original": { @@ -733,11 +733,11 @@ ] }, "locked": { - "lastModified": 1731153869, - "narHash": "sha256-3Ftf9oqOypcEyyrWJ0baVkRpvQqroK/SVBFLvU3nPuc=", + "lastModified": 1731454423, + "narHash": "sha256-TtwvgFxUa0wyptLhQbKaixgNW1UXf3+TDqfX3Kp63oM=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "5c74ab862c8070cbf6400128a1b56abb213656da", + "rev": "6c71c49e2448e51ad830ed211024e6d0edc50116", "type": "github" }, "original": { @@ -966,11 +966,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1731139594, - "narHash": "sha256-IigrKK3vYRpUu+HEjPL/phrfh7Ox881er1UEsZvw9Q4=", + "lastModified": 1731319897, + "narHash": "sha256-PbABj4tnbWFMfBp6OcUK5iGy1QY+/Z96ZcLpooIbuEI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "76612b17c0ce71689921ca12d9ffdc9c23ce40b2", + "rev": "dc460ec76cbff0e66e269457d7b728432263166c", "type": "github" }, "original": { @@ -997,11 +997,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1731527733, - "narHash": "sha256-12OpSgbLDiKmxvBXwVracIfGI9FpjFyHpa1r0Ho+NFA=", + "lastModified": 1731571290, + "narHash": "sha256-osvW1d7YxBs5UDRN/RLFqVtWegArqhvonL9odVpWMuc=", "owner": "nix-community", "repo": "nixvim", - "rev": "f11a877bcc1d66cc8bd7990c704f91c1e99c7d08", + "rev": "24fe0dd2478643fcd4dd57c9570b4614fac80144", "type": "github" }, "original": { @@ -1020,11 +1020,11 @@ ] }, "locked": { - "lastModified": 1731060242, - "narHash": "sha256-43yLsOm/wxBbfYSNDWVJeVv5Ij+23X3BIjFUfsdx/6M=", + "lastModified": 1731347683, + "narHash": "sha256-BcSWCEUBShuB32LPif+EG0XGXyUi2jyjCSpGE1rbOws=", "owner": "NuschtOS", "repo": "search", - "rev": "ef493352f9e1f051e01a55c062731503a6b36b4e", + "rev": "135d202e032be70c93b6d7d53592ef4799d6efde", "type": "github" }, "original": { @@ -1114,11 +1114,11 @@ "tinted-tmux": "tinted-tmux" }, "locked": { - "lastModified": 1731537763, - "narHash": "sha256-dOjxeHAXbQ4KRe5j9uClFp8SyYY2r62bbsdraETtO84=", + "lastModified": 1731577695, + "narHash": "sha256-ohxX2gG7zDWIA3slEbiSyAVSiO98clCoL+CmiEiYwVU=", "owner": "danth", "repo": "stylix", - "rev": "be94701ce7b746cb020e667f71492e398ed470f4", + "rev": "e0a278871b63b1800ccdda568861b5324dd93797", "type": "github" }, "original": {