From d0bbda555fa903fbadea49e65475dae3a62f275b Mon Sep 17 00:00:00 2001 From: Philipp Heckel Date: Sun, 13 Mar 2022 22:16:48 -0400 Subject: [PATCH] Add Android WebSockets deprecation, remove 'ntfy serve' deprecation --- cmd/app.go | 9 --------- docs/config.md | 6 ++++-- docs/deprecations.md | 12 ++++++++++-- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/cmd/app.go b/cmd/app.go index 9ef5679b..85540cee 100644 --- a/cmd/app.go +++ b/cmd/app.go @@ -30,9 +30,6 @@ func New() *cli.App { Reader: os.Stdin, Writer: os.Stdout, ErrWriter: os.Stderr, - Action: execMainApp, - Before: initConfigFileInputSource("config", flagsServe), // DEPRECATED, see deprecation notice - Flags: flagsServe, // DEPRECATED, see deprecation notice Commands: []*cli.Command{ // Server commands cmdServe, @@ -46,12 +43,6 @@ func New() *cli.App { } } -func execMainApp(c *cli.Context) error { - fmt.Fprintln(c.App.ErrWriter, "\x1b[1;33mDeprecation notice: Please run the server using 'ntfy serve'; see 'ntfy -h' for help.\x1b[0m") - fmt.Fprintln(c.App.ErrWriter, "\x1b[1;33mThis way of running the server will be removed March 2022. See https://ntfy.sh/docs/deprecations/ for details.\x1b[0m") - return execServe(c) -} - // initConfigFileInputSource is like altsrc.InitInputSourceWithContext and altsrc.NewYamlSourceFromFlagFunc, but checks // if the config flag is exists and only loads it if it does. If the flag is set and the file exists, it fails. func initConfigFileInputSource(configFlag string, flags []cli.Flag) cli.BeforeFunc { diff --git a/docs/config.md b/docs/config.md index 049826fb..14c125d4 100644 --- a/docs/config.md +++ b/docs/config.md @@ -399,8 +399,10 @@ HTTP challenge. I've found [this guide](https://nandovieira.com/using-lets-encry be incredibly helpful. ### nginx/Apache2/caddy -For your convenience, here's a working config that'll help configure things behind a proxy. In this -example, ntfy runs on `:2586` and we proxy traffic to it. We also redirect HTTP to HTTPS for GET requests against a topic +For your convenience, here's a working config that'll help configure things behind a proxy. Be sure to **enable WebSockets** +by forwarding the `Connection` and `Upgrade` headers accordingly. + +In this example, ntfy runs on `:2586` and we proxy traffic to it. We also redirect HTTP to HTTPS for GET requests against a topic or the root domain: === "nginx (/etc/nginx/sites-*/ntfy)" diff --git a/docs/deprecations.md b/docs/deprecations.md index e35c4cb8..133a8314 100644 --- a/docs/deprecations.md +++ b/docs/deprecations.md @@ -4,7 +4,13 @@ This page is used to list deprecation notices for ntfy. Deprecated commands and ## Active deprecations -### Android app: Using `since=` instead of `since=` +### Android app: WebSockets will become the default connection protocol +> since 2022-03-13 + +In future versions of the Android app, instant delivery connections and connections to self-hosted servers will +be using the WebSockets protocol. This potentially requires [configuration changes in your proxy](https://ntfy.sh/docs/config/#nginxapache2caddy). + +### Android app: Using `since=` instead of `since=` > since 2022-02-27 In about 3 months, the Android app will start using `since=` instead of `since=`, which means that it will @@ -12,8 +18,10 @@ not work with servers older than v1.16.0 anymore. This is to simplify handling o The `since=` endpoint will continue to work. This is merely a notice that the Android app behavior will change. +## Previous deprecations + ### Running server via `ntfy` (instead of `ntfy serve`) -> since 2021-12-17 +> deprecated 2021-12-17, behavior changed with v1.10.0 As more commands are added to the `ntfy` CLI tool, using just `ntfy` to run the server is not practical anymore. Please use `ntfy serve` instead. This also applies to Docker images, as they can also execute more than