This commit is contained in:
Travis Burtrum 2018-07-10 13:14:52 -04:00
parent 08706b6b9f
commit 5c0c413371
2 changed files with 45 additions and 0 deletions

33
src/webhook/PKGBUILD Executable file
View File

@ -0,0 +1,33 @@
# Maintainer: ava1ar <mail(at)ava1ar(dot)me>
pkgname=webhook
pkgver=2.6.8
pkgrel=1
pkgdesc="Small server for creating HTTP endpoints (hooks)"
arch=('i686' 'x86_64' 'arm' 'armv6' 'armv7' 'aarch64')
license=('MIT')
url="https://github.com/adnanh/webhook"
makedepends=('go' 'git')
options=('!strip' '!emptydirs')
source=("https://github.com/adnanh/webhook/archive/${pkgver}.tar.gz" 'go.uuid.patch')
sha1sums=('e050562130f4f101bbd7281dbe875d4493b31674'
'1312834f40da2109cd47514a74aaf1349db918a3')
prepare() {
cd "${pkgname}-${pkgver}"
patch -p2 < "${srcdir}/go.uuid.patch"
GOPATH=$(pwd) go get -d -v
}
build() {
cd "${pkgname}-${pkgver}"
GOPATH=$(pwd) go build
}
package() {
cd "${pkgname}-${pkgver}"
install -Dm755 "${pkgname}-${pkgver}" "${pkgdir}/usr/bin/${pkgname}"
}

12
src/webhook/go.uuid.patch Normal file
View File

@ -0,0 +1,12 @@
--- a/webhook-2.6.8/webhook.go 2018-04-24 22:46:10.468519981 -0400
+++ b/webhook-2.6.8/webhook.go 2018-04-24 22:46:57.695524146 -0400
@@ -202,7 +202,8 @@
func hookHandler(w http.ResponseWriter, r *http.Request) {
// generate a request id for logging
- rid := uuid.NewV4().String()[:6]
+ u,_ := uuid.NewV4()
+ rid := u.String()[:6]
log.Printf("[%s] incoming HTTP request from %s\n", rid, r.RemoteAddr)