Nothing much just a build up of things master
authordcc <dcc@logografos.com>
Sat, 17 Feb 2024 01:19:33 +0000 (17:19 -0800)
committerdcc <dcc@logografos.com>
Sat, 17 Feb 2024 01:19:33 +0000 (17:19 -0800)
21 files changed:
mix.exs
static/emoji/anni/att.png [new file with mode: 0644]
static/emoji/anni/columbo_smug.png [new file with mode: 0644]
static/emoji/anni/devil_triger.gif [new file with mode: 0644]
static/emoji/anni/francisco.png [new file with mode: 0644]
static/emoji/anni/francisco_intensifies.png [new file with mode: 0644]
static/emoji/anni/george_shiggy.png [new file with mode: 0644]
static/emoji/anni/goblin_slayer_bask_in_blood.png [new file with mode: 0644]
static/emoji/anni/lay_off_poggers.png [new file with mode: 0644]
static/emoji/anni/nero_smug.png [new file with mode: 0644]
static/emoji/anni/nixon_smug.png [new file with mode: 0644]
static/emoji/anni/pack.json
static/emoji/anni/pack.json~
static/emoji/anni/pepe_cia.png [new file with mode: 0644]
static/emoji/anni/pepe_turkey.png [new file with mode: 0644]
static/emoji/anni/trust_the_pfp.png [new file with mode: 0644]
static/emoji/anni/tucker_shock.png [new file with mode: 0644]
static/instance/panel.html
static/modules/auto_untagger_policy.ex [new file with mode: 0644]
static/modules/inline_quote_policy.ex [new file with mode: 0644]
static/modules/lock_smasher.ex [new file with mode: 0644]

diff --git a/mix.exs b/mix.exs
index aaaaf5b59d83ccb0b2ee6e07d0e94358f23a9c02..be580092b830fcc5b08101a683ff335a7119b4aa 100755 (executable)
--- a/mix.exs
+++ b/mix.exs
@@ -264,7 +264,7 @@ defmodule Pleroma.Mixfile do
             |> String.trim()
 
           commit_hash_err == 0 ->
-            "0-g" <> String.trim(commit_hash)
+            "-g" <> String.trim(commit_hash)
 
           true ->
             nil
diff --git a/static/emoji/anni/att.png b/static/emoji/anni/att.png
new file mode 100644 (file)
index 0000000..1b3a885
Binary files /dev/null and b/static/emoji/anni/att.png differ
diff --git a/static/emoji/anni/columbo_smug.png b/static/emoji/anni/columbo_smug.png
new file mode 100644 (file)
index 0000000..28d5010
Binary files /dev/null and b/static/emoji/anni/columbo_smug.png differ
diff --git a/static/emoji/anni/devil_triger.gif b/static/emoji/anni/devil_triger.gif
new file mode 100644 (file)
index 0000000..b63bd9f
Binary files /dev/null and b/static/emoji/anni/devil_triger.gif differ
diff --git a/static/emoji/anni/francisco.png b/static/emoji/anni/francisco.png
new file mode 100644 (file)
index 0000000..dd90077
Binary files /dev/null and b/static/emoji/anni/francisco.png differ
diff --git a/static/emoji/anni/francisco_intensifies.png b/static/emoji/anni/francisco_intensifies.png
new file mode 100644 (file)
index 0000000..46a3d26
Binary files /dev/null and b/static/emoji/anni/francisco_intensifies.png differ
diff --git a/static/emoji/anni/george_shiggy.png b/static/emoji/anni/george_shiggy.png
new file mode 100644 (file)
index 0000000..795ecc1
Binary files /dev/null and b/static/emoji/anni/george_shiggy.png differ
diff --git a/static/emoji/anni/goblin_slayer_bask_in_blood.png b/static/emoji/anni/goblin_slayer_bask_in_blood.png
new file mode 100644 (file)
index 0000000..db6bb2e
Binary files /dev/null and b/static/emoji/anni/goblin_slayer_bask_in_blood.png differ
diff --git a/static/emoji/anni/lay_off_poggers.png b/static/emoji/anni/lay_off_poggers.png
new file mode 100644 (file)
index 0000000..ec6b23d
Binary files /dev/null and b/static/emoji/anni/lay_off_poggers.png differ
diff --git a/static/emoji/anni/nero_smug.png b/static/emoji/anni/nero_smug.png
new file mode 100644 (file)
index 0000000..3af7126
Binary files /dev/null and b/static/emoji/anni/nero_smug.png differ
diff --git a/static/emoji/anni/nixon_smug.png b/static/emoji/anni/nixon_smug.png
new file mode 100644 (file)
index 0000000..b874251
Binary files /dev/null and b/static/emoji/anni/nixon_smug.png differ
index 59fe274f0f63d2adfbdddc14cdada37ace952855..e8f8b23a89750cbc623e7b6c29f45cedfb85a2ed 100755 (executable)
@@ -1,7 +1,21 @@
 {
   "files": {
     "mr_regan": "mrregan.png",
+    "tucker_shock": "tucker_shock.png",
+    "lay_off_poggers": "lay_off_poggers.png",
+    "trust_the_pfp": "trust_the_pfp.png",
+    "goblin_slayer_bask_in_blood": "goblin_slayer_bask_in_blood.png",
+    "nero_smug": "nero_smug.png",
     "take_it_easy": "take_it_easy.png",
+    "devil_triger": "devil_triger.gif",
+    "pepe_turkey": "pepe_turkey.png",
+    "george_shiggy": "george_shiggy.png",
+    "pepe_cia": "pepe_cia.png",
+    "columbo_smug": "columbo_smug.png",
+    "att": "att.png",
+    "francisco.png": "francisco.png",
+    "francisco_intensifies": "francisco_intensifies.png",
+    "nixon_smug": "nixon_smug.png",
     "oj_sad": "oj_sad.png",
     "phear_slackware": "phear_slackware.gif",
     "cunny": "cunny.png",
index 2db6c751c01837a55152488edacf7a49774f34bd..eef2fa11c5cc3cc76427656374fc2cb0cdf2df27 100755 (executable)
@@ -1,6 +1,20 @@
 {
   "files": {
     "mr_regan": "mrregan.png",
+    "tucker_shock": "tucker_shock.png",
+    "lay_off_poggers": "lay_off_poggers.png",
+    "trust_the_pfp": "trust_the_pfp.png",
+    "goblin_slayer_bask_in_blood": "goblin_slayer_bask_in_blood.png",
+    "nero_smug": "nero_smug.png",
+    "take_it_easy": "take_it_easy.png",
+    "pepe_turkey": "pepe_turkey.png",
+    "george_shiggy": "george_shiggy.png",
+    "pepe_cia": "pepe_cia.png",
+    "columbo_smug": "columbo_smug.png",
+    "att": "att.png",
+    "francisco.png": "francisco.png",
+    "francisco_intensifies": "francisco_intensifies.png",
+    "nixon_smug": "nixon_smug.png",
     "oj_sad": "oj_sad.png",
     "phear_slackware": "phear_slackware.gif",
     "cunny": "cunny.png",
diff --git a/static/emoji/anni/pepe_cia.png b/static/emoji/anni/pepe_cia.png
new file mode 100644 (file)
index 0000000..076369b
Binary files /dev/null and b/static/emoji/anni/pepe_cia.png differ
diff --git a/static/emoji/anni/pepe_turkey.png b/static/emoji/anni/pepe_turkey.png
new file mode 100644 (file)
index 0000000..e10c6c7
Binary files /dev/null and b/static/emoji/anni/pepe_turkey.png differ
diff --git a/static/emoji/anni/trust_the_pfp.png b/static/emoji/anni/trust_the_pfp.png
new file mode 100644 (file)
index 0000000..f1a226e
Binary files /dev/null and b/static/emoji/anni/trust_the_pfp.png differ
diff --git a/static/emoji/anni/tucker_shock.png b/static/emoji/anni/tucker_shock.png
new file mode 100644 (file)
index 0000000..86c3215
Binary files /dev/null and b/static/emoji/anni/tucker_shock.png differ
index 058219c3f7467dbef36f49a87028e74e1a936b0f..b38741c49c7e5a4f2c8a7b3c4d4eca230400f370 100755 (executable)
@@ -1,4 +1,4 @@
 <div><div style="margin-left:12px; margin-right:12px"> <h3>Welcome to annihilation</h3><p></p><p><a href="https://b.annihilation.social" rel="noopener noreferrer nofollow">Bloat</a> </p> <p><a href="https://kom.dembased.xyz/" rel="noopener noreferrer nofollow">Status</a> </p> <p><a href=" 
-http://nfg3pbejnvp4xxppglvtj7trfwhkesnsj2cxmsjlvipqnjqpedacngyd.onion" rel="noopener noreferrer nofollow">Tor</a> </p> <p><a href="https://sen.annihilation.social" rel="noopener noreferrer nofollow">Sengi</a> </p> </div></div>
+http://nfg3pbejnvp4xxppglvtj7trfwhkesnsj2cxmsjlvipqnjqpedacngyd.onion" rel="noopener noreferrer nofollow">Tor</a> </p> </div></div>
 
 
diff --git a/static/modules/auto_untagger_policy.ex b/static/modules/auto_untagger_policy.ex
new file mode 100644 (file)
index 0000000..525eb02
--- /dev/null
@@ -0,0 +1,64 @@
+defmodule Pleroma.Web.ActivityPub.MRF.AutoUntaggerPolicy do
+  @moduledoc "Automatically untags all local users from posts originating from specified instances"
+  @behaviour Pleroma.Web.ActivityPub.MRF.Policy
+
+  require Pleroma.Constants
+  alias Pleroma.Config
+
+  @impl true
+  def filter(
+        %{
+          "type" => "Create",
+          "to" => to,
+          "cc" => cc,
+          "actor" => actor,
+          "object" => object
+        } = message
+      ) do
+
+    local = Config.get([Pleroma.Web.Endpoint, :url, :host])
+    if URI.parse(actor).authority in Config.get([:mrf_auto_untagger, :domains]) do
+      object =
+        object
+        |> Map.put("to", Enum.filter(to, fn x -> URI.parse(x).authority != local end))
+        |> Map.put("cc", Enum.filter(cc, fn x -> URI.parse(x).authority != local end))
+        |> Map.put("tag", Enum.filter(object["tag"], fn x -> URI.parse(x["href"]).authority != local end))
+
+      message =
+        message
+        |> Map.put("to", Enum.filter(to, fn x -> URI.parse(x).authority != local end))
+        |> Map.put("cc", Enum.filter(cc, fn x -> URI.parse(x).authority != local end))
+        |> Map.put("object", object)
+
+      {:ok, message}
+    else
+      {:ok, message}
+    end
+  end
+
+  @impl true
+  def filter(message) do
+    {:ok, message}
+  end
+
+  @impl true
+  def describe, do: {:ok, %{}}
+
+  @impl true
+  def config_description do
+    %{
+      key: :mrf_auto_untagger,
+      related_policy: "Pleroma.Web.ActivityPub.MRF.AutoUntaggerPolicy",
+      label: "Autountagger policy",
+      description: "Automatically untags all local users from posts originating from specified instances",
+      children: [
+        %{
+          key: :domains,
+          type: {:list, :string},
+          label: "List of affected instance domains",
+          suggestions: ["freespeechextremist.com"]
+        }
+      ]
+    }
+  end
+end
diff --git a/static/modules/inline_quote_policy.ex b/static/modules/inline_quote_policy.ex
new file mode 100644 (file)
index 0000000..b7a01c2
--- /dev/null
@@ -0,0 +1,77 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.ActivityPub.MRF.InlineQuotePolicy do
+  @moduledoc "Force a quote line into the message content."
+  @behaviour Pleroma.Web.ActivityPub.MRF.Policy
+
+  defp build_inline_quote(template, url) do
+    quote_line = String.replace(template, "{url}", "<a href=\"#{url}\">#{url}</a>")
+
+    "<span class=\"quote-inline\"><br/><br/>#{quote_line}</span>"
+  end
+
+  defp has_inline_quote?(content, quote_url) do
+    cond do
+      # Does the quote URL exist in the content?
+      content =~ quote_url -> true
+      # Does the content already have a .quote-inline span?
+      content =~ "<span class=\"quote-inline\">" -> true
+      # No inline quote found
+      true -> false
+    end
+  end
+
+  defp filter_object(%{"quoteUrl" => quote_url} = object) do
+    content = object["content"] || ""
+
+    if has_inline_quote?(content, quote_url) do
+      object
+    else
+      template = Pleroma.Config.get([:mrf_inline_quote, :template])
+
+      content =
+        if String.ends_with?(content, "</p>"),
+          do:
+            String.trim_trailing(content, "</p>") <>
+              build_inline_quote(template, quote_url) <> "</p>",
+          else: content <> build_inline_quote(template, quote_url)
+
+      Map.put(object, "content", content)
+    end
+  end
+
+  @impl true
+  def filter(%{"object" => %{"quoteUrl" => _} = object} = activity) do
+    {:ok, Map.put(activity, "object", filter_object(object))}
+  end
+
+  @impl true
+  def filter(object), do: {:ok, object}
+
+  @impl true
+  def describe, do: {:ok, %{}}
+
+  @impl Pleroma.Web.ActivityPub.MRF.Policy
+  def history_awareness, do: :auto
+
+  @impl true
+  def config_description do
+    %{
+      key: :mrf_inline_quote,
+      related_policy: "Pleroma.Web.ActivityPub.MRF.InlineQuotePolicy",
+      label: "MRF Inline Quote Policy",
+      description: "Force quote url to appear in post content.",
+      children: [
+        %{
+          key: :template,
+          type: :string,
+          description:
+            "The template to append to the post. `{url}` will be replaced with the actual link to the quoted post.",
+          suggestions: ["<bdi>RT:</bdi> {url}"]
+        }
+      ]
+    }
+  end
+end
diff --git a/static/modules/lock_smasher.ex b/static/modules/lock_smasher.ex
new file mode 100644 (file)
index 0000000..a81c208
--- /dev/null
@@ -0,0 +1,63 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+# Fuck you falaichte
+defmodule Pleroma.Web.ActivityPub.MRF.LockSmasher do
+  alias Pleroma.Config
+  alias Pleroma.User
+
+  @behaviour Pleroma.Web.ActivityPub.MRF.Policy
+
+  require Pleroma.Constants
+
+  @impl true
+  def filter(
+        %{
+          "type" => "Create",
+          "to" => to,
+          "cc" => cc,
+          "actor" => actor,
+          "object" => object
+        } = message
+      ) do
+    actor_info = URI.parse(actor)
+    user = User.get_cached_by_ap_id(actor)
+    instance_domain = Config.get([Pleroma.Web.Endpoint, :url, :host])
+
+    # Determine visibility
+    visibility =
+      cond do
+        Pleroma.Constants.as_public() in to -> "public"
+        Pleroma.Constants.as_public() in cc -> "unlisted"
+        user.follower_address in to -> "followers"
+        true -> "direct"
+      end
+
+    if visibility in ["unlisted", "followers"] and actor_info.host != instance_domain do
+      to = List.delete(to, user.follower_address) ++ [Pleroma.Constants.as_public()]
+      cc = List.delete(cc, Pleroma.Constants.as_public()) ++ [user.follower_address]
+
+      object =
+        object
+        |> Map.put("to", to)
+        |> Map.put("cc", cc)
+
+      message =
+        message
+        |> Map.put("to", to)
+        |> Map.put("cc", cc)
+        |> Map.put("object", object)
+
+      {:ok, message}
+    else
+      {:ok, message}
+    end
+
+  end
+
+  @impl true
+  def filter(message), do: {:ok, message}
+
+  @impl true
+  def describe, do: {:ok, %{}}
+end