Commit Graph

912 Commits

Author SHA1 Message Date
Bo-Yi Wu e75b92e2b2 fix: remove gopath 2019-03-16 11:49:33 +08:00
Bo-Yi Wu 45eefea636 feat: support windows build 2019-03-16 11:48:30 +08:00
Bo-Yi Wu 74f1e6573c feat: support windows build 2019-03-16 11:46:37 +08:00
Bo-Yi Wu 9e53ba9917 docs: [ci skip] remove FOSSA badge 2019-03-16 11:37:42 +08:00
Bo-Yi Wu 3f223cf6c0
feat: switch to drone 1.0 (#399)
fix #397
2019-03-16 11:37:01 +08:00
Bo-Yi Wu 5321ed4575 feat: switch vendor to go mod. 2019-03-16 09:27:47 +08:00
Daniel Jankowski 7f97bbf178 fixed: sound without a critical alert in ios push notifications (#394)
Currently the notification, if a sound is specified, will be converted into a critical notification. This behaviour occurs because the sideshow/apns2 package initializes a new sound-dict on `payload.SoundName()` and inserts the name into it. If the sound-key is specified as a dictionary, the alert will be seen as a critical alert according to the documentation [developer.apple.com/documentation/usernotifications](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification#2943363).

In order to prevent the notification to get a critical one by specifying a sound, the sound name from the rest-API needs to be set as string to the sound-property of the payload for apns. This can be achieved by setting either the sound-key from the request to the sound property of the payload if it is a string or by setting the soundname-key from the request to the sound property without the usage of `payload.SoundName()`. For more consistency to the documentation, this pull request implements the variant, that the sound-key from the request is set as string into the sound-property of the apns-payload.
2019-03-14 00:01:15 +08:00
Bo-Yi Wu cea2056d26 feat(makefile): add phony for build. 2019-02-04 18:13:55 +08:00
Belek 1ef90c8461 Update README.md. Clarify sending notifications using Firebase (#392)
It was [not obvious](https://github.com/appleboy/gorush/issues/391) that I should specify `platform=2 (Android)` if  I want to send notifications on both Android and iOS devices using Firebase, so here are some changes in documentation. Thanks!
2019-02-04 18:06:09 +08:00
Bo-Yi Wu 1005389bdf chore: upgrade go module for go1.11.4 2018-12-19 23:37:39 +08:00
Bo-Yi Wu a7a451e363
fix(ios): mapstructure for sound field. (#385) 2018-11-20 17:01:35 +08:00
Bo-Yi Wu 375eec1d90
feat(ios12): Add support for Summary arguments in notifications (#384)
* feat(ios12): Add support for Summary arguments in notifications

* feat: upgrade go module
2018-11-20 11:02:26 +08:00
Bo-Yi Wu 49a81edbd0 chore(module): update module version. 2018-11-15 15:48:22 +08:00
Bo-Yi Wu facb8a9834
refactor(proto): upgrade to gogo/protobuf/protoc-gen-gofast (#381)
* refactor(proto): upgrade to gogo/protobuf/protoc-gen-gofast

* feat: update

* feat: update
2018-11-15 15:42:09 +08:00
Bo-Yi Wu ffaae07b86 docs: add license badge 2018-11-09 14:43:34 +08:00
Dmitry Dorogin a27fc1f754 Update README.md (#378) 2018-10-18 09:00:25 +08:00
Bo-Yi Wu cf56fda8db fix typo
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2018-10-15 11:57:24 +08:00
Bo-Yi Wu fe2159c7b8 docs: add install from source section. 2018-10-15 11:56:29 +08:00
Bo-Yi Wu 4d34ccecf0
feat: support go module on 1.11 (#377) 2018-10-15 11:49:53 +08:00
Bo-Yi Wu 36fea0bfed fix: Fix golint to new URL 2018-10-14 15:11:05 +08:00
Bo-Yi Wu 9c3e923959 update golang to 1.11
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2018-09-22 17:40:22 +08:00
Iskander (Alex) Sharipov d275ddbccb gorush: do less copying in queueNotification (#370)
The PushNotification object is quite big (772 bytes on AMD64),
so avoid doing too many copying without a need.

Collect pointers and do copying only when sending into a channel.

Found using https://go-critic.github.io/overview#rangeValCopy-ref

Linter output:
```
$GOPATH/src/github.com/appleboy/gorush/gorush/worker.go:38:2: rangeValCopy: each iteration copies 772 bytes (consider pointers or indexing)
$GOPATH/src/github.com/appleboy/gorush/gorush/worker.go:53:2: rangeValCopy: each iteration copies 772 bytes (consider pointers or indexing)
```
2018-09-17 14:55:23 +08:00
Iskander (Alex) Sharipov 313544bde6 remove unnecessary wrapping lambda, use function value directly (#372)
Found using https://go-critic.github.io/overview#unlambda-ref
2018-09-14 08:50:11 +08:00
Iskander (Alex) Sharipov 82c3ceb70d remove dead code after log.Fatal call (#371)
Found using https://go-critic.github.io/overview#deadCodeAfterLogFatal-ref
2018-09-14 08:42:43 +08:00
Bo-Yi Wu 83493949ac fix: json format. 2018-08-28 11:38:26 +08:00
Bo-Yi Wu 64f9aab62d fix: json format. 2018-08-28 11:37:36 +08:00
Bo-Yi Wu b5603fa8c2
docs(ios): Support iOS 12 Critical Alerts (#368) 2018-08-28 11:14:02 +08:00
Bo-Yi Wu 0c89fd1d81
feat(ios): Support iOS 12 Critical Alerts (#367)
fix https://github.com/appleboy/gorush/issues/366
2018-08-28 11:02:13 +08:00
Bo-Yi Wu 880752d88c feat(vendor): update go-fcm package. 2018-08-23 22:15:30 +08:00
Bo-Yi Wu b4daa36890 fix: embedmd check 2018-08-15 15:07:08 +08:00
Bo-Yi Wu 4f0f9f95a9 chore(config): check error from load yaml config. 2018-08-15 14:56:52 +08:00
Bo-Yi Wu 24871e0ba9 fix: comment coverage check 2018-08-15 14:38:13 +08:00
Eduard Pelesh bf97ca59ec Added mutable_content option for Firebase (#364)
It is now possible to send `mutable_content` option to Firebase which gets forwarded as `mutable-content` option for APNS.

A link to official documentation is: https://firebase.google.com/docs/cloud-messaging/http-server-ref#mutable_content
2018-08-15 11:47:15 +08:00
Stefan Arentz 437092c697 Also build OpenBSD binaries (#362)
This patch simply adds `openbsd` to `TARGETS`. This is a supported Go architecture and the result will be binaries that can be run on 32 or 64-bit OpenBSD.

This project is hard to build on OpenBSD because it depends on some Linux-isms like *GNU Make* and specific `find` options. So it will be nice to have binaries easily available.
2018-07-16 10:20:45 +08:00
Bo-Yi Wu 014aa2a2ac fix: Provide a password using STDIN 2018-06-27 12:03:44 +08:00
Bo-Yi Wu 5d5127b690
feat: support install from homebrew (#360)
* feat: support install from homebrew

* docs: add readme.
2018-06-27 09:28:27 +08:00
sysradium bcf18d662a Set IOS key_path to an empty string (#359)
At the moment you can't start gorush with IOS base64 certificate provided using an ENV var. 

Apparently viper uses default value for the configuration field even if you set env var to an empty string. So `if var is not set` or `is set and string is empty` => default value.

Which means that if I only use env vars for configuration and I want to use IOS certificate in base64 I can not set `cert_path` to an empty string, so `gorush` uses base64 cert:

https://github.com/appleboy/gorush/blob/master/gorush/notification.go#L180

I.e.:
```
ORUSH_IOS_ENABLED=true GORUSH_IOS_KEY_PATH="" GORUSH_IOS_KEY_TYPE=p12  GORUSH_IOS_KEY_BASE64="SOME_BASE64" go run main.go
(config.SectionIos) {
 Enabled: (bool) true,
 KeyPath: (string) (len=7) "key.pem", <--- still key.pem
 KeyBase64: (string) (len=2) "SOME_BASE64",
 KeyType: (string) (len=3) "p12",
 Password: (string) "",
 Production: (bool) false,
 MaxRetry: (int) 0,
 KeyID: (string) "",
 TeamID: (string) ""
}
FATA[2018/06/10 - 12:42:09] certificate file does not exist
```
So by default `KeyPath` should an empty string. Then I can set only if I want.
2018-06-20 09:34:49 +08:00
Bo-Yi Wu 251429530d chore(CI): add when in testing 2018-05-22 15:32:44 +08:00
Bo-Yi Wu a8994a5110
fix(debug): show error message. (#356) 2018-05-22 10:19:13 +08:00
Bo-Yi Wu 1b2a418ad3 revert
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2018-05-21 11:27:57 +08:00
Bo-Yi Wu add4afd56f update golang version
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2018-05-21 10:53:49 +08:00
Bo-Yi Wu f6c465e2e1 docs: update doc 2018-05-21 10:21:59 +08:00
Bo-Yi Wu 0adf7b7f1f chore(drone): update golang version 2018-05-21 10:01:54 +08:00
Bo-Yi Wu b94a538d7b chore: upgrade apns2 version 2018-05-21 10:01:00 +08:00
Bo-Yi Wu 672ac28d8f
chore(coverage): update coverage command. (#354)
* chore(coverage): update coverage command.

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2018-04-22 09:17:16 +08:00
Bo-Yi Wu ffa8eb12b3
feat: Add badgerDB support. (#353)
See https://github.com/dgraph-io/badger
Slide: https://github.com/gopherchina/conference/blob/master/2018/1.5%20Badger_%20Fast%20Key-Value%20DB%20in%20Go.pdf
2018-04-16 17:26:15 +08:00
Bo-Yi Wu 069efa9e5e test: add doc for testing gorush 2018-04-11 10:46:31 +08:00
Bo-Yi Wu e96811ae63
chore: return success for rpc response. (#350) 2018-04-11 10:14:28 +08:00
Bo-Yi Wu fea79dd14a fix: typo in header. 2018-03-22 20:41:00 +08:00
Bo-Yi Wu b3bdd9b79e
feat(docker): test a container to check that it is still working (#346) 2018-03-17 23:07:38 +08:00