Просмотр исходного кода

Merge branch 'main' into custom-messages

Philipp Heckel 3 лет назад
Родитель
Сommit
9814a9f792
4 измененных файлов с 39 добавлено и 42 удалено
  1. 4 6
      .goreleaser.yml
  2. 18 28
      docs/install.md
  3. 10 7
      docs/releases.md
  4. 7 1
      server/server_test.go

+ 4 - 6
.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

+ 18 - 28
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.

+ 10 - 7
docs/releases.md

@@ -18,18 +18,19 @@ 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:**
 
 * English language improvements (thanks to [@comradekingu](https://github.com/comradekingu))
 * Bulgarian (thanks to [@StoyanDimitrov](https://github.com/StoyanDimitrov)) 
+* 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))
-* Chinese (*incomplete*, thanks to [@poi](https://hosted.weblate.org/user/poi))
 * 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,21 +39,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 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._

+ 7 - 1
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) {