forked from AkkomaGang/akkoma
Compare commits
3 commits
104d8dcc1f
...
ce517ff4e5
Author | SHA1 | Date | |
---|---|---|---|
|
ce517ff4e5 | ||
9addd8f414 | |||
|
067bd17e1e |
5 changed files with 183 additions and 36 deletions
85
.gitea/issue_template/bug.yml
Normal file
85
.gitea/issue_template/bug.yml
Normal file
|
@ -0,0 +1,85 @@
|
|||
name: "Bug report"
|
||||
about: "Something isn't working as expected"
|
||||
title: "[bug] "
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to file this bug report! Please try to be as specific and detailed as you can, so we can track down the issue and fix it as soon as possible.
|
||||
|
||||
# General information
|
||||
- type: dropdown
|
||||
id: installation
|
||||
attributes:
|
||||
label: "Your setup"
|
||||
description: "What sort of installation are you using?"
|
||||
options:
|
||||
- "OTP"
|
||||
- "From source"
|
||||
- "Docker"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: setup-details
|
||||
attributes:
|
||||
label: "Extra details"
|
||||
description: "If installing from source or docker, please specify your distro or docker setup."
|
||||
placeholder: "e.g. Alpine Linux edge"
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: "Version"
|
||||
description: "Which version of Akkoma are you running? If running develop, specify the commit hash."
|
||||
placeholder: "e.g. 2022.11, 4e4bd248"
|
||||
- type: input
|
||||
id: postgres
|
||||
attributes:
|
||||
label: "PostgreSQL version"
|
||||
placeholder: "14"
|
||||
validations:
|
||||
required: true
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "# The issue"
|
||||
- type: textarea
|
||||
id: attempt
|
||||
attributes:
|
||||
label: "What were you trying to do?"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: expectation
|
||||
attributes:
|
||||
label: "What did you expect to happen?"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: reality
|
||||
attributes:
|
||||
label: "What actually happened?"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: logs
|
||||
attributes:
|
||||
label: "Logs"
|
||||
description: "Please copy and paste any relevant log output, if applicable."
|
||||
render: shell
|
||||
- type: dropdown
|
||||
id: severity
|
||||
attributes:
|
||||
label: "Severity"
|
||||
description: "Does this issue prevent you from using the software as normal?"
|
||||
options:
|
||||
- "I cannot use the software"
|
||||
- "I cannot use it as easily as I'd like"
|
||||
- "I can manage"
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
id: searched
|
||||
attributes:
|
||||
label: "Have you searched for this issue?"
|
||||
description: "Please double-check that your issue is not already being tracked on [the forums](https://meta.akkoma.dev) or [the issue tracker](https://akkoma.dev/AkkomaGang/akkoma/issues)."
|
||||
options:
|
||||
- label: "I have double-checked and have not found this issue mentioned anywhere."
|
29
.gitea/issue_template/feat.yml
Normal file
29
.gitea/issue_template/feat.yml
Normal file
|
@ -0,0 +1,29 @@
|
|||
name: "Feature request"
|
||||
about: "I'd like something to be added to Akkoma"
|
||||
title: "[feat] "
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "Thanks for taking the time to request a new feature! Please be as concise and clear as you can in your proposal, so we could understand what you're going for."
|
||||
- type: textarea
|
||||
id: idea
|
||||
attributes:
|
||||
label: "The idea"
|
||||
description: "What do you think you should be able to do in Akkoma?"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: reason
|
||||
attributes:
|
||||
label: "The reasoning"
|
||||
description: "Why would this be a worthwhile feature? Does it solve any problems? Have people talked about wanting it?"
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
id: searched
|
||||
attributes:
|
||||
label: "Have you searched for this feature request?"
|
||||
description: "Please double-check that your issue is not already being tracked on [the forums](https://meta.akkoma.dev), [the issue tracker](https://akkoma.dev/AkkomaGang/akkoma/issues), or the one for [pleroma-fe](https://akkoma.dev/AkkomaGang/pleroma-fe/issues)."
|
||||
options:
|
||||
- label: "I have double-checked and have not found this feature request mentioned anywhere."
|
||||
- label: "This feature is related to the Akkoma backend specifically, and not pleroma-fe."
|
|
@ -1,27 +0,0 @@
|
|||
---
|
||||
|
||||
name: "Issue"
|
||||
about: "Something isn't working as expected"
|
||||
|
||||
---
|
||||
|
||||
## Your setup
|
||||
|
||||
[] OTP
|
||||
[] From Source
|
||||
[] Distro:
|
||||
[] Docker (what setup?)
|
||||
|
||||
Postgres version:
|
||||
|
||||
## What were you trying to do?
|
||||
|
||||
## What did you expect to happen?
|
||||
|
||||
## What actually happened?
|
||||
|
||||
## Relative severity (does this prevent you from using the software as normal?)
|
||||
|
||||
[] I cannot use the software
|
||||
[] I cannot use it as easily as I'd like
|
||||
[] I can manage
|
|
@ -27,22 +27,22 @@ defmodule Pleroma.Web.ActivityPub.MRF.TagPolicy do
|
|||
defp process_tag(
|
||||
"mrf_tag:media-force-nsfw",
|
||||
%{
|
||||
"type" => "Create",
|
||||
"type" => type,
|
||||
"object" => %{"attachment" => child_attachment}
|
||||
} = message
|
||||
)
|
||||
when length(child_attachment) > 0 do
|
||||
when length(child_attachment) > 0 and type in ["Create", "Update"] do
|
||||
{:ok, Kernel.put_in(message, ["object", "sensitive"], true)}
|
||||
end
|
||||
|
||||
defp process_tag(
|
||||
"mrf_tag:media-strip",
|
||||
%{
|
||||
"type" => "Create",
|
||||
"type" => type,
|
||||
"object" => %{"attachment" => child_attachment} = object
|
||||
} = message
|
||||
)
|
||||
when length(child_attachment) > 0 do
|
||||
when length(child_attachment) > 0 and type in ["Create", "Update"] do
|
||||
object = Map.delete(object, "attachment")
|
||||
message = Map.put(message, "object", object)
|
||||
|
||||
|
@ -52,13 +52,13 @@ defmodule Pleroma.Web.ActivityPub.MRF.TagPolicy do
|
|||
defp process_tag(
|
||||
"mrf_tag:force-unlisted",
|
||||
%{
|
||||
"type" => "Create",
|
||||
"type" => type,
|
||||
"to" => to,
|
||||
"cc" => cc,
|
||||
"actor" => actor,
|
||||
"object" => object
|
||||
} = message
|
||||
) do
|
||||
) when type in ["Create", "Update"] do
|
||||
user = User.get_cached_by_ap_id(actor)
|
||||
|
||||
if Enum.member?(to, Pleroma.Constants.as_public()) do
|
||||
|
@ -85,13 +85,13 @@ defmodule Pleroma.Web.ActivityPub.MRF.TagPolicy do
|
|||
defp process_tag(
|
||||
"mrf_tag:sandbox",
|
||||
%{
|
||||
"type" => "Create",
|
||||
"type" => type,
|
||||
"to" => to,
|
||||
"cc" => cc,
|
||||
"actor" => actor,
|
||||
"object" => object
|
||||
} = message
|
||||
) do
|
||||
) when type in ["Create", "Update"] do
|
||||
user = User.get_cached_by_ap_id(actor)
|
||||
|
||||
if Enum.member?(to, Pleroma.Constants.as_public()) or
|
||||
|
@ -152,7 +152,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.TagPolicy do
|
|||
do: filter_message(target_actor, message)
|
||||
|
||||
@impl true
|
||||
def filter(%{"actor" => actor, "type" => "Create"} = message),
|
||||
def filter(%{"actor" => actor, "type" => type} = message) when type in ["Create", "Update"],
|
||||
do: filter_message(actor, message)
|
||||
|
||||
@impl true
|
||||
|
|
|
@ -53,7 +53,24 @@ defmodule Pleroma.Web.ActivityPub.MRF.TagPolicyTest do
|
|||
"cc" => ["d"]
|
||||
}
|
||||
|
||||
edit_message = %{
|
||||
"actor" => actor.ap_id,
|
||||
"type" => "Update",
|
||||
"object" => %{},
|
||||
"to" => [@public, "f"],
|
||||
"cc" => [@public, "d"]
|
||||
}
|
||||
|
||||
edit_expect_message = %{
|
||||
"actor" => actor.ap_id,
|
||||
"type" => "Update",
|
||||
"object" => %{"to" => ["f", actor.follower_address], "cc" => ["d"]},
|
||||
"to" => ["f", actor.follower_address],
|
||||
"cc" => ["d"]
|
||||
}
|
||||
|
||||
assert TagPolicy.filter(message) == {:ok, except_message}
|
||||
assert TagPolicy.filter(edit_message) == {:ok, edit_expect_message}
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -77,7 +94,24 @@ defmodule Pleroma.Web.ActivityPub.MRF.TagPolicyTest do
|
|||
"cc" => ["d", @public]
|
||||
}
|
||||
|
||||
edit_message = %{
|
||||
"actor" => actor.ap_id,
|
||||
"type" => "Update",
|
||||
"object" => %{},
|
||||
"to" => [@public, "f"],
|
||||
"cc" => [actor.follower_address, "d"]
|
||||
}
|
||||
|
||||
edit_expect_message = %{
|
||||
"actor" => actor.ap_id,
|
||||
"type" => "Update",
|
||||
"object" => %{"to" => ["f", actor.follower_address], "cc" => ["d", @public]},
|
||||
"to" => ["f", actor.follower_address],
|
||||
"cc" => ["d", @public]
|
||||
}
|
||||
|
||||
assert TagPolicy.filter(message) == {:ok, except_message}
|
||||
assert TagPolicy.filter(edit_message) == {:ok, edit_expect_message}
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -97,7 +131,20 @@ defmodule Pleroma.Web.ActivityPub.MRF.TagPolicyTest do
|
|||
"object" => %{}
|
||||
}
|
||||
|
||||
edit_message = %{
|
||||
"actor" => actor.ap_id,
|
||||
"type" => "Update",
|
||||
"object" => %{"attachment" => ["file1"]}
|
||||
}
|
||||
|
||||
edit_expect_message = %{
|
||||
"actor" => actor.ap_id,
|
||||
"type" => "Update",
|
||||
"object" => %{}
|
||||
}
|
||||
|
||||
assert TagPolicy.filter(message) == {:ok, except_message}
|
||||
assert TagPolicy.filter(edit_message) == {:ok, edit_expect_message}
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -117,7 +164,20 @@ defmodule Pleroma.Web.ActivityPub.MRF.TagPolicyTest do
|
|||
"object" => %{"tag" => ["test"], "attachment" => ["file1"], "sensitive" => true}
|
||||
}
|
||||
|
||||
edit_message = %{
|
||||
"actor" => actor.ap_id,
|
||||
"type" => "Update",
|
||||
"object" => %{"tag" => ["test"], "attachment" => ["file1"]}
|
||||
}
|
||||
|
||||
edit_expect_message = %{
|
||||
"actor" => actor.ap_id,
|
||||
"type" => "Update",
|
||||
"object" => %{"tag" => ["test"], "attachment" => ["file1"], "sensitive" => true}
|
||||
}
|
||||
|
||||
assert TagPolicy.filter(message) == {:ok, except_message}
|
||||
assert TagPolicy.filter(edit_message) == {:ok, edit_expect_message}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue