From 30c2a678698908a8c26a474d9d47731f37ed83e9 Mon Sep 17 00:00:00 2001 From: Philipp Heckel Date: Sun, 19 Jun 2022 21:33:17 -0400 Subject: [PATCH] Disallow setting `upstream-base-url` to the same value as `base-url` --- cmd/serve.go | 2 ++ docs/releases.md | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/serve.go b/cmd/serve.go index b28bf46e..83907b06 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -162,6 +162,8 @@ func execServe(c *cli.Context) error { return errors.New("if set, upstream-base-url must start with http:// or https://") } else if upstreamBaseURL != "" && baseURL == "" { return errors.New("if upstream-base-url is set, base-url must also be set") + } else if upstreamBaseURL != "" && baseURL != "" && baseURL == upstreamBaseURL { + return errors.New("base-url and upstream-base-url cannot be identical, you'll likely want to set upstream-base-url to https://ntfy.sh, see https://ntfy.sh/docs/config/#ios-instant-notifications") } webRootIsApp := webRoot == "app" diff --git a/docs/releases.md b/docs/releases.md index 064e7d07..3f5a7b6c 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -13,7 +13,7 @@ and the [ntfy Android app](https://github.com/binwiederhier/ntfy-android/release **Bugs:** * Return HTTP 500 for GET /_matrix/push/v1/notify when base-url is not configured (no ticket) - +* Disallow setting `upstream-base-url` to the same value as `base-url` ([#334](https://github.com/binwiederhier/ntfy/issues/334), thanks to [@oester](https://github.com/oester) for reporting) ## ntfy Android app v1.14.0 (UNRELEASED)