sendxmpp
parent
84fd65767b
commit
20ba0467d1
5
Makefile
5
Makefile
|
@ -1,7 +1,7 @@
|
|||
REGISTRY=registry.monotremata.xyz
|
||||
PLATFORMS=linux/amd64,linux/arm64
|
||||
|
||||
IMAGES=agate buildx-qemu mpd pleroma rainloop rsync static-page-builder tor transmission webdav
|
||||
IMAGES=agate buildx-qemu mpd pleroma rainloop rsync sendxmpp static-page-builder tor transmission webdav
|
||||
|
||||
.PHONY: all $(IMAGES)
|
||||
|
||||
|
@ -27,6 +27,9 @@ rainloop:
|
|||
rsync:
|
||||
$(BUILDX)
|
||||
|
||||
sendxmpp:
|
||||
$(BUILDX)
|
||||
|
||||
static-page-builder:
|
||||
$(BUILDX)
|
||||
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
FROM alpine:3.16
|
||||
|
||||
ADD entrypoint.sh /entrypoint.sh
|
||||
|
||||
RUN chmod +x /entrypoint.sh && \
|
||||
apk add --no-cache go-sendxmpp && \
|
||||
addgroup \
|
||||
--gid 10001 \
|
||||
sendxmpp && \
|
||||
adduser \
|
||||
--uid 10000 \
|
||||
--ingroup sendxmpp \
|
||||
--disabled-password \
|
||||
--shell /sbin/nologin \
|
||||
sendxmpp
|
||||
|
||||
USER sendxmpp
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
|
@ -0,0 +1,24 @@
|
|||
IMG_NAME=sendxmpp
|
||||
REGISTRY=registry.monotremata.xyz
|
||||
IMG=$(REGISTRY)/$(IMG_NAME)
|
||||
PLATFORMS=linux/amd64,linux/arm64
|
||||
|
||||
.PHONY: push buildx clean
|
||||
|
||||
out/image-id: Dockerfile entrypoint.sh
|
||||
mkdir -p $(@D)
|
||||
docker build -t $(IMG) .
|
||||
echo $(IMG) > $@
|
||||
|
||||
push: out/image-id
|
||||
docker image push $(IMG)
|
||||
|
||||
buildx: Dockerfile entrypoint.sh
|
||||
docker buildx build \
|
||||
--platform $(PLATFORMS) \
|
||||
--tag $(IMG) \
|
||||
--push \
|
||||
.
|
||||
|
||||
clean:
|
||||
rm -rf out
|
|
@ -0,0 +1,31 @@
|
|||
#!/bin/sh
|
||||
|
||||
MESSAGE="${MESSAGE:-${PLUGIN_MESSAGE}}"
|
||||
if [ -z "$MESSAGE" ]; then
|
||||
echo "'message' must specified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
USERNAME="${USERNAME:-${PLUGIN_USERNAME}}"
|
||||
if [ -z "$USERNAME" ]; then
|
||||
echo "'username' must specified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PASSWORD="${PASSWORD:-${PLUGIN_PASSWORD}}"
|
||||
if [ -z "$USERNAME" ]; then
|
||||
echo "'username' must specified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
RECIPIENT="${RECIPIENT:-${PLUGIN_RECIPIENT}}"
|
||||
if [ -z "$RECIPIENT" ]; then
|
||||
echo "'recipient' must specified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec echo "$MESSAGE" | \
|
||||
go-sendxmpp \
|
||||
--username="${USERNAME}"\
|
||||
--password="${PASSWORD}" \
|
||||
"${RECIPIENT}"
|
Loading…
Reference in New Issue