ctucx.git: alpine-pkgs

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

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

update pleroma
3 files changed, 101 insertions(+), 6 deletions(-)
M
pleroma/APKBUILD
|
14
++++++++------
A
pleroma/pleroma.post-deinstall
|
6
++++++
A
pleroma/pleroma.sample.exs
|
87
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
diff --git a/pleroma/APKBUILD b/pleroma/APKBUILD
@@ -2,18 +2,19 @@
 # Maintainer:
 pkgname=pleroma
 pkgver=2.2.0
-pkgrel=6
+pkgrel=8
 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"
+makedepends="git build-base file-dev postgresql elixir erlang cmake"
+install="$pkgname.pre-install $pkgname.post-deinstall"
 subpackages=""
 giturl="https://git.pleroma.social/pleroma/pleroma"
 source="0001-PATCH-Separate-webfinger-domain-from-host-domain.patch
-	initd.patch"
+	initd.patch
+	pleroma.sample.exs"
 builddir="$srcdir/$pkgname-$pkgver"
 
 prepare() {

@@ -36,9 +37,10 @@ check() {
 }
 
 package() {
-	install -Dm755 "${builddir}/output/installation/init.d/pleroma" "{$pkgdir}/etc/init.d/pleroma"
+	install -Dm755 "${srcdir}/pleroma.sample.exs" "${pkgdir}/etc/pleroma/config.sample.exs}";
+	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/{}" \;
+	find . -type f -exec install -Dm 755 "{}" "${pkgdir}/usr/lib/pleroma/{}" \;
 }
 
 sha512sums="06af4175bb1834e0901d4f6d23ef76d586c49429cad230aa8c0b7162dbca5c8e2794892792dca88b934f302dc9464f270aa6dee27854cfec61f788f972d0ec76  0001-PATCH-Separate-webfinger-domain-from-host-domain.patch
diff --git a/pleroma/pleroma.post-deinstall b/pleroma/pleroma.post-deinstall
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+deluser pleroma;
+delgroup pleroma;
+
+exit 0
diff --git a/pleroma/pleroma.sample.exs b/pleroma/pleroma.sample.exs
@@ -0,0 +1,87 @@
+import Config
+
+config :pleroma, Pleroma.Web.Endpoint,
+  url: [host: "pleroma.example.com", scheme: "https", port: 443],
+  http: [ip: {127, 0, 0, 1}, port: 4000]
+
+config :pleroma, Pleroma.Repo,
+  adapter:    Ecto.Adapters.Postgres,
+  username:   "pleroma",
+  database:   "pleroma",
+  socket_dir: "/run/postgresql",
+  pool_size: 10
+
+
+# We can't store the secrets in this file, since this is baked into the docker image
+if not File.exists?("/var/lib/pleroma/secret.exs") do
+  secret = :crypto.strong_rand_bytes(64) |> Base.encode64() |> binary_part(0, 64)
+  signing_salt = :crypto.strong_rand_bytes(8) |> Base.encode64() |> binary_part(0, 8)
+  {web_push_public_key, web_push_private_key} = :crypto.generate_key(:ecdh, :prime256v1)
+
+  secret_file =
+    EEx.eval_string(
+      """
+      import Config
+
+      config :pleroma, Pleroma.Web.Endpoint,
+        secret_key_base: "<%= secret %>",
+        signing_salt: "<%= signing_salt %>"
+
+      config :web_push_encryption, :vapid_details,
+        public_key: "<%= web_push_public_key %>",
+        private_key: "<%= web_push_private_key %>"
+      """,
+      secret: secret,
+      signing_salt: signing_salt,
+      web_push_public_key: Base.url_encode64(web_push_public_key, padding: false),
+      web_push_private_key: Base.url_encode64(web_push_private_key, padding: false)
+    )
+
+  File.write("/var/lib/pleroma/secret.exs", secret_file)
+end
+import_config("/var/lib/pleroma/secret.exs")
+
+# Configure web push notifications
+config :web_push_encryption, :vapid_details, subject: "mailto:pleroma@example.com"
+
+config :pleroma, :database, rum_enabled: false
+config :pleroma, :instance, static_dir: "/var/lib/pleroma/static"
+config :pleroma, Pleroma.Uploaders.Local, uploads: "/var/lib/pleroma/uploads"
+
+config :pleroma, :static_fe, enabled: false
+
+config :pleroma, :frontend_configurations,
+  pleroma_fe: %{
+    theme: "breezy-dark",
+    chatDisabled: true,
+    webPushNotifications: true,
+    showFeaturesPanel: false,
+    collapseMessageWithSubject: false,
+    hideUserStats: false
+  }
+
+config :pleroma, :instance,
+  name: "pleroma",
+  email: "pleroma@example.com",
+  limit: 5000,
+  registrations_open: false,
+  invites_enabled: true,
+  account_activation_required: false,
+  remote_post_retention_days: 50,
+  external_user_synchronization: true,
+  allowed_post_formats: [
+    "text/plain",
+    "text/html",
+    "text/markdown"
+  ]
+
+config :pleroma, :media_proxy,
+  enabled: false,
+  redirect_on_failure: true,
+  base_url: "https://cache.domain.tld"
+
+config :pleroma, :fetch_initial_posts,
+  enabled: false,
+  pages: 1
+
+config :pleroma, :chat, enabled: false