|> String.trim()
commit_hash_err == 0 ->
- "0-g" <> String.trim(commit_hash)
+ "-g" <> String.trim(commit_hash)
true ->
nil
{
"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",
{
"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",
<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>
--- /dev/null
+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
--- /dev/null
+# 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
--- /dev/null
+# 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