From cfd0c39e2db0a7d8c62434ad109e5033b6768852 Mon Sep 17 00:00:00 2001 From: DanielMowitz Date: Thu, 24 Aug 2023 17:58:27 +0200 Subject: [PATCH] Added files for the docker image --- Dockerfile | 20 ++++++++++++++++++++ send-daily-mail.sh | 10 ++++++++++ 2 files changed, 30 insertions(+) create mode 100644 Dockerfile create mode 100755 send-daily-mail.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..affacd0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM rust:1.69-alpine + +RUN mkdir webmention-filer +COPY src webmention-filer/src +COPY Cargo.toml webmention-filer/Cargo.toml +COPY Cargo.lock webmention-filer/Cargo.lock + +WORKDIR webmention-filer +RUN cargo build --release + +FROM alpine + +COPY /target/release/webmention-filer /usr/bin/ + +RUN apk add mailx + +USER 1000:1000 +EXPOSE 8000 + +ENTRYPOINT ["/usr/bin/mk-to-atom"] \ No newline at end of file diff --git a/send-daily-mail.sh b/send-daily-mail.sh new file mode 100755 index 0000000..1a76672 --- /dev/null +++ b/send-daily-mail.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +yesterday=`date -d 'yesterday' --iso-8601` + +echo "/tmp/webmention-storage/$yesterday" + +if [ -f "/tmp/webmention-storage/$yesterday" ] +then + cat "/tmp/webmention-storage/$yesterday" | mail -r $SENDER -s "Your webmentions for $yesterday" $RECIPIENT +fi