From f2d6f09671be69ce533343d93136e876a720945d Mon Sep 17 00:00:00 2001 From: Adam Rahja Date: Thu, 30 Nov 2023 08:08:52 -0600 Subject: [PATCH 1/2] Added non-root user to docker images. This gives you the ability to run ntfy as a non-root user. resolves #966 --- Dockerfile | 3 ++- Dockerfile-arm | 1 + Dockerfile-build | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 45dad05d..154a98ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,8 @@ LABEL org.opencontainers.image.licenses="Apache-2.0, GPL-2.0" LABEL org.opencontainers.image.title="ntfy" LABEL org.opencontainers.image.description="Send push notifications to your phone or desktop using PUT/POST" -RUN apk add --no-cache tzdata +RUN apk add --no-cache tzdata \ + && adduser -D -u 1000 ntfy COPY ntfy /usr/bin EXPOSE 80/tcp diff --git a/Dockerfile-arm b/Dockerfile-arm index 755092fd..05b56fb1 100644 --- a/Dockerfile-arm +++ b/Dockerfile-arm @@ -12,6 +12,7 @@ LABEL org.opencontainers.image.description="Send push notifications to your phon # Alpine does not support adding "tzdata" on ARM anymore, see # https://github.com/binwiederhier/ntfy/issues/894 +RUN adduser -D -u 1000 ntfy COPY ntfy /usr/bin EXPOSE 80/tcp diff --git a/Dockerfile-build b/Dockerfile-build index cd03a2ff..f454284b 100644 --- a/Dockerfile-build +++ b/Dockerfile-build @@ -53,6 +53,7 @@ LABEL org.opencontainers.image.licenses="Apache-2.0, GPL-2.0" LABEL org.opencontainers.image.title="ntfy" LABEL org.opencontainers.image.description="Send push notifications to your phone or desktop using PUT/POST" +RUN adduser -D -u 1000 ntfy COPY --from=builder /app/dist/ntfy_linux_server/ntfy /usr/bin/ntfy EXPOSE 80/tcp From 3f49f51847d644a92f12bc216000efc79688ca89 Mon Sep 17 00:00:00 2001 From: Lennart Date: Tue, 30 Jan 2024 17:01:36 +0100 Subject: [PATCH 2/2] docs: enhance watchtower example document usage of environment variable WATCHTOWER_NOTIFICATION_SKIP_TITLE for watchtower container so the provided title will not be overwritten --- docs/examples.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/examples.md b/docs/examples.md index 4e936d91..326a3531 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -162,9 +162,12 @@ services: image: containrrr/watchtower environment: - WATCHTOWER_NOTIFICATIONS=shoutrrr + - WATCHTOWER_NOTIFICATION_SKIP_TITLE=True - WATCHTOWER_NOTIFICATION_URL=ntfy://ntfy.sh/my_watchtower_topic?title=WatchtowerUpdates ``` +The environment variable `WATCHTOWER_NOTIFICATION_SKIP_TITLE` is required to prevent Watchtower from [replacing the `title` query parameter](https://containrrr.dev/watchtower/notifications/#settings). If omitted, the provided notification title will not be used. + Or, if you only want to send notifications using shoutrrr: ``` shoutrrr send -u "ntfy://ntfy.sh/my_watchtower_topic?title=WatchtowerUpdates" -m "testMessage"