From 5125aac91c4e6b0730a7a9f9d4c8c72a109fb83e Mon Sep 17 00:00:00 2001 From: Philipp Heckel Date: Wed, 30 Mar 2022 14:23:57 -0400 Subject: [PATCH 1/4] Remove upx for arm64/armv7, more translation credits --- .goreleaser.yml | 10 ++++------ docs/releases.md | 3 ++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 695a381d..2800263f 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -28,9 +28,8 @@ builds: goos: [linux] goarch: [arm] goarm: [7] - hooks: - post: - - upx "{{ .Path }}" # apt install upx + # No "upx", since it causes random core dumps, see + # https://github.com/binwiederhier/ntfy/issues/191#issuecomment-1083406546 - id: ntfy_arm64 binary: ntfy @@ -42,9 +41,8 @@ builds: - "-linkmode=external -extldflags=-static -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}" goos: [linux] goarch: [arm64] - hooks: - post: - - upx "{{ .Path }}" # apt install upx + # No "upx", since it causes random core dumps, see + # https://github.com/binwiederhier/ntfy/issues/191#issuecomment-1083406546 nfpms: - package_name: ntfy diff --git a/docs/releases.md b/docs/releases.md index ffa4456d..818bb42d 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -24,7 +24,7 @@ and the [ntfy Android app](https://github.com/binwiederhier/ntfy-android/release * English language improvements (thanks to [@comradekingu](https://github.com/comradekingu)) * Bulgarian (thanks to [@StoyanDimitrov](https://github.com/StoyanDimitrov)) * Dutch (*incomplete*, thanks to [@diony](https://hosted.weblate.org/user/diony)) -* Chinese (*incomplete*, thanks to [@poi](https://hosted.weblate.org/user/poi)) +* Chinese/Simplified (thanks to [@poi](https://hosted.weblate.org/user/poi) and [@PeterCxy](https://hosted.weblate.org/user/PeterCxy)) * French (*incomplete*, thanks to [@Kusoneko](https://kusoneko.moe/)) * German (thanks to [@cmeis](https://github.com/cmeis)) * Italian (thanks to [@theTranslator](https://hosted.weblate.org/user/theTranslator/)) @@ -42,6 +42,7 @@ and the [ntfy Android app](https://github.com/binwiederhier/ntfy-android/release **Bugs:** +* Do not pack binary with `upx` for armv7/arm64 due to `illegal instruction` errors ([#191](https://github.com/binwiederhier/ntfy/issues/191), thanks to [@iexos](https://github.com/iexos)) * Do not allow comma in topic name in publish via GET endpoint (no ticket) * Add "Access-Control-Allow-Origin: *" for attachments (no ticket, thanks to @FrameXX) * Make pruning run again in web app ([#186](https://github.com/binwiederhier/ntfy/issues/186)) From d154d3936d4a04d662a68c727b13c33719fd7945 Mon Sep 17 00:00:00 2001 From: Philipp Heckel Date: Wed, 30 Mar 2022 14:26:31 -0400 Subject: [PATCH 2/4] Bump version, release notes --- docs/install.md | 46 ++++++++++++++++++---------------------------- docs/releases.md | 17 +++++++++-------- 2 files changed, 27 insertions(+), 36 deletions(-) diff --git a/docs/install.md b/docs/install.md index 64b972b3..94630d83 100644 --- a/docs/install.md +++ b/docs/install.md @@ -26,28 +26,28 @@ deb/rpm packages. === "x86_64/amd64" ```bash - wget https://github.com/binwiederhier/ntfy/releases/download/v1.18.1/ntfy_1.18.1_linux_x86_64.tar.gz - tar zxvf ntfy_1.18.1_linux_x86_64.tar.gz - sudo cp -a ntfy_1.18.1_linux_x86_64/ntfy /usr/bin/ntfy - sudo mkdir /etc/ntfy && sudo cp ntfy_1.18.1_linux_x86_64/{client,server}/*.yml /etc/ntfy + wget https://github.com/binwiederhier/ntfy/releases/download/v1.19.0/ntfy_1.19.0_linux_x86_64.tar.gz + tar zxvf ntfy_1.19.0_linux_x86_64.tar.gz + sudo cp -a ntfy_1.19.0_linux_x86_64/ntfy /usr/bin/ntfy + sudo mkdir /etc/ntfy && sudo cp ntfy_1.19.0_linux_x86_64/{client,server}/*.yml /etc/ntfy sudo ntfy serve ``` === "armv7/armhf" ```bash - wget https://github.com/binwiederhier/ntfy/releases/download/v1.18.1/ntfy_1.18.1_linux_armv7.tar.gz - tar zxvf ntfy_1.18.1_linux_armv7.tar.gz - sudo cp -a ntfy_1.18.1_linux_armv7/ntfy /usr/bin/ntfy - sudo mkdir /etc/ntfy && sudo cp ntfy_1.18.1_linux_armv7/{client,server}/*.yml /etc/ntfy + wget https://github.com/binwiederhier/ntfy/releases/download/v1.19.0/ntfy_1.19.0_linux_armv7.tar.gz + tar zxvf ntfy_1.19.0_linux_armv7.tar.gz + sudo cp -a ntfy_1.19.0_linux_armv7/ntfy /usr/bin/ntfy + sudo mkdir /etc/ntfy && sudo cp ntfy_1.19.0_linux_armv7/{client,server}/*.yml /etc/ntfy sudo ntfy serve ``` === "arm64" ```bash - wget https://github.com/binwiederhier/ntfy/releases/download/v1.18.1/ntfy_1.18.1_linux_arm64.tar.gz - tar zxvf ntfy_1.18.1_linux_arm64.tar.gz - sudo cp -a ntfy_1.18.1_linux_arm64/ntfy /usr/bin/ntfy - sudo mkdir /etc/ntfy && sudo cp ntfy_1.18.1_linux_arm64/{client,server}/*.yml /etc/ntfy + wget https://github.com/binwiederhier/ntfy/releases/download/v1.19.0/ntfy_1.19.0_linux_arm64.tar.gz + tar zxvf ntfy_1.19.0_linux_arm64.tar.gz + sudo cp -a ntfy_1.19.0_linux_arm64/ntfy /usr/bin/ntfy + sudo mkdir /etc/ntfy && sudo cp ntfy_1.19.0_linux_arm64/{client,server}/*.yml /etc/ntfy sudo ntfy serve ``` @@ -94,7 +94,7 @@ Manually installing the .deb file: === "x86_64/amd64" ```bash - wget https://github.com/binwiederhier/ntfy/releases/download/v1.18.1/ntfy_1.18.1_linux_amd64.deb + wget https://github.com/binwiederhier/ntfy/releases/download/v1.19.0/ntfy_1.19.0_linux_amd64.deb sudo dpkg -i ntfy_*.deb sudo systemctl enable ntfy sudo systemctl start ntfy @@ -102,7 +102,7 @@ Manually installing the .deb file: === "armv7/armhf" ```bash - wget https://github.com/binwiederhier/ntfy/releases/download/v1.18.1/ntfy_1.18.1_linux_armv7.deb + wget https://github.com/binwiederhier/ntfy/releases/download/v1.19.0/ntfy_1.19.0_linux_armv7.deb sudo dpkg -i ntfy_*.deb sudo systemctl enable ntfy sudo systemctl start ntfy @@ -110,7 +110,7 @@ Manually installing the .deb file: === "arm64" ```bash - wget https://github.com/binwiederhier/ntfy/releases/download/v1.18.1/ntfy_1.18.1_linux_arm64.deb + wget https://github.com/binwiederhier/ntfy/releases/download/v1.19.0/ntfy_1.19.0_linux_arm64.deb sudo dpkg -i ntfy_*.deb sudo systemctl enable ntfy sudo systemctl start ntfy @@ -120,21 +120,21 @@ Manually installing the .deb file: === "x86_64/amd64" ```bash - sudo rpm -ivh https://github.com/binwiederhier/ntfy/releases/download/v1.18.1/ntfy_1.18.1_linux_amd64.rpm + sudo rpm -ivh https://github.com/binwiederhier/ntfy/releases/download/v1.19.0/ntfy_1.19.0_linux_amd64.rpm sudo systemctl enable ntfy sudo systemctl start ntfy ``` === "armv7/armhf" ```bash - sudo rpm -ivh https://github.com/binwiederhier/ntfy/releases/download/v1.18.1/ntfy_1.18.1_linux_armv7.rpm + sudo rpm -ivh https://github.com/binwiederhier/ntfy/releases/download/v1.19.0/ntfy_1.19.0_linux_armv7.rpm sudo systemctl enable ntfy sudo systemctl start ntfy ``` === "arm64" ```bash - sudo rpm -ivh https://github.com/binwiederhier/ntfy/releases/download/v1.18.1/ntfy_1.18.1_linux_arm64.rpm + sudo rpm -ivh https://github.com/binwiederhier/ntfy/releases/download/v1.19.0/ntfy_1.19.0_linux_arm64.rpm sudo systemctl enable ntfy sudo systemctl start ntfy ``` @@ -194,13 +194,3 @@ COPY server.yml /etc/ntfy/server.yml ENTRYPOINT ["ntfy", "serve"] ``` This image can be pushed to a container registry and shipped independently. All that's needed when running it is mapping ntfy's port to a host port. - -## Go -To install via Go, simply run: -```bash -go install heckel.io/ntfy@latest -``` - -!!! info - Please [let me know](https://github.com/binwiederhier/ntfy/issues) if there are any issues with this installation - method. The SQLite bindings require CGO and it works for me, but I have the feeling it may not work for everyone. diff --git a/docs/releases.md b/docs/releases.md index 818bb42d..2e908111 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -23,13 +23,13 @@ and the [ntfy Android app](https://github.com/binwiederhier/ntfy-android/release * English language improvements (thanks to [@comradekingu](https://github.com/comradekingu)) * Bulgarian (thanks to [@StoyanDimitrov](https://github.com/StoyanDimitrov)) -* Dutch (*incomplete*, thanks to [@diony](https://hosted.weblate.org/user/diony)) * Chinese/Simplified (thanks to [@poi](https://hosted.weblate.org/user/poi) and [@PeterCxy](https://hosted.weblate.org/user/PeterCxy)) +* Dutch (*incomplete*, thanks to [@diony](https://hosted.weblate.org/user/diony)) * French (*incomplete*, thanks to [@Kusoneko](https://kusoneko.moe/)) * German (thanks to [@cmeis](https://github.com/cmeis)) * Italian (thanks to [@theTranslator](https://hosted.weblate.org/user/theTranslator/)) * Norwegian (*incomplete*, thanks to [@comradekingu](https://github.com/comradekingu)) -* Portuguese (Brazil, thanks to [@LW](https://hosted.weblate.org/user/LW/)) +* Portuguese/Brazil (thanks to [@LW](https://hosted.weblate.org/user/LW/)) * Spanish (thanks to [@rogeliodh](https://github.com/rogeliodh)) * Turkish (thanks to [@ersen](https://ersen.moe/)) @@ -38,22 +38,23 @@ and the [ntfy Android app](https://github.com/binwiederhier/ntfy-android/release * Many thanks to [@cmeis](https://github.com/cmeis), [@Fallenbagel](https://github.com/Fallenbagel), [@Joeharrison94](https://github.com/Joeharrison94), and [@rogeliodh](https://github.com/rogeliodh) for input on the new attachment logic, and for testing the release -## ntfy server v1.19.0 (UNRELEASED) +--> + +## ntfy server v1.19.0 +Released Mar 30, 2022 **Bugs:** -* Do not pack binary with `upx` for armv7/arm64 due to `illegal instruction` errors ([#191](https://github.com/binwiederhier/ntfy/issues/191), thanks to [@iexos](https://github.com/iexos)) -* Do not allow comma in topic name in publish via GET endpoint (no ticket) +* Do not pack binary with `upx` for armv7/arm64 due to `illegal instruction` errors ([#191](https://github.com/binwiederhier/ntfy/issues/191), thanks to [@iexos](https://github.com/iexos)) +* Do not allow comma in topic name in publish via GET endpoint (no ticket) * Add "Access-Control-Allow-Origin: *" for attachments (no ticket, thanks to @FrameXX) -* Make pruning run again in web app ([#186](https://github.com/binwiederhier/ntfy/issues/186)) +* Make pruning run again in web app ([#186](https://github.com/binwiederhier/ntfy/issues/186)) * Added missing params `delay` and `email` to publish as JSON body (no ticket) **Documentation:** * Improved [e-mail publishing](config.md#e-mail-publishing) documentation ---> - ## ntfy server v1.18.1 Released Mar 21, 2022 _This release ships no features or bug fixes. It's merely a documentation update._ From 59ec2de8bd99763b515b1df25678dfac37185820 Mon Sep 17 00:00:00 2001 From: Philipp Heckel Date: Wed, 30 Mar 2022 14:37:42 -0400 Subject: [PATCH 3/4] Fix race in test --- server/server_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/server_test.go b/server/server_test.go index 062821d8..67aff540 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -714,6 +714,12 @@ func (t *testMailer) Send(from, to string, m *message) error { return nil } +func (t *testMailer) Count() int { + t.mu.Lock() + defer t.mu.Unlock() + return t.count +} + func TestServer_PublishTooRequests_Defaults(t *testing.T) { s := newTestServer(t, newTestConfig(t)) for i := 0; i < 60; i++ { @@ -902,7 +908,7 @@ func TestServer_PublishAsJSON_WithEmail(t *testing.T) { m := toMessage(t, response.Body.String()) require.Equal(t, "mytopic", m.Topic) require.Equal(t, "A message", m.Message) - require.Equal(t, 1, mailer.count) + require.Equal(t, 1, mailer.Count()) } func TestServer_PublishAsJSON_Invalid(t *testing.T) { From 5aedfd3898696c9d4f5c924ffa79560ab6b50b86 Mon Sep 17 00:00:00 2001 From: Philipp Heckel Date: Wed, 30 Mar 2022 20:17:11 -0400 Subject: [PATCH 4/4] Changelog --- docs/releases.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/releases.md b/docs/releases.md index 2e908111..2cc9efbe 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -18,6 +18,7 @@ and the [ntfy Android app](https://github.com/binwiederhier/ntfy-android/release * IllegalStateException: Failed to build unique file ([#177](https://github.com/binwiederhier/ntfy/issues/177), thanks to [@Fallenbagel](https://github.com/Fallenbagel) for reporting) * SQLiteConstraintException: Crash during UP registration ([#185](https://github.com/binwiederhier/ntfy/issues/185)) * Refresh preferences screen after settings import (#183, thanks to [@cmeis](https://github.com/cmeis) for reporting) +* Add priority strings to strings.xml to make it translatable (#192, thanks to [@StoyanDimitrov](https://github.com/StoyanDimitrov)) **Translations:**