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