forked from AkkomaGang/akkoma
ensure tests pass
This commit is contained in:
parent
4fb2251221
commit
829ae13572
4 changed files with 52 additions and 4 deletions
28
README.md
28
README.md
|
@ -1,3 +1,31 @@
|
||||||
|
## akkoma
|
||||||
|
|
||||||
|
*a smallish microblogging platform, aka the cooler pleroma*
|
||||||
|
|
||||||
|
### Why though?
|
||||||
|
|
||||||
|
pleroma as a project has stagnated of late. after a spat between
|
||||||
|
developers led to a fork (which died due to chronic lack of direction),
|
||||||
|
nearly nobody seems to _want_ to work on it. this in addition to the
|
||||||
|
BDFL being AWOL whenever needed, means that the entire project is
|
||||||
|
nought but a power vacuum waiting for someone to step in. and with the
|
||||||
|
track record pleroma has, i do not trust that whoever steps in will be
|
||||||
|
good for the project.
|
||||||
|
|
||||||
|
thus, i am striking out on my own. i already had a few modifications
|
||||||
|
on my instance, so it wasn't a particularly large leap to assume direct
|
||||||
|
control.
|
||||||
|
|
||||||
|
### But really, why should I migrate to your thing?
|
||||||
|
|
||||||
|
aside from me actually being responsive? let's lookie here, we've got
|
||||||
|
- custom emoji reactions
|
||||||
|
- misskey markdown (MFM) rendering and posting support
|
||||||
|
- elasticsearch support (because pleroma search is GARBAGE)
|
||||||
|
- latest develop pleroma-fe additions
|
||||||
|
- local-only posting
|
||||||
|
- probably more, this is like 3.5 years of IHBA additions finally compiled
|
||||||
|
|
||||||
## Upgrading to Akkoma
|
## Upgrading to Akkoma
|
||||||
|
|
||||||
### From source
|
### From source
|
||||||
|
|
|
@ -81,16 +81,24 @@ defp fix_replies(%{"replies" => %{"first" => first}} = data) do
|
||||||
defp fix_replies(data), do: data
|
defp fix_replies(data), do: data
|
||||||
|
|
||||||
# https://github.com/misskey-dev/misskey/pull/8787
|
# https://github.com/misskey-dev/misskey/pull/8787
|
||||||
defp fix_misskey_content(%{"source" => %{"mediaType" => "text/x.misskeymarkdown"}} = object), do: object
|
defp fix_misskey_content(%{"source" => %{"mediaType" => "text/x.misskeymarkdown"}} = object),
|
||||||
|
do: object
|
||||||
|
|
||||||
defp fix_misskey_content(%{"_misskey_content" => content} = object) do
|
defp fix_misskey_content(%{"_misskey_content" => content} = object) do
|
||||||
object
|
object
|
||||||
|> Map.put("source", %{"content" => content, "mediaType" => "text/x.misskeymarkdown" })
|
|> Map.put("source", %{"content" => content, "mediaType" => "text/x.misskeymarkdown"})
|
||||||
|> Map.delete("_misskey_content")
|
|> Map.delete("_misskey_content")
|
||||||
end
|
end
|
||||||
|
|
||||||
defp fix_misskey_content(data), do: data
|
defp fix_misskey_content(data), do: data
|
||||||
|
|
||||||
|
defp fix_source(%{"source" => source} = object) when is_binary(source) do
|
||||||
|
object
|
||||||
|
|> Map.put("source", %{"content" => source})
|
||||||
|
end
|
||||||
|
|
||||||
|
defp fix_source(object), do: object
|
||||||
|
|
||||||
defp fix(data) do
|
defp fix(data) do
|
||||||
data
|
data
|
||||||
|> CommonFixes.fix_actor()
|
|> CommonFixes.fix_actor()
|
||||||
|
@ -98,6 +106,7 @@ defp fix(data) do
|
||||||
|> fix_url()
|
|> fix_url()
|
||||||
|> fix_tag()
|
|> fix_tag()
|
||||||
|> fix_replies()
|
|> fix_replies()
|
||||||
|
|> fix_source()
|
||||||
|> fix_misskey_content()
|
|> fix_misskey_content()
|
||||||
|> Transmogrifier.fix_emoji()
|
|> Transmogrifier.fix_emoji()
|
||||||
|> Transmogrifier.fix_content_map()
|
|> Transmogrifier.fix_content_map()
|
||||||
|
|
|
@ -586,7 +586,11 @@ test "it filters out obviously bad tags when accepting a post as HTML" do
|
||||||
object = Object.normalize(activity, fetch: false)
|
object = Object.normalize(activity, fetch: false)
|
||||||
|
|
||||||
assert object.data["content"] == "<p><b>2hu</b></p>alert('xss')"
|
assert object.data["content"] == "<p><b>2hu</b></p>alert('xss')"
|
||||||
assert object.data["source"] == post
|
|
||||||
|
assert object.data["source"] == %{
|
||||||
|
"mediaType" => "text/html",
|
||||||
|
"content" => post
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
test "it filters out obviously bad tags when accepting a post as Markdown" do
|
test "it filters out obviously bad tags when accepting a post as Markdown" do
|
||||||
|
@ -603,7 +607,11 @@ test "it filters out obviously bad tags when accepting a post as Markdown" do
|
||||||
object = Object.normalize(activity, fetch: false)
|
object = Object.normalize(activity, fetch: false)
|
||||||
|
|
||||||
assert object.data["content"] == "<p><b>2hu</b></p>"
|
assert object.data["content"] == "<p><b>2hu</b></p>"
|
||||||
assert object.data["source"] == post
|
|
||||||
|
assert object.data["source"] == %{
|
||||||
|
"mediaType" => "text/markdown",
|
||||||
|
"content" => post
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
test "it does not allow replies to direct messages that are not direct messages themselves" do
|
test "it does not allow replies to direct messages that are not direct messages themselves" do
|
||||||
|
|
|
@ -302,6 +302,9 @@ test "a note activity" do
|
||||||
emoji_reactions: [],
|
emoji_reactions: [],
|
||||||
parent_visible: false,
|
parent_visible: false,
|
||||||
pinned_at: nil
|
pinned_at: nil
|
||||||
|
},
|
||||||
|
akkoma: %{
|
||||||
|
source: HTML.filter_tags(object_data["content"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue