From f6003ae7a4f2c49ee93b51126e208ea0c23c5665 Mon Sep 17 00:00:00 2001 From: Abigail G Date: Fri, 3 Sep 2021 00:49:27 -0400 Subject: [PATCH] New package: webhook-2.8.0 --- srcpkgs/webhook/files/hooks.json | 9 +++++++++ srcpkgs/webhook/files/webhook/conf | 13 +++++++++++++ srcpkgs/webhook/files/webhook/log/run | 2 ++ srcpkgs/webhook/files/webhook/run | 13 +++++++++++++ srcpkgs/webhook/template | 23 +++++++++++++++++++++++ 5 files changed, 60 insertions(+) create mode 100644 srcpkgs/webhook/files/hooks.json create mode 100644 srcpkgs/webhook/files/webhook/conf create mode 100644 srcpkgs/webhook/files/webhook/log/run create mode 100644 srcpkgs/webhook/files/webhook/run create mode 100644 srcpkgs/webhook/template diff --git a/srcpkgs/webhook/files/hooks.json b/srcpkgs/webhook/files/hooks.json new file mode 100644 index 000000000000..a814044b9701 --- /dev/null +++ b/srcpkgs/webhook/files/hooks.json @@ -0,0 +1,9 @@ +[ + { + "id": "example", + "execute-command": "/bin/date", + "command-working-directory": "", + "include-command-output-in-response": true + } +] + diff --git a/srcpkgs/webhook/files/webhook/conf b/srcpkgs/webhook/files/webhook/conf new file mode 100644 index 000000000000..58e40d5f4041 --- /dev/null +++ b/srcpkgs/webhook/files/webhook/conf @@ -0,0 +1,13 @@ +# A list of paths to json/yaml files containing definitions of hooks webhook should serve. +# Each filepath should be separated by whitespace, and quoted if needed. +# +# Default: /etc/webhook/hooks.json +# +# HOOKS_FILES="/etc/webhook/hooks.json" + +# Options to pass to webhook, see webhook -h for more info +# +# Default: -hotreload -verbose +# +# OPTS="" + diff --git a/srcpkgs/webhook/files/webhook/log/run b/srcpkgs/webhook/files/webhook/log/run new file mode 100644 index 000000000000..700bf023a873 --- /dev/null +++ b/srcpkgs/webhook/files/webhook/log/run @@ -0,0 +1,2 @@ +#!/bin/sh +exec vlogger -p daemon.info -t webhook diff --git a/srcpkgs/webhook/files/webhook/run b/srcpkgs/webhook/files/webhook/run new file mode 100644 index 000000000000..10fb38dbd274 --- /dev/null +++ b/srcpkgs/webhook/files/webhook/run @@ -0,0 +1,13 @@ +#!/bin/sh +exec 2>&1 + +[ -r ./conf ] && . ./conf + +OPTS=${OPTS:- -hotreload -verbose} + +for f in ${HOOKS_FILES:-/etc/webhook/hooks.json}; do + OPTS="$OPTS -hooks $f" +done + +exec chpst -u _webhook:_webhook webhook $OPTS + diff --git a/srcpkgs/webhook/template b/srcpkgs/webhook/template new file mode 100644 index 000000000000..7afab70cf365 --- /dev/null +++ b/srcpkgs/webhook/template @@ -0,0 +1,23 @@ +# Template file for 'webhook' +pkgname=webhook +version=2.8.0 +revision=1 +build_style=go +go_import_path="github.com/adnanh/webhook" +short_desc="Lightweight incoming webhook server to run shell commands" +maintainer="Abigail G " +license="MIT" +homepage="https://github.com/adnanh/webhook" +distfiles="https://github.com/adnanh/webhook/archive/${version}.tar.gz" +checksum=c521558083f96bcefef16575a6f3f98ac79c0160fd0073be5e76d6645e068398 +system_accounts="_webhook" +system_groups="_webhook" + +post_install() { + vlicense LICENSE + vsv webhook + + vinstall ${FILESDIR}/hooks.json 644 etc/webhook + for f in docs/*.md; do vdoc $f; done + for f in *.example; do vsconf $f ${f%.example}; done +}