commit 45370b0e17bdd431f8d005f0f87dd63db0217db5
parent 0fdf8e1251a4798a7603c2386f5620a950519c5c
Author: Leah (ctucx) <leah@ctu.cx>
Date: Thu, 4 Mar 2021 15:25:24 +0100
parent 0fdf8e1251a4798a7603c2386f5620a950519c5c
Author: Leah (ctucx) <leah@ctu.cx>
Date: Thu, 4 Mar 2021 15:25:24 +0100
update pleroma version
3 files changed, 26 insertions(+), 29 deletions(-)
M
|
43
++++++++++++++++++++-----------------------
diff --git a/pleroma/0001-PATCH-Separate-webfinger-domain-from-host-domain.patch b/pleroma/0001-PATCH-Separate-webfinger-domain-from-host-domain.patch @@ -1,19 +1,19 @@ -From e46179b486fae9eeba2116dc042f145964690df7 Mon Sep 17 00:00:00 2001 +From 2a57ef2f0aaaec3bc2d8061368d23f02bbd09452 Mon Sep 17 00:00:00 2001 From: "Leah (ctucx)" <leah@ctu.cx> -Date: Sat, 14 Nov 2020 18:30:54 +0100 -Subject: [PATCH] [PATCH] Separate webfinger domain from host domain +Date: Wed, 3 Mar 2021 19:19:59 +0100 +Subject: [PATCH] Separate webfinger domain from host domain --- lib/pleroma/web/web_finger.ex | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/lib/pleroma/web/web_finger.ex b/lib/pleroma/web/web_finger.ex -index 6629f5356..0dc87eedb 100644 +index 15002b2..124367d 100644 --- a/lib/pleroma/web/web_finger.ex +++ b/lib/pleroma/web/web_finger.ex @@ -31,8 +31,15 @@ def host_meta do end - + def webfinger(resource, fmt) when fmt in ["XML", "JSON"] do + domain = Application.get_env(:pleroma, Pleroma.Web.Endpoint)[:domain] host = Pleroma.Web.Endpoint.host() @@ -25,13 +25,13 @@ index 6629f5356..0dc87eedb 100644 + else + ~r/(acct:)?(?<username>[a-z0-9A-Z_\.-]+)@#{host}/ + end - + with %{"username" => username} <- Regex.named_captures(regex, resource), %User{} = user <- User.get_cached_by_nickname(username) do -@@ -61,8 +68,15 @@ defp gather_links(%User{} = user) do +@@ -65,8 +72,15 @@ defp gather_aliases(%User{} = user) do def represent_user(user, "JSON") do {:ok, user} = User.ensure_keys_present(user) - + + host = + if Application.get_env(:pleroma, Pleroma.Web.Endpoint)[:domain] do + Application.get_env(:pleroma, Pleroma.Web.Endpoint)[:domain] @@ -42,13 +42,13 @@ index 6629f5356..0dc87eedb 100644 %{ - "subject" => "acct:#{user.nickname}@#{Pleroma.Web.Endpoint.host()}", + "subject" => "acct:#{user.nickname}@#{host}", - "aliases" => [user.ap_id], + "aliases" => gather_aliases(user), "links" => gather_links(user) } -@@ -71,6 +85,13 @@ def represent_user(user, "JSON") do - def represent_user(user, "XML") do - {:ok, user} = User.ensure_keys_present(user) - +@@ -84,11 +98,18 @@ def represent_user(user, "XML") do + gather_links(user) + |> Enum.map(fn link -> {:Link, link} end) + + host = + if Application.get_env(:pleroma, Pleroma.Web.Endpoint)[:domain] do + Application.get_env(:pleroma, Pleroma.Web.Endpoint)[:domain] @@ -56,18 +56,15 @@ index 6629f5356..0dc87eedb 100644 + Pleroma.Web.Endpoint.host() + end + - links = - gather_links(user) - |> Enum.map(fn link -> {:Link, link} end) -@@ -79,7 +100,7 @@ def represent_user(user, "XML") do + { :XRD, %{xmlns: "http://docs.oasis-open.org/ns/xri/xrd-1.0"}, [ -- {:Subject, "acct:#{user.nickname}@#{Pleroma.Web.Endpoint.host()}"}, -+ {:Subject, "acct:#{user.nickname}@#{host}"}, - {:Alias, user.ap_id} - ] ++ links +- {:Subject, "acct:#{user.nickname}@#{Pleroma.Web.Endpoint.host()}"} ++ {:Subject, "acct:#{user.nickname}@#{host}"} + ] ++ aliases ++ links } --- -2.29.2 + |> XmlBuilder.to_doc() +-- +2.30.1
diff --git a/pleroma/APKBUILD b/pleroma/APKBUILD @@ -1,8 +1,8 @@ # Contributor: Leah (ctucx) <leah@ctu.cx> # Maintainer: Leah (ctucx) <leah@ctu.cx> pkgname=pleroma -pkgver=2.2.2 -pkgrel=0 +pkgver=2.3.0 +pkgrel=1 pkgdesc="Pleroma ActivityPub Server" url="https://pleroma.social/" arch="all" @@ -19,7 +19,7 @@ builddir="${srcdir}/${pkgname}-${pkgver}" prepare() { mkdir ${builddir}; - git clone -b "release/${pkgver}" "${giturl}" "${builddir}"; + git clone --depth 1 --branch "v${pkgver}" "${giturl}" "${builddir}"; cd ${builddir}; git am < ../0001-PATCH-Separate-webfinger-domain-from-host-domain.patch; } @@ -43,6 +43,6 @@ package() { find . -type f -exec install -Dm 755 "{}" "${pkgdir}/usr/lib/pleroma/{}" \; } -sha512sums="06af4175bb1834e0901d4f6d23ef76d586c49429cad230aa8c0b7162dbca5c8e2794892792dca88b934f302dc9464f270aa6dee27854cfec61f788f972d0ec76 0001-PATCH-Separate-webfinger-domain-from-host-domain.patch -f7b624f2aaadc45e84486e94666a10ec590c7352a06187943d7ade913dbcd2096f5b0d90378eadd0e1255003711c0247596033cec42b1bd04e33e35c49950211 initd.patch +sha512sums="2b45cbf7f6ec23e2d0811113a13b2573b95aff8588036b974fece07752279a61720961f64114a2bf3335011083298e28a5fbc95bf91e76c27b923b011c4e0e69 0001-PATCH-Separate-webfinger-domain-from-host-domain.patch +d5e4fdbdcc5ec7c16db901618e1cb97efaf7b7a5e2a3969bd89c7ebe3a5c251fe2dd6ecdc9d75de0d417c73b11dac00355ffde7733b777cef62fb0aade6cc49e initd.patch 776d1e1d929243aa0b3de2f2e149eb27e0c6fff2c891aac7aac98d4f3eaa1188e28deb5b71cccba0cc8d02dfc606cdf4bcd8783855838700753bfe6b8109bf23 pleroma.sample.exs"
diff --git a/pleroma/initd.patch b/pleroma/initd.patch @@ -8,7 +8,7 @@ +directory=/usr/lib/pleroma -command=/opt/pleroma/bin/pleroma -+command="RELEASE_TMP=/tmp/pleroma /usr/lib/pleroma/bin/pleroma" ++command="/usr/lib/pleroma/bin/pleroma" command_args="start" command_user=pleroma command_background=1