~sircmpwn/sr.ht-pkgbuilds

57ce3a520954066e8c304e100a242cd37babb691 — Tharre 1 year, 10 months ago 3fa91a7
Add missing service files and fix existing ones

Wants=network.target doesn't do anything, as network.target is a passive
unit, see [0].

`Before=` should be `After=`, since we depend on the network/docker
being online, and not the other way around.

Also removes the log file option from the -runner service, since celery
logs to journalctl anyway, which is preferred in Arch, and it saves us
from creating and chown'ing this file manually.

[0] https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/
M builds.sr.ht/PKGBUILD => builds.sr.ht/PKGBUILD +9 -3
@@ 12,12 12,16 @@ optdepends=(
makedepends=("python-setuptools" "nodejs" "sassc" "go" "git")
source=(
	"$pkgbase-$pkgver.tar.gz::http://git.sr.ht/~sircmpwn/$pkgbase/archive/$pkgver.tar.gz"
	"builds.sr.ht.service"
	"builds.sr.ht-runner.service"
	"builds.sr.ht-worker.service"
	"sysusers.conf"
)
sha256sums=('3263e194a31f64b92b118cc936e920aa389cbf08f91835dca4f0d3cb178c8e3a'
            '3b9c7e484e9009e5ff260530e7e534ed9d05163545cb24e85c04525cb07ae3a1'
            '08a684df1a672794264e1419369020148571af572ba7e78e3a3d07ee10ba6ef4')
            '95be67b46e8064376b8146a25780578250f53bf11bef790f95aae77e76a3fe22'
            'd98ec8519384cf943eb9bf30f36f269b94fc92370167032658cec39e42e1c159'
            'eee2c75cd45b7bf77eabe2687d4bb01ab3a66732977f01887a1d947d0a68c3d0'
            'cf81e4368857216db558e817ec5698b9c9b48463747cf902e906b48863bbc965')
export PKGVER=$pkgver

build() {


@@ 45,6 49,9 @@ package_builds.sr.ht() {
	install -Dm644 "$srcdir"/builds.sr.ht-runner.service \
		-t "$pkgdir"/usr/lib/systemd/system/

	install -Dm644 ../builds.sr.ht.service -t "$pkgdir"/usr/lib/systemd/system/
	install -Dm644 ../sysusers.conf "$pkgdir/usr/lib/sysusers.d/builds.sr.ht.conf"

	# Contrib scripts
	mkdir -p "$pkgdir"/usr/bin/builds.sr.ht
	install -Dm755 contrib/submit_image_build "$pkgdir"/usr/bin/builds.sr.ht/


@@ 53,7 60,6 @@ package_builds.sr.ht() {
package_builds.sr.ht-images() {
	depends=("builds.sr.ht" "docker")
	description="Stock build images for builds.sr.ht runners"
	install=builds.sr.ht-images.install
	cd $pkgbase-$pkgver
	mkdir -p "$pkgdir"/var/lib/
	cp -r images "$pkgdir"/var/lib/

D builds.sr.ht/builds.sr.ht-images.install => builds.sr.ht/builds.sr.ht-images.install +0 -11
@@ 1,11 0,0 @@
post_install() {
	egrep runner /etc/passwd || useradd -G kvm,docker -d/ -s/sbin/nologin runner
	echo
	echo "To set up the build runner, reference the instructions here"
	echo
	echo "https://man.sr.ht/builds.sr.ht/installation.md"
	echo
	echo "You must build the qemu docker image and any of the build images"
	echo "you wish to support."
	echo
}

M builds.sr.ht/builds.sr.ht-runner.service => builds.sr.ht/builds.sr.ht-runner.service +3 -5
@@ 1,15 1,13 @@
[Unit]
Description=builds.sr.ht runner
Wants=network.target
Wants=docker.target
Before=network.target
Before=docker.target
Requires=docker.service
After=docker.target network.target

[Service]
Type=simple
User=runner
Restart=always
ExecStart=/bin/sh -c '/usr/bin/celery -A buildsrht.runner worker --loglevel=info -f /var/log/buildsrht.runner -c $(/usr/bin/nproc)'
ExecStart=/bin/sh -c '/usr/bin/celery -A buildsrht.runner worker --loglevel=info -c $(/usr/bin/nproc)'

[Install]
WantedBy=multi-user.target

M builds.sr.ht/builds.sr.ht-worker.service => builds.sr.ht/builds.sr.ht-worker.service +2 -4
@@ 1,9 1,7 @@
[Unit]
Description=builds.sr.ht worker
Wants=network.target
Wants=docker.target
Before=network.target
Before=docker.target
Requires=docker.service
After=docker.service network.target

[Service]
Type=simple

A builds.sr.ht/builds.sr.ht.service => builds.sr.ht/builds.sr.ht.service +13 -0
@@ 0,0 1,13 @@
[Unit]
Description=builds.sr.ht website service
Requires=redis.service postgresql.service
After=redis.service postgresql.service network.target

[Service]
Type=simple
User=buildsrht
Restart=always
ExecStart=/usr/bin/gunicorn buildsrht.app:app -b 127.0.0.1:5002

[Install]
WantedBy=multi-user.target

A builds.sr.ht/sysusers.conf => builds.sr.ht/sysusers.conf +4 -0
@@ 0,0 1,4 @@
u	runner	-	"runner user for builds.sr.ht builds"
m	runner	kvm
m	runner	docker
u	buildsrht	-	"builds.sr.ht user"

M dispatch.sr.ht/PKGBUILD => dispatch.sr.ht/PKGBUILD +7 -1
@@ 17,8 17,12 @@ makedepends=("python-setuptools" "nodejs" "sassc")
install=dispatch.sr.ht.install
source=(
	"$pkgname-$pkgver.tar.gz::http://git.sr.ht/~sircmpwn/$pkgname/archive/$pkgver.tar.gz"
	"dispatch.sr.ht.service"
	"sysusers.conf"
)
sha256sums=('a6b343e9213a25facfa00606ab25ddcf67e5239f95cd42a0daffd8dd14143539')
sha256sums=('a6b343e9213a25facfa00606ab25ddcf67e5239f95cd42a0daffd8dd14143539'
            'e5022c80a11d25e997d6827ceee8a0907f793c6a95f5c1c4528975b42fe6821c'
            '244fe1a6b13e04b39158ca679ecb976bfa5b23731a774308f69b55fda6db6fba')
export PKGVER=$pkgver

build() {


@@ 28,5 32,7 @@ build() {

package() {
	cd $pkgbase-$pkgver
	install -Dm0644 ../dispatch.sr.ht.service -t "$pkgdir"/usr/lib/systemd/system/
	install -Dm0644 ../sysusers.conf "$pkgdir/usr/lib/sysusers.d/dispatch.sr.ht.conf"
	python3 setup.py install --root="${pkgdir}" --optimize=1
}

A dispatch.sr.ht/dispatch.sr.ht.service => dispatch.sr.ht/dispatch.sr.ht.service +13 -0
@@ 0,0 1,13 @@
[Unit]
Description=dispatch.sr.ht website service
Requires=postgresql.service
After=postgresql.service network.target

[Service]
Type=simple
User=dispatchsrht
Restart=always
ExecStart=/usr/bin/gunicorn dispatchsrht.app:app -b 127.0.0.1:5005

[Install]
WantedBy=multi-user.target

A dispatch.sr.ht/sysusers.conf => dispatch.sr.ht/sysusers.conf +1 -0
@@ 0,0 1,1 @@
u	dispatchsrht	-	"dispatch.sr.ht user"

M git.sr.ht/PKGBUILD => git.sr.ht/PKGBUILD +7 -1
@@ 17,8 17,12 @@ optdepends=(
install=git.sr.ht.install
source=(
	"$pkgname-$pkgver.tar.gz::http://git.sr.ht/~sircmpwn/$pkgname/archive/$pkgver.tar.gz"
	"git.sr.ht.service"
	"sysusers.conf"
)
sha256sums=('5f2a21c2028eac60c32de68a4bbc8debe1c31deea8e6dee76d1b4fd9b0768bc8')
sha256sums=('5f2a21c2028eac60c32de68a4bbc8debe1c31deea8e6dee76d1b4fd9b0768bc8'
            'fdc573980dce542774229ea9036e99e019ee0a382a271c08ddded9a5077a3e4b'
            '89d7b6034eb4178a66ee3357c15ca06c46996a12e2d2b7db5048bb890e774eb8')
export PKGVER=$pkgver

build() {


@@ 28,5 32,7 @@ build() {

package() {
	cd $pkgbase-$pkgver
	install -Dm0644 ../git.sr.ht.service -t "$pkgdir"/usr/lib/systemd/system/
	install -Dm0644 ../sysusers.conf "$pkgdir/usr/lib/sysusers.d/git.sr.ht.conf"
	python3 setup.py install --root="${pkgdir}" --optimize=1
}

A git.sr.ht/git.sr.ht.service => git.sr.ht/git.sr.ht.service +13 -0
@@ 0,0 1,13 @@
[Unit]
Description=git.sr.ht website service
Requires=redis.service postgresql.service
After=redis.service postgresql.service network.target

[Service]
Type=simple
User=gitsrht
Restart=always
ExecStart=/usr/bin/gunicorn gitsrht.app:app -b 127.0.0.1:5001

[Install]
WantedBy=multi-user.target

A git.sr.ht/sysusers.conf => git.sr.ht/sysusers.conf +1 -0
@@ 0,0 1,1 @@
u	gitsrht	-	"git.sr.ht user"

M lists.sr.ht/PKGBUILD => lists.sr.ht/PKGBUILD +7 -1
@@ 16,8 16,12 @@ optdepends=(
install=lists.sr.ht.install
source=(
	"$pkgname-$pkgver.tar.gz::http://git.sr.ht/~sircmpwn/$pkgname/archive/$pkgver.tar.gz"
	"lists.sr.ht.service"
	"sysusers.conf"
)
sha256sums=('76534fa936f5130c9564a867929ff86190dba4a2a118a1aa2467af29e813fbff')
sha256sums=('76534fa936f5130c9564a867929ff86190dba4a2a118a1aa2467af29e813fbff'
            '3bfc68d7945fa1d996fdf2ca202ceebbe5511ca6618f9a123ea1ac61ac1df062'
            '753453b055e613e7c0fb22991ca8d9f588fe1ba705e26f0e8c2504c464f4e5d0')
export PKGVER=$pkgver

build() {


@@ 27,5 31,7 @@ build() {

package() {
	cd $pkgbase-$pkgver
	install -Dm0644 ../lists.sr.ht.service -t "$pkgdir"/usr/lib/systemd/system/
	install -Dm0644 ../sysusers.conf "$pkgdir/usr/lib/sysusers.d/lists.sr.ht.conf"
	python3 setup.py install --root="${pkgdir}" --optimize=1
}

A lists.sr.ht/lists.sr.ht.service => lists.sr.ht/lists.sr.ht.service +13 -0
@@ 0,0 1,13 @@
[Unit]
Description=lists.sr.ht website service
Requires=redis.service postgresql.service
After=redis.service postgresql.service network.target

[Service]
Type=simple
User=listssrht
Restart=always
ExecStart=/usr/bin/gunicorn listssrht.app:app -b 127.0.0.1:5006

[Install]
WantedBy=multi-user.target

A lists.sr.ht/sysusers.conf => lists.sr.ht/sysusers.conf +1 -0
@@ 0,0 1,1 @@
u	listssrht	-	"lists.sr.ht user"

M man.sr.ht/PKGBUILD => man.sr.ht/PKGBUILD +7 -1
@@ 10,8 10,12 @@ depends=("python-srht" "python-flask-login" "python-pygit2" "gunicorn")
makedepends=("python-setuptools" "nodejs" "sassc")
source=(
	"$pkgname-$pkgver.tar.gz::http://git.sr.ht/~sircmpwn/$pkgname/archive/$pkgver.tar.gz"
	"man.sr.ht.service"
	"sysusers.conf"
)
sha256sums=('25affaa41f2e5dd680b8a59f4b34cbc639f3b1229ab24410945977566196f26b')
sha256sums=('25affaa41f2e5dd680b8a59f4b34cbc639f3b1229ab24410945977566196f26b'
            '47130a2897bca5a6491c0cdcd4443a052eb3f1f83484332b1775ef5f991b9ea0'
            '8dbd5ed13adcd3fe4f0e31e3b6a7f6c7b116cbd63ce1c430ddcdaec4f7491dee')
export PKGVER=$pkgver

build() {


@@ 21,5 25,7 @@ build() {

package() {
	cd $pkgbase-$pkgver
	install -Dm0644 ../man.sr.ht.service -t "$pkgdir"/usr/lib/systemd/system/
	install -Dm0644 ../sysusers.conf "$pkgdir/usr/lib/sysusers.d/man.sr.ht.conf"
	python3 setup.py install --root="${pkgdir}" --optimize=1
}

A man.sr.ht/man.sr.ht.service => man.sr.ht/man.sr.ht.service +13 -0
@@ 0,0 1,13 @@
[Unit]
Description=man.sr.ht website service
Requires=postgresql.service
After=postgresql.service network.target

[Service]
Type=simple
User=mansrht
Restart=always
ExecStart=/usr/bin/gunicorn mansrht.app:app -b 127.0.0.1:5004

[Install]
WantedBy=multi-user.target

A man.sr.ht/sysusers.conf => man.sr.ht/sysusers.conf +1 -0
@@ 0,0 1,1 @@
u	mansrht	-	"man.sr.ht user"

M meta.sr.ht/PKGBUILD => meta.sr.ht/PKGBUILD +7 -1
@@ 26,8 26,12 @@ optdepends=(
makedepends=("python-setuptools" "nodejs" "sassc")
source=(
	"$pkgname-$pkgver.tar.gz::http://git.sr.ht/~sircmpwn/$pkgname/archive/$pkgver.tar.gz"
	"meta.sr.ht.service"
	"sysusers.conf"
)
sha256sums=('2004c3f71a53b838bbf5598ebd35f41af605c5b0516526fc8c1e6c496e57be2d')
sha256sums=('2004c3f71a53b838bbf5598ebd35f41af605c5b0516526fc8c1e6c496e57be2d'
            '79b30d4b2275005a78cf29a185fab07301455557d631d6263ee28a2592a75067'
            'b98af4986b4a470cf80d8651563946706717fb556cf31433581f22173ada93db')
export PKGVER=$pkgver

build() {


@@ 37,5 41,7 @@ build() {

package() {
	cd $pkgbase-$pkgver
	install -Dm0644 ../meta.sr.ht.service -t "$pkgdir"/usr/lib/systemd/system/
	install -Dm0644 ../sysusers.conf "$pkgdir/usr/lib/sysusers.d/meta.sr.ht.conf"
	python3 setup.py install --root="${pkgdir}" --optimize=1
}

A meta.sr.ht/meta.sr.ht.service => meta.sr.ht/meta.sr.ht.service +13 -0
@@ 0,0 1,13 @@
[Unit]
Description=meta.sr.ht website service
Requires=postgresql.service
After=postgresql.service network.target

[Service]
Type=simple
User=metasrht
Restart=always
ExecStart=/usr/bin/gunicorn metasrht.app:app -b 127.0.0.1:5000

[Install]
WantedBy=multi-user.target

A meta.sr.ht/sysusers.conf => meta.sr.ht/sysusers.conf +1 -0
@@ 0,0 1,1 @@
u	metasrht	-	"meta.sr.ht user"

M todo.sr.ht/PKGBUILD => todo.sr.ht/PKGBUILD +7 -1
@@ 14,8 14,12 @@ install=todo.sr.ht.install
makedepends=("python-setuptools" "nodejs" "sassc")
source=(
	"$pkgname-$pkgver.tar.gz::http://git.sr.ht/~sircmpwn/$pkgname/archive/$pkgver.tar.gz"
	"todo.sr.ht.service"
	"sysusers.conf"
)
sha256sums=('1b43ad6a241a2079d64cc033fe4f622da09f202bf9ed332f7a2c1133dd3c8bd6')
sha256sums=('1b43ad6a241a2079d64cc033fe4f622da09f202bf9ed332f7a2c1133dd3c8bd6'
            '6c373a2df95e6062efd167de75b1d58af980a509a50b71507d07120c6b9358b2'
            'f9b1dbca0557b7b24654dcb0d7e7d990675ce251a3d2f380d87eb1d3aca93821')
export PKGVER=$pkgver

build() {


@@ 25,5 29,7 @@ build() {

package() {
	cd $pkgbase-$pkgver
	install -Dm0644 ../todo.sr.ht.service -t "$pkgdir"/usr/lib/systemd/system/
	install -Dm0644 ../sysusers.conf "$pkgdir/usr/lib/sysusers.d/todo.sr.ht.conf"
	python3 setup.py install --root="${pkgdir}" --optimize=1
}

A todo.sr.ht/sysusers.conf => todo.sr.ht/sysusers.conf +1 -0
@@ 0,0 1,1 @@
u	todosrht	-	"todo.sr.ht user"

A todo.sr.ht/todo.sr.ht.service => todo.sr.ht/todo.sr.ht.service +13 -0
@@ 0,0 1,13 @@
[Unit]
Description=todo.sr.ht website service
Requires=postgresql.service
After=postgresql.service network.target

[Service]
Type=simple
User=todosrht
Restart=always
ExecStart=/usr/bin/gunicorn todosrht.app:app -b 127.0.0.1:5003

[Install]
WantedBy=multi-user.target