From f436f8fcdb6a9116546b69f5e5a524fa4e0b5ff2 Mon Sep 17 00:00:00 2001 From: emily Date: Thu, 14 Nov 2024 16:46:00 +0100 Subject: [PATCH] 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 = {