diff --git a/Dockerfile b/Dockerfile index 6916cabc..52ccff6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,5 +3,7 @@ MAINTAINER Philipp C. Heckel COPY ntfy /usr/bin +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"] 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) diff --git a/docs/releases.md b/docs/releases.md index 6e8cfba0..c1c78a6b 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -7,10 +7,16 @@ 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)) **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)) +* 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 🎅 @@ -29,7 +35,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 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