A krystianch/broadcast-box/APKBUILD => krystianch/broadcast-box/APKBUILD +50 -0
@@ 0,0 1,50 @@
+# Maintainer: Krystian Chachuła <krystian@krystianch.com>
+pkgname=broadcast-box
+pkgver=0.0.0_git20240730203427
+_commit=51c453accc4effc18f41679e910f2188acad2393
+pkgrel=0
+pkgdesc="WHIP/WHEP server"
+url="https://b.siobud.com/"
+arch="all"
+license="MIT"
+makedepends="go"
+install="$pkgname.pre-install"
+subpackages="$pkgname-openrc"
+source="
+ https://github.com/Glimesh/broadcast-box/archive/$_commit.zip
+ broadcast-box.initd
+ broadcast-box.confd
+ "
+builddir="$srcdir/$pkgname-$_commit"
+options="net !check" # no tests
+
+export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
+export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
+export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
+export GOPROXY=direct
+
+build() {
+ go mod vendor
+
+ go build \
+ -trimpath \
+ -mod=vendor \
+ -ldflags "-extldflags \"$LDFLAGS\"" \
+ .
+}
+
+package() {
+ install -Dm755 broadcast-box \
+ "$pkgdir"/usr/bin/broadcast-box
+
+ install -m755 -D "$srcdir"/$pkgname.initd \
+ "$pkgdir"/etc/init.d/$pkgname
+ install -m644 -D "$srcdir"/$pkgname.confd \
+ "$pkgdir"/etc/conf.d/$pkgname
+}
+
+sha512sums="
+6fcdb1b42b30b9dc09269d54abb06b58f3b2ecf7270feb9dad61510bca20f3af59b8496a2930e08ca31779e7d8d5b7c06bfddf27aca97f1083243ba4e21531a6 51c453accc4effc18f41679e910f2188acad2393.zip
+413b452dd68981feb344689c08892f4485b312a643777544df78d254a9be248b6ad6d69af6d67c8c17b7abe949727f2efc51c5d8c50f1ce26b5dd1d153171f9b broadcast-box.initd
+0b8d54b005e5ae19fafced22de2a45e55f7b4bfbb97e038185fe65099423c6ec1153237be4c227cc603f6703ba9b6c425bfd89ca7ce080c180c20b6405da7619 broadcast-box.confd
+"
A krystianch/broadcast-box/broadcast-box.confd => krystianch/broadcast-box/broadcast-box.confd +21 -0
@@ 0,0 1,21 @@
+supervisor=supervise-daemon
+
+export DISABLE_STATUS=true
+export DISABLE_FRONTEND=true
+export HTTP_ADDRESS=:8080
+export NETWORK_TEST_ON_START=
+export ENABLE_HTTP_REDIRECT=
+export SSL_CERT=
+export SSL_KEY=
+export NAT_1_TO_1_IP=
+export INCLUDE_PUBLIC_IP_IN_NAT_1_TO_1_IP=
+export INTERFACE_FILTER=
+export NAT_ICE_CANDIDATE_TYPE=
+export STUN_SERVERS=
+export INCLUDE_LOOPBACK_CANDIDATE=
+export UDP_MUX_PORT_WHEP=
+export UDP_MUX_PORT_WHIP=
+export UDP_MUX_PORT=
+export TCP_MUX_ADDRESS=
+export TCP_MUX_FORCE=
+export APPEND_CANDIDATE=
A krystianch/broadcast-box/broadcast-box.initd => krystianch/broadcast-box/broadcast-box.initd +16 -0
@@ 0,0 1,16 @@
+#!/sbin/openrc-run
+
+name="Broadcast Box"
+description="WHIP/WHEP server"
+
+: ${command_user:="broadcastbox"}
+
+command="/usr/bin/broadcast-box
+command_args="$command_args"
+command_background="yes"
+pidfile="/run/$RC_SVCNAME.pid"
+
+depend() {
+ need net
+ after firewall
+}
A krystianch/broadcast-box/broadcast-box.pre-install => krystianch/broadcast-box/broadcast-box.pre-install +4 -0
@@ 0,0 1,4 @@
+#!/bin/sh
+grep '^broadcastbox:' /etc/group >/dev/null || addgroup -S broadcastbox 2>/dev/null
+grep '^broadcastbox:' /etc/passwd >/dev/null || adduser -SDh/var/empty \
+ -s/sbin/nologin -Gbroadcastbox -gbroadcastbox broadcastbox broadcastbox 2>/dev/null