ctucx.git: alpine-pkgs

My personal alpine-packages [deprecated in favor of nixos]

commit 1906b5456ff835c8da11b9dd29773b2d64bbe892
parent 1bb4e2e8bba3c1c41bc029fb3a1fa3299336d636
Author: Linux User <leah@foo-nuc.localdomain>
Date: Mon, 16 Nov 2020 13:05:05 +0100

update pleroma
8 files changed, 207 insertions(+), 0 deletions(-)
A
frp/APKBUILD
|
36
++++++++++++++++++++++++++++++++++++
A
frp/chartsrv.confd
|
3
+++
A
frp/chartsrv.initd
|
15
+++++++++++++++
A
frp/chartsrv.pre-install
|
6
++++++
A
pleroma/0001-PATCH-Separate-webfinger-domain-from-host-domain.patch
|
73
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
pleroma/APKBUILD
|
45
+++++++++++++++++++++++++++++++++++++++++++++
A
pleroma/initd.patch
|
23
+++++++++++++++++++++++
A
pleroma/pleroma.pre-install
|
6
++++++
diff --git a/frp/APKBUILD b/frp/APKBUILD
@@ -0,0 +1,36 @@
+# Contributor:
+# Maintainer:
+pkgname=chartsrv
+pkgver=0.0.1
+pkgrel=0
+pkgdesc="Daemon which renders SVG plots from Prometheus data"
+url="https://git.sr.ht/~sircmpwn/chartsrv"
+arch="all"
+license="MIT"
+depends=""
+makedepends="go"
+install="$pkgname.pre-install"
+subpackages=""
+source="$pkgname.tar.gz::https://git.sr.ht/~sircmpwn/chartsrv/archive/master.tar.gz
+        $pkgname.initd
+        $pkgname.confd"
+builddir="$srcdir/$pkgname-master/"
+
+build() {
+	cd $builddir
+	go build -o chartsrv main.go
+}
+
+check() {
+	:
+}
+
+package() {
+        install -Dm755 "$builddir"/$pkgname "$pkgdir"/usr/bin/$pkgname
+	install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
+	install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
+}
+
+sha512sums="afaf5b6d49cf7df9c771b7da671c2b783b8b2b0c8ad10c59fc722b3835a33a60a5a4f58c246b8935a7fcafbfcba7b37b04354eb66118f4a384aba1635e9eb1b0  chartsrv.tar.gz
+eaa40ace4ca554d015939da4a2fce8c12260d5a4d6741494766bbfc59ba3ccbd2acccfe1097ff4ac07f116758ba3ddd9899960572196513ea4641706cd45608c  chartsrv.initd
+81d514b4f3773d4a28808cd72f32a8a080be388086919e718bff9128b40c2e491973e9d6cc2d94f2b45a64966cbdcc92a3945556b31904937c443f73a2e1a347  chartsrv.confd"
diff --git a/frp/chartsrv.confd b/frp/chartsrv.confd
@@ -0,0 +1,3 @@
+# Configuration for /etc/init.d/chartsrv
+
+chartsrv_opts=""
diff --git a/frp/chartsrv.initd b/frp/chartsrv.initd
@@ -0,0 +1,15 @@
+#!/sbin/openrc-run
+supervisor=supervise-daemon
+
+name="chartsrv"
+description="Daemon which renders SVG plots from Prometheus data"
+
+command="/usr/bin/chartsrv"
+command_args="$chartsrv_opts"
+command_user=chartsrv:chartsrv
+directory="/var/lib/$RC_SVCNAME"
+
+depend() {
+	need net localmount
+	after firewall
+}	
diff --git a/frp/chartsrv.pre-install b/frp/chartsrv.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S chartsrv 2>/dev/null
+adduser -S -D -h /var/lib/chartsrv -s /sbin/nologin -G chartsrv -g chartsrv chartsrv 2>/dev/null
+
+exit 0
diff --git a/pleroma/0001-PATCH-Separate-webfinger-domain-from-host-domain.patch b/pleroma/0001-PATCH-Separate-webfinger-domain-from-host-domain.patch
@@ -0,0 +1,73 @@
+From e46179b486fae9eeba2116dc042f145964690df7 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
+
+---
+ 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
+--- 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()
+-    regex = ~r/(acct:)?(?<username>[a-z0-9A-Z_\.-]+)@#{host}/
++
++    regex =
++      if domain do
++        ~r/(acct:)?(?<username>[a-z0-9A-Z_\.-]+)@(#{host}|#{domain})/
++      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
+   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]
++      else
++        Pleroma.Web.Endpoint.host()
++      end
++
+     %{
+-      "subject" => "acct:#{user.nickname}@#{Pleroma.Web.Endpoint.host()}",
++      "subject" => "acct:#{user.nickname}@#{host}",
+       "aliases" => [user.ap_id],
+       "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)
+ 
++    host =
++      if Application.get_env(:pleroma, Pleroma.Web.Endpoint)[:domain] do
++        Application.get_env(:pleroma, Pleroma.Web.Endpoint)[:domain]
++      else
++        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
+     }
+-- 
+2.29.2
+
diff --git a/pleroma/APKBUILD b/pleroma/APKBUILD
@@ -0,0 +1,45 @@
+# Contributor:
+# Maintainer:
+pkgname=pleroma
+pkgver=2.2.0
+pkgrel=6
+pkgdesc="Pleroma ActivityPub Server"
+url="https://pleroma.social/"
+arch="all"
+license="MIT"
+depends="postgresql postgresql-contrib openssl exiftool imagemagick"
+makedepends="git build-base file-dev postgresql elixir erlang erlang-reltool cmake"
+install="$pkgname.pre-install"
+subpackages=""
+giturl="https://git.pleroma.social/pleroma/pleroma"
+source="0001-PATCH-Separate-webfinger-domain-from-host-domain.patch
+	initd.patch"
+builddir="$srcdir/$pkgname-$pkgver"
+
+prepare() {
+	mkdir $builddir;
+	git clone -b "release/${pkgver}" "${giturl}" "${builddir}";
+	cd $builddir;
+	git am < ../0001-PATCH-Separate-webfinger-domain-from-host-domain.patch;
+}
+
+build() {
+	cd $builddir;
+	mix deps.get;
+	echo 'import Mix.Config' > config/prod.secret.exs;
+	MIX_ENV=prod mix release --path ./output;
+	patch output/installation/init.d/pleroma $srcdir/initd.patch
+}
+
+check() {
+	:
+}
+
+package() {
+	install -Dm755 "${builddir}/output/installation/init.d/pleroma" "{$pkgdir}/etc/init.d/pleroma"
+	cd ${builddir}/output;
+	find . -type f -exec install -Dm 755 "{}" "${pkgdir}/usr/share/pleroma/{}" \;
+}
+
+sha512sums="06af4175bb1834e0901d4f6d23ef76d586c49429cad230aa8c0b7162dbca5c8e2794892792dca88b934f302dc9464f270aa6dee27854cfec61f788f972d0ec76  0001-PATCH-Separate-webfinger-domain-from-host-domain.patch
+0960795015900a22c6a22729c1cabe5bb2ad0d55f35239d475f494f45b020f479d609186bc74ab1a558d753df651376667f5e9663a9ad1743b847e0e5bd9c0c5  initd.patch"
diff --git a/pleroma/initd.patch b/pleroma/initd.patch
@@ -0,0 +1,23 @@
+--- pleroma/installation/init.d/pleroma
++++ pleroma2/installation/init.d/pleroma
+@@ -3,9 +3,9 @@
+ supervisor=supervise-daemon
+
+ # Requires OpenRC >= 0.35
+-directory=/opt/pleroma
++directory=/usr/share/pleroma
+
+-command=/opt/pleroma/bin/pleroma
++command="RELEASE_TMP=/tmp/pleroma /usr/share/pleroma/bin/pleroma"
+ command_args="start"
+ command_user=pleroma
+ command_background=1
+@@ -18,4 +18,8 @@
+ depend() {
+     want nginx
+     need postgresql
++}
++
++start_pre() {
++    checkpath -d -o pleroma:pleroma /usr/shareß/maddy
+ }
diff --git a/pleroma/pleroma.pre-install b/pleroma/pleroma.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup pleroma
+adduser -S -s /bin/false -h /usr/share/pleroma -H -G pleroma pleroma
+
+exit 0