From b3c975314d2bcbc9ef75800094504e0f58635555 Mon Sep 17 00:00:00 2001 From: bt90 Date: Fri, 23 Dec 2022 18:26:21 +0100 Subject: [PATCH 1/7] docker: add basic healthcheck --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 6916cabc..9d9ae9b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,5 +3,7 @@ MAINTAINER Philipp C. Heckel COPY ntfy /usr/bin +HEALTHCHECK --interval=60s --timeout=10s CMD wget --no-verbose --tries=1 --spider http://localhost/config.js || exit 1 + EXPOSE 80/tcp ENTRYPOINT ["ntfy"] From dab18e5b40b03f76bb36d200377782c23b4be0c8 Mon Sep 17 00:00:00 2001 From: bt90 Date: Tue, 27 Dec 2022 16:40:15 +0100 Subject: [PATCH 2/7] Use health endpoint --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9d9ae9b7..52ccff6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ MAINTAINER Philipp C. Heckel COPY ntfy /usr/bin -HEALTHCHECK --interval=60s --timeout=10s CMD wget --no-verbose --tries=1 --spider http://localhost/config.js || exit 1 +HEALTHCHECK --interval=60s --timeout=10s CMD wget -q --tries=1 http://localhost/v1/health -O - | grep -Eo '"healthy"\s*:\s*true' || exit 1 EXPOSE 80/tcp ENTRYPOINT ["ntfy"] From b78efdd1552e5567d68ca6cebe85617989b2a202 Mon Sep 17 00:00:00 2001 From: fleopaulD Date: Fri, 30 Dec 2022 14:59:28 +0100 Subject: [PATCH 3/7] Added clarification on client.yml configuration I didn't understand why the `ntfy publish --debug topic message` command don't choose the default-host I entered in `/etc/ntfy/client.yml`. If command is run as sudo -> config file = `/etc/ntfy/client.yml` If command is run as non-sudo -> config file = `~/.config/ntfy/client.yml` I think this is an important precision for users. --- docs/install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install.md b/docs/install.md index 06be9817..00b03639 100644 --- a/docs/install.md +++ b/docs/install.md @@ -14,7 +14,7 @@ We support amd64, armv7 and arm64. 1. Install ntfy using one of the methods described below 2. Then (optionally) edit `/etc/ntfy/server.yml` for the server (Linux only, see [configuration](config.md) or [sample server.yml](https://github.com/binwiederhier/ntfy/blob/main/server/server.yml)) -3. Or (optionally) create/edit `~/.config/ntfy/client.yml` (or `/etc/ntfy/client.yml`, see [sample client.yml](https://github.com/binwiederhier/ntfy/blob/main/client/client.yml)) +3. Or (optionally) create/edit `~/.config/ntfy/client.yml` (for the non-root user) or `/etc/ntfy/client.yml` (for the root user), see [sample client.yml](https://github.com/binwiederhier/ntfy/blob/main/client/client.yml)) To run the ntfy server, then just run `ntfy serve` (or `systemctl start ntfy` when using the deb/rpm). To send messages, use `ntfy publish`. To subscribe to topics, use `ntfy subscribe` (see [subscribing via CLI](subscribe/cli.md) From 5a24e308207490a899e999522c80df4e98ddff88 Mon Sep 17 00:00:00 2001 From: Daniel Demus Date: Sat, 31 Dec 2022 14:35:23 +0100 Subject: [PATCH 4/7] Allow for existing user or group Fix chown syntax --- scripts/postinst.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/postinst.sh b/scripts/postinst.sh index e4ee165a..eae0b8a8 100755 --- a/scripts/postinst.sh +++ b/scripts/postinst.sh @@ -7,8 +7,9 @@ set -e if [ "$1" = "configure" ] || [ "$1" -ge 1 ]; then if [ -d /run/systemd/system ]; then # Create ntfy user/group - id ntfy >/dev/null 2>&1 || useradd --system --no-create-home ntfy - chown ntfy.ntfy /var/cache/ntfy /var/cache/ntfy/attachments /var/lib/ntfy + groupadd -f ntfy + id ntfy >/dev/null 2>&1 || useradd --system --no-create-home -g ntfy ntfy + chown ntfy:ntfy /var/cache/ntfy /var/cache/ntfy/attachments /var/lib/ntfy chmod 700 /var/cache/ntfy /var/cache/ntfy/attachments /var/lib/ntfy # Hack to change permissions on cache file @@ -16,7 +17,7 @@ if [ "$1" = "configure" ] || [ "$1" -ge 1 ]; then if [ -f "$configfile" ]; then cachefile="$(cat "$configfile" | perl -n -e'/^\s*cache-file: ["'"'"']?([^"'"'"']+)["'"'"']?/ && print $1')" # Oh my, see #47 if [ -n "$cachefile" ]; then - chown ntfy.ntfy "$cachefile" || true + chown ntfy:ntfy "$cachefile" || true chmod 600 "$cachefile" || true fi fi From e0a957c4e9f01f51794cf83765459c5f9116c385 Mon Sep 17 00:00:00 2001 From: binwiederhier Date: Sat, 31 Dec 2022 09:40:30 -0500 Subject: [PATCH 5/7] Changelog --- docs/releases.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/releases.md b/docs/releases.md index 6e8cfba0..6eb098b2 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -8,6 +8,10 @@ and the [ntfy Android app](https://github.com/binwiederhier/ntfy-android/release * Preliminary `/v1/health` API endpoint for service monitoring (no ticket) +**Bug fixes:** + +* Fix `chown` issues with RHEL-like based systems ([#566](https://github.com/binwiederhier/ntfy/issues/566)/[#565](https://github.com/binwiederhier/ntfy/pull/565), thanks to [danieldemus](https://github.com/danieldemus)) + **Documentation:** * Add HTTP/2 and TLSv1.3 support to nginx docs ([#553](https://github.com/binwiederhier/ntfy/issues/553), thanks to [bt90](https://github.com/bt90)) From 8aec85c579bc40953248c98c5517585b6885a841 Mon Sep 17 00:00:00 2001 From: binwiederhier Date: Sat, 31 Dec 2022 09:45:02 -0500 Subject: [PATCH 6/7] Changelog --- docs/releases.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/releases.md b/docs/releases.md index 6eb098b2..78ea2417 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -7,14 +7,15 @@ and the [ntfy Android app](https://github.com/binwiederhier/ntfy-android/release **Features:** * Preliminary `/v1/health` API endpoint for service monitoring (no ticket) +* Add basic health check to `Dockerfile` ([#555](https://github.com/binwiederhier/ntfy/pull/555), thanks to [@bt90](https://github.com/bt90)) **Bug fixes:** -* Fix `chown` issues with RHEL-like based systems ([#566](https://github.com/binwiederhier/ntfy/issues/566)/[#565](https://github.com/binwiederhier/ntfy/pull/565), thanks to [danieldemus](https://github.com/danieldemus)) +* Fix `chown` issues with RHEL-like based systems ([#566](https://github.com/binwiederhier/ntfy/issues/566)/[#565](https://github.com/binwiederhier/ntfy/pull/565), thanks to [@danieldemus](https://github.com/danieldemus)) **Documentation:** -* Add HTTP/2 and TLSv1.3 support to nginx docs ([#553](https://github.com/binwiederhier/ntfy/issues/553), thanks to [bt90](https://github.com/bt90)) +* Add HTTP/2 and TLSv1.3 support to nginx docs ([#553](https://github.com/binwiederhier/ntfy/issues/553), thanks to [@bt90](https://github.com/bt90)) ## ntfy server v1.30.1 Released December 23, 2022 🎅 @@ -33,7 +34,7 @@ roll out the TLSv1.3, HTTP/2 and Unix mode changes on ntfy.sh (see [#552](https: * Remove `--env-topic` option from `ntfy publish` as per [deprecation](deprecations.md) (no ticket) * Prepared statements for message cache writes ([#542](https://github.com/binwiederhier/ntfy/pull/542), thanks to [@nicois](https://github.com/nicois)) * Do not warn about invalid IP address when behind proxy in unix socket mode (relates to [#552](https://github.com/binwiederhier/ntfy/issues/552)) -* Upgrade nginx/ntfy config on ntfy.sh to work with TLSv1.3, HTTP/2 ([#552](https://github.com/binwiederhier/ntfy/issues/552), thanks to [bt90](https://github.com/bt90)) +* Upgrade nginx/ntfy config on ntfy.sh to work with TLSv1.3, HTTP/2 ([#552](https://github.com/binwiederhier/ntfy/issues/552), thanks to [@bt90](https://github.com/bt90)) ## ntfy Android app v1.16.0 Released December 11, 2022 From 1918f7f0aae9533293d2a91cee621551f1540591 Mon Sep 17 00:00:00 2001 From: binwiederhier Date: Sat, 31 Dec 2022 09:48:46 -0500 Subject: [PATCH 7/7] Changelog --- docs/releases.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/releases.md b/docs/releases.md index 78ea2417..c1c78a6b 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -16,6 +16,7 @@ and the [ntfy Android app](https://github.com/binwiederhier/ntfy-android/release **Documentation:** * Add HTTP/2 and TLSv1.3 support to nginx docs ([#553](https://github.com/binwiederhier/ntfy/issues/553), thanks to [@bt90](https://github.com/bt90)) +* Small wording change for `client.yml` ([#562](https://github.com/binwiederhier/ntfy/pull/562), thanks to [@fleopaulD](https://github.com/fleopaulD)) ## ntfy server v1.30.1 Released December 23, 2022 🎅