Skip to content

ntfy: document base-url requirement for iOS push - #7851

Open
jauderho wants to merge 1 commit into
mainfrom
ntfy-ios-config-fix
Open

ntfy: document base-url requirement for iOS push#7851
jauderho wants to merge 1 commit into
mainfrom
ntfy-ios-config-fix

Conversation

@jauderho

Copy link
Copy Markdown
Owner

Fixes #5050. Supersedes #5334.

Problem

ntfy/README.md told users to put this in server.yml:

upstream-base-url: "https://ntfy.sh"

ntfy refuses to start with that config:

if upstream-base-url is set, base-url must also be set

The check is at cmd/serve.go (upstreamBaseURL != "" && baseURL == ""). So following the README produced a server that would not boot.

base-url matters for a second reason: the upstream Firebase topic is the SHA256 of the topic URL, so an absent or wrong base-url sends the poll_request to a topic no device is subscribed to.

Changes

ntfy/README.md only. No Dockerfile changes.

  • Add the required base-url alongside upstream-base-url, with the constraints (no trailing slash, no path, must differ from upstream-base-url).
  • Add the NTFY_BASE_URL / NTFY_UPSTREAM_BASE_URL environment variable form.
  • State the default config path, /etc/ntfy/server.yml.
  • Mention upstream-access-token for the rate-limit case.
  • Correct the claim that iOS messages "will not be delivered" without an upstream server. Per upstream docs, delivery is delayed, not dropped.

Verification

Built locally from ntfy/Dockerfile at BUILD_VERSION=v2.27.0:

Check Result
Old README config (upstream-base-url alone) fails: if upstream-base-url is set, base-url must also be set
New README yaml block, verbatim starts: Listening on :80[http], ntfy v2.27.0
NTFY_BASE_URL + NTFY_UPSTREAM_BASE_URL starts
Publish then poll round trip message returned intact

Note on #5334

#5334 documents APNS credentials (.p8 auth key, Key ID, Team ID) in server.yml, and adds commented NTFY_IOS_KEY_ID / NTFY_IOS_TEAM_ID / NTFY_IOS_PRIVATE_KEY_FILE hints to the Dockerfile. Those options do not exist in ntfy; self-hosted servers never handle APNs credentials directly. It also links to a #ios-notifications-apns anchor that is not on the page, and adds VOLUME /etc/ntfy to a config directory, which creates an anonymous volume on every docker run that omits a mount. Upstream's Dockerfile declares no VOLUME, and the bind mount works without it. Recommend closing #5334.

The documented server.yml set upstream-base-url only. ntfy refuses to
start in that state: "if upstream-base-url is set, base-url must also be
set". base-url is also necessary because the upstream topic is derived
from the topic URL, so a wrong value sends the poll request to a topic no
device listens on.

Add base-url, the environment variable form, and the default config path.
Correct the claim that iOS messages are not delivered without an upstream
server; delivery is delayed, not dropped.

Verified against ntfy v2.27.0: the config starts the server and a publish
and poll round trip returns the message.

Signed-off-by: Jauder Ho <jauderho@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ntfy does not work with ios

1 participant