~dricottone/huttese-apk

55f7a56d475c25d4648ecb231ab37e62122da104 — Drew DeVault 3 years ago 00f1d3f
hg.sr.ht: add GraphQL bits
3 files changed, 44 insertions(+), 0 deletions(-)

M sr.ht/hg.sr.ht/APKBUILD
A sr.ht/hg.sr.ht/hg.sr.ht-api.confd
A sr.ht/hg.sr.ht/hg.sr.ht-api.initd
M sr.ht/hg.sr.ht/APKBUILD => sr.ht/hg.sr.ht/APKBUILD +12 -0
@@ 20,6 20,8 @@ source="
	sr.ht-nginx-$pkgver.tar.gz::https://git.sr.ht/~sircmpwn/sr.ht-nginx/archive/master.tar.gz
	hg.sr.ht.initd
	hg.sr.ht.confd
	hg.sr.ht-api.initd
	hg.sr.ht-api.confd
	hg.sr.ht-webhooks.initd
	hg.sr.ht-webhooks.confd
"


@@ 31,6 33,8 @@ build() {
	python3 setup.py build
	cd hgsrht-keys
	go build
	cd ../api
	go build
}

package() {


@@ 40,12 44,18 @@ package() {
		"$pkgdir"/etc/init.d/hg.sr.ht
	install -Dm644 "$srcdir"/hg.sr.ht.confd \
		"$pkgdir"/etc/conf.d/hg.sr.ht
	install -Dm755 "$srcdir"/hg.sr.ht-api.initd \
		"$pkgdir"/etc/init.d/hg.sr.ht-api
	install -Dm644 "$srcdir"/hg.sr.ht-api.confd \
		"$pkgdir"/etc/conf.d/hg.sr.ht-api
	install -Dm755 "$srcdir"/hg.sr.ht-webhooks.initd \
		"$pkgdir"/etc/init.d/hg.sr.ht-webhooks
	install -Dm644 "$srcdir"/hg.sr.ht-webhooks.confd \
		"$pkgdir"/etc/conf.d/hg.sr.ht-webhooks
	cd hgsrht-keys
	install -Dm755 hgsrht-keys "$pkgdir"/usr/bin/hgsrht-keys
	cd ../api
	install -Dm755 gitsrht-api "$pkgdir"/usr/bin/gitsrht-api
	cd ../hgsrht/hgrcs
	install -Dm644 global.cfg "$pkgdir"/etc/sr.ht/hgrcs/global.cfg
	install -Dm644 nonpublishing.cfg "$pkgdir"/etc/sr.ht/hgrcs/nonpublishing.cfg


@@ 63,6 73,8 @@ sha512sums="
4bc2435c8f67e44d3fdfa9ce2d1f15fbd0a45f066204e56fd5466084b78d12c2a88479d46bfffd185abe1d3a0302a46ce5e73d5e4da239e57707385e63e70b41  sr.ht-nginx-0.27.6.tar.gz
38923f14ca3cedf4004447ef5ab75d5699a858efdc22866f1da10a82c3a938227c03380b84fae719b84b4751f03fec55be922d950a155e09c7e8e41ff71b3c6b  hg.sr.ht.initd
2c3f1776f8bb6bb42f0d240b28561d0bfb1b4638cad169cd5162f9c227028d0d256fd510f8a47c9c0ec111d11e9f54c293fef6c3e3d99d925dcd170294f44472  hg.sr.ht.confd
6096532e3d5d2607630707b7bda91e9893f237e65680eb901a0c6343cacc6cc9764f435251983ddf84fe8272645a6f606dfaccb896c762cd83001415d50afc4f  hg.sr.ht-api.initd
ee986869a924dce9a5b1dc18509579b7966cc883f78b75b9d4b970377ba67bf0aabf86b01e36c50b1d3733a0dfa60ebad5487a180941c51c5ca68e74701533c1  hg.sr.ht-api.confd
93f25762da77462c8167ae53ba37ab4f9982c7f3c2d03dde445f0578758b808987c4781912a0fa5b4a4e25ba50c9d27477dfea8e319908ddc124dc836aefd2d6  hg.sr.ht-webhooks.initd
af5bb605d8ba2e848de5755c9c7f1607591068f6ac79ddc1d312873e92218c6b535eb4cbcf10590656239459b7808ba5469d52d32f80e8e2448fc18c22f7a70c  hg.sr.ht-webhooks.confd
"

A sr.ht/hg.sr.ht/hg.sr.ht-api.confd => sr.ht/hg.sr.ht/hg.sr.ht-api.confd +8 -0
@@ 0,0 1,8 @@
# Run the daemon as this user:
# HG_USER=hg

# Bind the API service to this address:
# HG_BIND=:5111

# Extra arguments to pass to Gunicorn
# HG_ARGS=

A sr.ht/hg.sr.ht/hg.sr.ht-api.initd => sr.ht/hg.sr.ht/hg.sr.ht-api.initd +24 -0
@@ 0,0 1,24 @@
#!/sbin/openrc-run
name="hg.sr.ht-api"
description="hg.sr.ht API service"
supervisor=supervise-daemon
HG_USER=${HG_USER:-hg}
HG_BIND=${HG_BIND:-:5111}
HG_ARGS=${HG_ARGS:-}
LOGS=/var/log/hg.sr.ht-api.log
supervise_daemon_args="-1 $LOGS -2 $LOGS"
command="/usr/bin/hgsrht-api"
command_args="-b $HG_BIND"
command_user="$HG_USER:$HG_USER"
pidfile="/run/${RC_SVCNAME}.pid"

depend() {
	need net
	use redis
	use postgresql
	use pgbouncer
}

start_pre() {
	checkpath -f "$LOGS" -m 644 -o "$HG_USER:$HG_USER"
}