diff --git a/README.md b/README.md index 50b41e9..0a4ab23 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,7 @@ A collection of delicious docker recipes. - [x] portia - [x] pure-ftpd - [x] redis-arm +- [x] rehook - [x] rinetd - [x] rslsync - [x] rsyncd diff --git a/rehook/Dockerfile b/rehook/Dockerfile new file mode 100644 index 0000000..dd261d1 --- /dev/null +++ b/rehook/Dockerfile @@ -0,0 +1,24 @@ +# +# Dockerfile for rehook +# + +FROM golang:alpine AS build +ENV CGO_ENABLED=0 +ENV GOOS=linux +ENV GOARCH=amd64 +WORKDIR /go/bin +RUN apk add --no-cache git +RUN go get -d -v github.com/jstemmer/rehook +RUN go build --ldflags '-s -extldflags "-static"' -i -o rehook github.com/jstemmer/rehook + +FROM alpine:3 +MAINTAINER EasyPi Software Foundation +WORKDIR /opt/rehook +RUN mkdir -p bin etc log +RUN apk add --no-cache bash coreutils curl jq +COPY --from=build /go/src/github.com/jstemmer/rehook/public public +COPY --from=build /go/src/github.com/jstemmer/rehook/views views +COPY --from=build /go/bin/rehook bin +EXPOSE 9000 9001 +ENTRYPOINT ["bin/rehook"] +CMD ["-db", "etc/rehook.db", "-http", ":9000", "-admin", ":9001"] diff --git a/rehook/README.md b/rehook/README.md new file mode 100644 index 0000000..2a50bb7 --- /dev/null +++ b/rehook/README.md @@ -0,0 +1,10 @@ +rehook +====== + +[Rehook][1] - a webhook dispatcher, filtering incoming requests from external +services and acting on them. + +To view `etc/rehook.db`, please install [boltbrowser][2] + +[1]: https://github.com/jstemmer/rehook +[2]: https://github.com/br0xen/boltbrowser diff --git a/rehook/docker-compose.yml b/rehook/docker-compose.yml new file mode 100644 index 0000000..94cf497 --- /dev/null +++ b/rehook/docker-compose.yml @@ -0,0 +1,9 @@ +rehook: + image: vimagick/rehook + ports: + - "9000:9000" + - "9001:9001" + volumes: + - "./data/etc:/opt/rehook/etc" + - "./data/log:/opt/rehook/log" + restart: unless-stopped diff --git a/rehook/nginx.conf b/rehook/nginx.conf new file mode 100644 index 0000000..b1604a5 --- /dev/null +++ b/rehook/nginx.conf @@ -0,0 +1,23 @@ +server { + listen 80; + server_name rehook.example.com; + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl; + server_name rehook.example.com; + ssl_certificate ssl/example.com.crt; + ssl_certificate_key ssl/example.com.key; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers HIGH:!aNULL:!MD5; + auth_basic "Restricted"; + auth_basic_user_file /etc/nginx/htpasswd; + location / { + proxy_pass http://127.0.0.1:9001; + } + location /h/ { + auth_basic "off"; + proxy_pass http://127.0.0.1:9000; + } +}