summaryrefslogtreecommitdiff
path: root/dev-util/webhook
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
committerroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
commitb590c8d7572b727d565cc0b8ff660d43569845de (patch)
tree06f7a4102ea4e845df8b66660f252920d52952f9 /dev-util/webhook
parent24f9cbfc4c34fdb6a6e03311674414e881ceab47 (diff)
downloadbaldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.gz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.xz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.zip
Adding metadata
Diffstat (limited to 'dev-util/webhook')
-rw-r--r--dev-util/webhook/Manifest1
-rw-r--r--dev-util/webhook/files/webhook.confd2
-rw-r--r--dev-util/webhook/files/webhook.initd22
-rw-r--r--dev-util/webhook/files/webhook.json.example13
-rw-r--r--dev-util/webhook/files/webhook.logrotated3
-rw-r--r--dev-util/webhook/metadata.xml9
-rw-r--r--dev-util/webhook/webhook-2.8.1.ebuild84
7 files changed, 134 insertions, 0 deletions
diff --git a/dev-util/webhook/Manifest b/dev-util/webhook/Manifest
new file mode 100644
index 000000000000..81786bf44438
--- /dev/null
+++ b/dev-util/webhook/Manifest
@@ -0,0 +1 @@
+DIST webhook-2.8.1.tar.gz 1657848 BLAKE2B 7e6dbea83614042c6dcf2e0b377933dee625bfd300e24530f0682b68945734e11e3d2d5bc34ef8b19936b3880cab7febfa39160a5eea988c4f882acf47d99cbd SHA512 25edff21725ba9ac8823dbe5728234f7cd9218027e87df3e2482ef365a7dd0efe8659800233753c275f858ff87f848ff6141d09be3e0b66ff88b795680b9b635
diff --git a/dev-util/webhook/files/webhook.confd b/dev-util/webhook/files/webhook.confd
new file mode 100644
index 000000000000..6cc27e091955
--- /dev/null
+++ b/dev-util/webhook/files/webhook.confd
@@ -0,0 +1,2 @@
+# arguments for webhook
+command_args="-ip=localhost -port=9000 -hooks=/etc/webhook.json -logfile=/var/log/webhook.log"
diff --git a/dev-util/webhook/files/webhook.initd b/dev-util/webhook/files/webhook.initd
new file mode 100644
index 000000000000..d87e8cce035f
--- /dev/null
+++ b/dev-util/webhook/files/webhook.initd
@@ -0,0 +1,22 @@
+#!/sbin/openrc-run
+# Copyright 2016-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+description="Webhook server"
+pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
+
+command="/usr/bin/webhook"
+command_args="${command_args}"
+command_background="true"
+extra_started_commands="reload"
+start_stop_daemon_args=""
+
+depend() {
+ after net
+}
+
+reload() {
+ ebegin "Reloading webhooks"
+ start-stop-daemon --signal SIGHUP --pidfile "${pidfile}"
+ eend $?
+}
diff --git a/dev-util/webhook/files/webhook.json.example b/dev-util/webhook/files/webhook.json.example
new file mode 100644
index 000000000000..12a314522595
--- /dev/null
+++ b/dev-util/webhook/files/webhook.json.example
@@ -0,0 +1,13 @@
+[
+ {
+ "id": "example",
+ "execute-command": "/var/lib/webhooks/example.sh",
+ "command-working-directory": "/var/lib/webhooks"
+ "pass-arguments-to-command":
+ [
+ {
+ "source": "entire-payload"
+ }
+ ]
+ }
+]
diff --git a/dev-util/webhook/files/webhook.logrotated b/dev-util/webhook/files/webhook.logrotated
new file mode 100644
index 000000000000..7a6dd20b3ceb
--- /dev/null
+++ b/dev-util/webhook/files/webhook.logrotated
@@ -0,0 +1,3 @@
+/var/log/webhook.log
+{
+}
diff --git a/dev-util/webhook/metadata.xml b/dev-util/webhook/metadata.xml
new file mode 100644
index 000000000000..8772a74e80f9
--- /dev/null
+++ b/dev-util/webhook/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>robbat2@gentoo.org</email>
+ <name>Robin H. Johnson</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/dev-util/webhook/webhook-2.8.1.ebuild b/dev-util/webhook/webhook-2.8.1.ebuild
new file mode 100644
index 000000000000..18c19358ef77
--- /dev/null
+++ b/dev-util/webhook/webhook-2.8.1.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit go-module
+
+DESCRIPTION="lightweight incoming webhook server to run shell commands"
+HOMEPAGE="https://github.com/adnanh/webhook/"
+
+if [[ ${PV} == *9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/adnanh/webhook/"
+else
+ SRC_URI="https://github.com/adnanh/webhook/archive/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64"
+ S="${WORKDIR}/webhook-${PV}"
+fi
+
+# SPDX:BSD-3-Clause is 'BSD' in Gentoo
+# SPDX:BSD-2-Clause is 'BSD-2' in Gentoo
+LICENSE="Apache-2.0 BSD-2 BSD MIT"
+SLOT="0"
+
+BDEPEND=">=dev-lang/go-1.13"
+RESTRICT="test" # hardcoded paths, plus go extra dependencies not included in tarball
+
+DOCS=(
+ README.md
+ hooks.json.example
+ hooks.json.tmpl.example
+ hooks.yaml.example
+ hooks.yaml.tmpl.example
+ docs/Hook-Definition.md
+ docs/Hook-Examples.md
+ docs/Hook-Rules.md
+ docs/Referencing-Request-Values.md
+ docs/Templates.md
+ docs/Webhook-Parameters.md
+)
+
+# Do not let these leak from outside into the package
+unset GOBIN GOPATH GOCODE
+
+src_unpack() {
+ if [[ ${PV} == *9999 ]]; then
+ git-r3_src_unpack
+ go-module_live_vendor
+ else
+ go-module_src_unpack
+ fi
+}
+
+src_compile() {
+ # Golang LDFLAGS are not the same as GCC/Binutils LDFLAGS
+ unset LDFLAGS
+ # -mod=vendor is needed because the go version specified in go.mod
+ # is too low.
+ ego build -mod=vendor
+}
+
+src_install() {
+ dobin webhook
+
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+
+ insinto /etc
+ newins "${FILESDIR}/${PN}.json.example" ${PN}.json
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/${PN}.logrotated" ${PN}
+
+ einstalldocs
+}
+
+pkg_postinst() {
+ elog
+ elog "Note that due to technical restrictions the webhook server runs as root,"
+ elog "which has obvious security implications."
+ elog "Please see the project home page for information about Hook rules and"
+ elog "restrict access to the server, for example by limiting the listening IP/port."
+ elog
+}