~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 todo.sr.ht-deb] Adding GraphQL API

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

diff --git a/debian/rules b/debian/rules
index 4abedcb..2d27bca 100755
--- a/debian/rules
+++ b/debian/rules
@@ -15,8 +15,15 @@ export PYBUILD_DISABLE=test
override_dh_auto_build:
	make SRHT_PATH=${SRHT_PATH}
	dh_auto_build
	cd api && go build -o todosrht-api

override_dh_installsystemd:
	dh_installsystemd
	dh_installsystemd --name srht-todo-lmtp
	dh_installsystemd --name srht-todo-webhooks
	dh_installsystemd --name srht-todo-api

override_dh_auto_clean:
	dh_auto_clean
	-rm api/todosrht-api

diff --git a/debian/srht-todo.install b/debian/srht-todo.install
new file mode 100644
index 0000000..e3cd240
--- /dev/null
+++ b/debian/srht-todo.install
@@ -0,0 +1 @@
api/todosrht-api usr/bin
diff --git a/debian/srht-todo.postinst b/debian/srht-todo.postinst
index bbc9c56..223b004 100644
--- a/debian/srht-todo.postinst
+++ b/debian/srht-todo.postinst
@@ -6,6 +6,9 @@ case "$1" in
    configure)
        srht-migrate todo.sr.ht -a upgrade head
        todosrht-migrate -a upgrade head

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

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

set -e

case "$1" in
    purge)
        rm -f /var/log/todo.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-todo.srht-todo-api.service b/debian/srht-todo.srht-todo-api.service
new file mode 100644
index 0000000..d1eee03
--- /dev/null
+++ b/debian/srht-todo.srht-todo-api.service
@@ -0,0 +1,13 @@
[Unit]
Description=todo.sr.ht API service
Requires=redis-server.service postgresql.service
After=redis-server.service postgresql.service network.target

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

[Install]
WantedBy=multi-user.target
-- 
2.34.1
Details
Message ID
<9024a5bc-b19d-4db7-6eb1-6f683c3ec612@laxalde.org>
In-Reply-To
<20220217002311.527838-1-pjs@petersanchez.com> (view parent)
DKIM signature
missing
Download raw message
Thanks; pushed as 4ffe62360ca19bf7522713c160afb38b93d0ebcd.
Reply to thread Export thread (mbox)