Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/using-seerr/notifications/ntfy.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Set this to the URL of your ntfy.sh server.

Set this to the topic you want to send notifications to.

### Tags (optional)

Set this to a comma-separated list of ntfy tags to apply to notifications (for example, `eyes` or `eyes,warning`).
Comment thread
bartdelange marked this conversation as resolved.
Outdated

### Username + Password authentication (optional)

Set this to the username and password for your ntfy.sh server.
Expand Down
2 changes: 2 additions & 0 deletions seerr-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1554,6 +1554,8 @@ components:
type: string
topic:
type: string
tags:
type: string
authMethodUsernamePassword:
type: boolean
username:
Expand Down
7 changes: 7 additions & 0 deletions server/lib/notifications/agents/ntfy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ class NtfyAgent
const embedPoster = settings.embedPoster;

const topic = settings.options.topic;
const tags = settings.options.tags
?.split(',')
.map((tag) => tag.trim())
.filter((tag) => tag.length > 0);
const priority = settings.options.priority ?? 3;

const title = payload.event
Expand Down Expand Up @@ -102,6 +106,9 @@ class NtfyAgent
message,
markdown: true,
};
if (tags && tags.length > 0) {
ntfyPayload.tags = tags;
}
if (attach) {
ntfyPayload.attach = attach;
}
Expand Down
2 changes: 2 additions & 0 deletions server/lib/settings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ export interface NotificationAgentNtfy extends NotificationAgentConfig {
options: {
url: string;
topic: string;
tags?: string;
authMethodUsernamePassword?: boolean;
username?: string;
password?: string;
Expand Down Expand Up @@ -563,6 +564,7 @@ class Settings {
options: {
url: '',
topic: '',
tags: '',
priority: 3,
locale: 'en',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ const messages = defineMessages(
embedPoster: 'Embed Poster',
url: 'Server root URL',
topic: 'Topic',
tags: 'Tags',
tagsPlaceholder: 'eyes,warning',
usernamePasswordAuth: 'Username + Password authentication',
username: 'Username',
password: 'Password',
Expand Down Expand Up @@ -100,6 +102,7 @@ const NotificationsNtfy = () => {
types: data?.types,
url: data?.options.url,
topic: data?.options.topic,
tags: data?.options.tags ?? '',
authMethodUsernamePassword: data?.options.authMethodUsernamePassword,
username: data?.options.username,
password: data?.options.password,
Expand All @@ -118,6 +121,7 @@ const NotificationsNtfy = () => {
options: {
url: values.url,
topic: values.topic,
tags: values.tags,
authMethodUsernamePassword: values.authMethodUsernamePassword,
username: values.username,
password: values.password,
Expand Down Expand Up @@ -171,6 +175,7 @@ const NotificationsNtfy = () => {
options: {
url: values.url,
topic: values.topic,
tags: values.tags,
authMethodUsernamePassword: values.authMethodUsernamePassword,
username: values.username,
password: values.password,
Expand Down Expand Up @@ -252,6 +257,21 @@ const NotificationsNtfy = () => {
)}
</div>
</div>
<div className="form-row">
<label htmlFor="tags" className="text-label">
{intl.formatMessage(messages.tags)}
</label>
<div className="form-input-area">
<div className="form-input-field">
<Field
id="tags"
name="tags"
type="text"
placeholder={intl.formatMessage(messages.tagsPlaceholder)}
/>
</div>
</div>
</div>
<div className="form-row">
<label
htmlFor="authMethodUsernamePassword"
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,8 @@
"components.Settings.Notifications.NotificationsNtfy.ntfysettingssaved": "Ntfy notification settings saved successfully!",
"components.Settings.Notifications.NotificationsNtfy.password": "Password",
"components.Settings.Notifications.NotificationsNtfy.priority": "Priority",
"components.Settings.Notifications.NotificationsNtfy.tags": "Tags",
"components.Settings.Notifications.NotificationsNtfy.tagsPlaceholder": "eyes,warning",
"components.Settings.Notifications.NotificationsNtfy.toastNtfyTestFailed": "Ntfy test notification failed to send.",
"components.Settings.Notifications.NotificationsNtfy.toastNtfyTestSending": "Sending ntfy test notification…",
"components.Settings.Notifications.NotificationsNtfy.toastNtfyTestSuccess": "Ntfy test notification sent!",
Expand Down
Loading