~sircmpwn/sr.ht-packages

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH lists.sr.ht-deb] Adding GraphQL API

Details
Message ID
<20220217001430.523415-1-pjs@petersanchez.com>
DKIM signature
missing
Download raw message
Patch: +45 -0
---
 debian/rules                             |  7 +++++++
 debian/srht-lists.install                |  1 +
 debian/srht-lists.postinst               |  3 +++
 debian/srht-lists.postrm                 | 21 +++++++++++++++++++++
 debian/srht-lists.srht-lists-api.service | 13 +++++++++++++
 5 files changed, 45 insertions(+)
 create mode 100644 debian/srht-lists.install
 create mode 100644 debian/srht-lists.postrm
 create mode 100644 debian/srht-lists.srht-lists-api.service

diff --git a/debian/rules b/debian/rules
index 1f0e430..3f8c644 100755
--- a/debian/rules
+++ b/debian/rules
@@ -15,9 +15,16 @@ export PYBUILD_DISABLE=test
override_dh_auto_build:
	make SRHT_PATH=${SRHT_PATH}
	dh_auto_build
	cd api && go build -o listssrht-api

override_dh_installsystemd:
	dh_installsystemd
	dh_installsystemd --name srht-lists-lmtp
	dh_installsystemd --name srht-lists-process
	dh_installsystemd --name srht-lists-webhooks
	dh_installsystemd --name srht-lists-api

override_dh_auto_clean:
	dh_auto_clean
	-rm api/listssrht-api

diff --git a/debian/srht-lists.install b/debian/srht-lists.install
new file mode 100644
index 0000000..78e29dc
--- /dev/null
+++ b/debian/srht-lists.install
@@ -0,0 +1 @@
api/listssrht-api usr/bin
diff --git a/debian/srht-lists.postinst b/debian/srht-lists.postinst
index 74c5732..cc76b0b 100644
--- a/debian/srht-lists.postinst
+++ b/debian/srht-lists.postinst
@@ -6,6 +6,9 @@ case "$1" in
    configure)
        srht-migrate lists.sr.ht -a upgrade head
        listssrht-migrate -a upgrade head

        touch /var/log/lists.sr.ht-api.log
        chown ${USER}: /var/log/lists.sr.ht-api.log
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
diff --git a/debian/srht-lists.postrm b/debian/srht-lists.postrm
new file mode 100644
index 0000000..eef3cf3
--- /dev/null
+++ b/debian/srht-lists.postrm
@@ -0,0 +1,21 @@
#!/bin/sh

set -e

case "$1" in
    purge)
        rm -f /var/log/lists.sr.ht-api.log
    ;;

    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
    ;;

    *)
        echo "postrm called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

#DEBHELPER#

exit 0
diff --git a/debian/srht-lists.srht-lists-api.service b/debian/srht-lists.srht-lists-api.service
new file mode 100644
index 0000000..1ec8bb4
--- /dev/null
+++ b/debian/srht-lists.srht-lists-api.service
@@ -0,0 +1,13 @@
[Unit]
Description=lists.sr.ht API service
Requires=redis-server.service postgresql.service
After=redis-server.service postgresql.service network.target

[Service]
Type=simple
User=listssrht
Restart=always
ExecStart=/usr/bin/listssrht-api -b :5106

[Install]
WantedBy=multi-user.target
-- 
2.34.1
Details
Message ID
<b17a35a6-46f8-d241-277b-9c9d384a2094@laxalde.org>
In-Reply-To
<20220217001430.523415-1-pjs@petersanchez.com> (view parent)
DKIM signature
missing
Download raw message
Thanks; I adjusted Build-Depends:, Depends:, and changed Architecture: 
and finally pushed as dd3b4b2aa86e6d04885bec3a7b73de37651c24f1.
Reply to thread Export thread (mbox)