mirror of
https://github.com/crazy-max/diun.git
synced 2025-12-21 13:23:09 +01:00
Added sound option for pushover
This commit is contained in:
@@ -10,6 +10,8 @@ You can send notifications using [Pushover](https://pushover.net/).
|
|||||||
pushover:
|
pushover:
|
||||||
token: uQiRzpo4DXghDmr9QzzfQu27cmVRsG
|
token: uQiRzpo4DXghDmr9QzzfQu27cmVRsG
|
||||||
recipient: gznej3rKEVAvPUxu9vvNnqpmZpokzF
|
recipient: gznej3rKEVAvPUxu9vvNnqpmZpokzF
|
||||||
|
priority: -2
|
||||||
|
sound: none
|
||||||
templateTitle: "{{ .Entry.Image }} released"
|
templateTitle: "{{ .Entry.Image }} released"
|
||||||
templateBody: |
|
templateBody: |
|
||||||
Docker tag {{ .Entry.Image }} which you subscribed to through {{ .Entry.Provider }} provider has been released.
|
Docker tag {{ .Entry.Image }} which you subscribed to through {{ .Entry.Provider }} provider has been released.
|
||||||
@@ -21,6 +23,8 @@ You can send notifications using [Pushover](https://pushover.net/).
|
|||||||
| `tokenFile` | | Use content of secret file as Pushover application/API token if `token` not defined |
|
| `tokenFile` | | Use content of secret file as Pushover application/API token if `token` not defined |
|
||||||
| `recipient` | | User key to send notification to |
|
| `recipient` | | User key to send notification to |
|
||||||
| `recipientFile` | | Use content of secret file as User key if `recipient` not defined |
|
| `recipientFile` | | Use content of secret file as User key if `recipient` not defined |
|
||||||
|
| `priority` | | Priority of the notification |
|
||||||
|
| `sound` | | Notification sound to be used |
|
||||||
| `templateTitle`[^1] | See [below](#default-templatetitle) | [Notification template](../faq.md#notification-template) for message title |
|
| `templateTitle`[^1] | See [below](#default-templatetitle) | [Notification template](../faq.md#notification-template) for message title |
|
||||||
| `templateBody`[^1] | See [below](#default-templatebody) | [Notification template](../faq.md#notification-template) for message body |
|
| `templateBody`[^1] | See [below](#default-templatebody) | [Notification template](../faq.md#notification-template) for message body |
|
||||||
|
|
||||||
@@ -29,6 +33,8 @@ You can send notifications using [Pushover](https://pushover.net/).
|
|||||||
* `DIUN_NOTIF_PUSHOVER_TOKENFILE`
|
* `DIUN_NOTIF_PUSHOVER_TOKENFILE`
|
||||||
* `DIUN_NOTIF_PUSHOVER_RECIPIENT`
|
* `DIUN_NOTIF_PUSHOVER_RECIPIENT`
|
||||||
* `DIUN_NOTIF_PUSHOVER_RECIPIENTFILE`
|
* `DIUN_NOTIF_PUSHOVER_RECIPIENTFILE`
|
||||||
|
* `DIUN_NOTIF_PUSHOVER_PRIORITY`
|
||||||
|
* `DIUN_NOTIF_PUSHOVER_SOUND`
|
||||||
* `DIUN_NOTIF_PUSHOVER_TEMPLATETITLE`
|
* `DIUN_NOTIF_PUSHOVER_TEMPLATETITLE`
|
||||||
* `DIUN_NOTIF_PUSHOVER_TEMPLATEBODY`
|
* `DIUN_NOTIF_PUSHOVER_TEMPLATEBODY`
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ type NotifPushover struct {
|
|||||||
Recipient string `yaml:"recipient,omitempty" json:"recipient,omitempty" validate:"omitempty"`
|
Recipient string `yaml:"recipient,omitempty" json:"recipient,omitempty" validate:"omitempty"`
|
||||||
RecipientFile string `yaml:"recipientFile,omitempty" json:"recipientFile,omitempty" validate:"omitempty,file"`
|
RecipientFile string `yaml:"recipientFile,omitempty" json:"recipientFile,omitempty" validate:"omitempty,file"`
|
||||||
Priority int `yaml:"priority,omitempty" json:"priority,omitempty" validate:"omitempty,min=-2,max=2"`
|
Priority int `yaml:"priority,omitempty" json:"priority,omitempty" validate:"omitempty,min=-2,max=2"`
|
||||||
|
Sound string `yaml:"sound,omitempty" json:"sound,omitempty" validate:"omitempty"`
|
||||||
TemplateTitle string `yaml:"templateTitle,omitempty" json:"templateTitle,omitempty" validate:"required"`
|
TemplateTitle string `yaml:"templateTitle,omitempty" json:"templateTitle,omitempty" validate:"required"`
|
||||||
TemplateBody string `yaml:"templateBody,omitempty" json:"templateBody,omitempty" validate:"required"`
|
TemplateBody string `yaml:"templateBody,omitempty" json:"templateBody,omitempty" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ func (c *Client) Send(entry model.NotifEntry) error {
|
|||||||
Title: string(title),
|
Title: string(title),
|
||||||
Message: string(body),
|
Message: string(body),
|
||||||
Priority: c.cfg.Priority,
|
Priority: c.cfg.Priority,
|
||||||
|
Sound: c.cfg.Sound,
|
||||||
URL: c.meta.URL,
|
URL: c.meta.URL,
|
||||||
URLTitle: c.meta.Name,
|
URLTitle: c.meta.Name,
|
||||||
Timestamp: time.Now().Unix(),
|
Timestamp: time.Now().Unix(),
|
||||||
|
|||||||
Reference in New Issue
Block a user