~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
3 2

[PATCH hg.sr.ht-deb] Add GraphQL API

Details
Message ID
<b48a2faef25007557c38.1645051388@thinkpad>
DKIM signature
missing
Download raw message
Patch: +20 -0
# HG changeset patch
# User Peter Sanchez <peter@netlandish.com>
# Date 1645051197 21600
#      Wed Feb 16 16:39:57 2022 -0600
# Node ID b48a2faef25007557c3846811a6d4952e697208c
# Parent  a834e88829f173d439f0cfca106a67d14e0acc99
Add GraphQL API

diff --git a/debian/rules b/debian/rules
--- a/debian/rules
+++ b/debian/rules
@@ -16,11 +16,14 @@ override_dh_auto_build:
	make SRHT_PATH=${SRHT_PATH}
	dh_auto_build
	cd hgsrht-keys && go build
	cd api && go build -o hgsrht-api

override_dh_installsystemd:
	dh_installsystemd
	dh_installsystemd --name srht-hg-webhooks
	dh_installsystemd --name srht-hg-api

override_dh_auto_clean:
	dh_auto_clean
	-rm hgsrht-keys/hgsrht-keys
	-rm api/hgsrht-api
diff --git a/debian/srht-hg.install b/debian/srht-hg.install
--- a/debian/srht-hg.install
+++ b/debian/srht-hg.install
@@ -1,2 +1,3 @@
hgsrht-keys/hgsrht-keys usr/bin/
hgsrht/hgrcs etc/sr.ht/
api/hgsrht-api usr/bin
diff --git a/debian/srht-hg.postinst b/debian/srht-hg.postinst
--- a/debian/srht-hg.postinst
+++ b/debian/srht-hg.postinst
@@ -14,6 +14,8 @@ case "$1" in
        usermod --shell /bin/sh ${USER}
        touch /var/log/hgsrht-shell
        chown ${USER}: /var/log/hgsrht-shell
        touch /var/log/hg.sr.ht-api.log
        chown ${USER}: /var/log/hg.sr.ht-api.log
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
diff --git a/debian/srht-hg.postrm b/debian/srht-hg.postrm
--- a/debian/srht-hg.postrm
+++ b/debian/srht-hg.postrm
@@ -5,6 +5,7 @@ set -e
case "$1" in
    purge)
        rm -f /var/log/hg-srht-shell
        rm -f /var/log/hg.sr.ht-api.log
    ;;

    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
diff --git a/debian/srht-hg.srht-hg-api.service b/debian/srht-hg.srht-hg-api.service
new file mode 100644
--- /dev/null
+++ b/debian/srht-hg.srht-hg-api.service
@@ -0,0 +1,13 @@
[Unit]
Description=hg.sr.ht API service
Requires=redis-server.service postgresql.service
After=redis-server.service postgresql.service network.target

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

[Install]
WantedBy=multi-user.target
Details
Message ID
<b8b8671a-ab37-7c33-9a53-4df292430e50@laxalde.org>
In-Reply-To
<b48a2faef25007557c38.1645051388@thinkpad> (view parent)
DKIM signature
missing
Download raw message
Peter Sanchez a écrit :
> # HG changeset patch
> # User Peter Sanchez <peter@netlandish.com>
> # Date 1645051197 21600
> #      Wed Feb 16 16:39:57 2022 -0600
> # Node ID b48a2faef25007557c3846811a6d4952e697208c
> # Parent  a834e88829f173d439f0cfca106a67d14e0acc99
> Add GraphQL API

Thanks, applied as e77b8f7d6dc50537c2e79e2bd81a3f3b3ca7a7f6 with 
d/changelog updated.

(I only checked that the package builds fine, but I no longer have a 
setup to test the actual result.)
Details
Message ID
<bd3aa752-d3ea-c6de-db9b-3c903b42f02d@laxalde.org>
In-Reply-To
<b48a2faef25007557c38.1645051388@thinkpad> (view parent)
DKIM signature
missing
Download raw message
(Having a second look.)

> diff --git a/debian/srht-hg.srht-hg-api.service b/debian/srht-hg.srht-hg-api.service
> new file mode 100644
> --- /dev/null
> +++ b/debian/srht-hg.srht-hg-api.service
> @@ -0,0 +1,13 @@
> +[Unit]
> +Description=hg.sr.ht API service
> +Requires=redis-server.service postgresql.service
> +After=redis-server.service postgresql.service network.target
> +
> +[Service]
> +Type=simple
> +User=hgsrht

This user does not exist. But we're having an 'hg' user (see 
debian/srht-hg.postinst), should we use the same one here?

> +Restart=always
> +ExecStart=/usr/bin/hgsrht-api -b :5110
> +
> +[Install]
> +WantedBy=multi-user.target
Details
Message ID
<20220217122744.hiser3a72khl6t7s@thinkpad>
In-Reply-To
<bd3aa752-d3ea-c6de-db9b-3c903b42f02d@laxalde.org> (view parent)
DKIM signature
missing
Download raw message
On 02/17, Denis Laxalde wrote:
>(Having a second look.)
>
>This user does not exist. But we're having an 'hg' user (see 
>debian/srht-hg.postinst), should we use the same one here?

You're right. The user is 'hg'. Sorry about that, I should have verified
before just assuming all the users followed the same pattern.
Reply to thread Export thread (mbox)