diff options
| author | root <root@alpha.trunkmasters.com> | 2026-06-04 05:48:38 -0500 |
|---|---|---|
| committer | root <root@alpha.trunkmasters.com> | 2026-06-04 05:48:38 -0500 |
| commit | bfd9c39e4712ebdb442d4ca0673061faed1e70e1 (patch) | |
| tree | 0d7a74b4463ee387f9cf9368ceb1b757f694f72a /dev-util/webhook | |
| parent | f716a9fe6455d39eef01e718aae68dae61c19704 (diff) | |
| download | baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.tar.gz baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.tar.xz baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.zip | |
Revert "Adding metadata"
This reverts commit f716a9fe6455d39eef01e718aae68dae61c19704.
Diffstat (limited to 'dev-util/webhook')
| -rw-r--r-- | dev-util/webhook/Manifest | 1 | ||||
| -rw-r--r-- | dev-util/webhook/files/webhook.confd | 2 | ||||
| -rw-r--r-- | dev-util/webhook/files/webhook.initd | 22 | ||||
| -rw-r--r-- | dev-util/webhook/files/webhook.json.example | 13 | ||||
| -rw-r--r-- | dev-util/webhook/files/webhook.logrotated | 3 | ||||
| -rw-r--r-- | dev-util/webhook/metadata.xml | 11 | ||||
| -rw-r--r-- | dev-util/webhook/webhook-2.8.1.ebuild | 84 |
7 files changed, 136 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..0e02730ae7be --- /dev/null +++ b/dev-util/webhook/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>robbat2@gentoo.org</email> + <name>Robin H. Johnson</name> + </maintainer> + <upstream> + <remote-id type="github">adnanh/webhook</remote-id> + </upstream> +</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 +} |
