diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..567609b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build/ diff --git a/Dockerfile b/Dockerfile index 0b71fcb..c0a89c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:latest as env RUN apk --update add ca-certificates -RUN addgroup -S smartswitch && adduser -S smartswitch -G smartswitch +RUN addgroup -S gpio-webhook && adduser -S gpio-webhook -G gpio-webhook FROM golang:1.14 AS build @@ -13,11 +13,11 @@ RUN make build FROM scratch -ENTRYPOINT ["/srv/smartswitch-server"] -USER smartswitch +ENTRYPOINT ["/srv/gpio-webhook-server"] +USER gpio-webhook EXPOSE 7200 COPY --from=env /etc/passwd /etc/group /etc/ -COPY --from=build --chown=smartswitch /src/build/ /srv/ +COPY --from=build --chown=gpio-webhook /src/build/ /srv/ COPY --from=env /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt diff --git a/Makefile b/Makefile index 9397bef..3290f23 100644 --- a/Makefile +++ b/Makefile @@ -8,4 +8,4 @@ lint: build: rm -rf build/ mkdir build/ - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/smartswitch-server ./cmd/smartswitch-server + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/gpio-webhook-server ./cmd/server diff --git a/cmd/smartswitch-server/main.go b/cmd/server/main.go similarity index 100% rename from cmd/smartswitch-server/main.go rename to cmd/server/main.go diff --git a/readme.md b/readme.md index 6da207d..fc496bc 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,7 @@ -# A simple webhook server for smartswitch devices +# A simple server for controlling GPIO pins on embedded devices This is a tiny webserver designed to receive webhooks that control -microcontrollers running [smartswitch](https://git.annabunch.es/annabunches/smartswitch/). +microcontrollers running [gpio-webhook](https://git.annabunch.es/annabunches/gpio-webhook-arduino/). ## Configuration @@ -30,7 +30,7 @@ make build And run with: ``` -./smartswitch-server +./gpio-webhook-server ``` A dockerfile is also included, along with a sample docker-compose.yml demonstrating