feat: add Apprise alerting capabilities with user and admin notification channels
Agent-Logs-Url: https://github.com/christianlouis/pop_puller_to_gmail/sessions/858e72a6-5282-4ce8-b38a-db4b9e2e6f65 Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -225,7 +225,10 @@ class NotificationConfigBase(BaseModel):
|
|||||||
channel: NotificationChannel
|
channel: NotificationChannel
|
||||||
apprise_url: Optional[str] = Field(None, description="Apprise notification URL")
|
apprise_url: Optional[str] = Field(None, description="Apprise notification URL")
|
||||||
is_enabled: bool = True
|
is_enabled: bool = True
|
||||||
config: Dict[str, Any] = Field(default_factory=dict)
|
config: Dict[str, Any] = Field(
|
||||||
|
default_factory=dict,
|
||||||
|
description="Legacy channel-specific configuration (deprecated in favour of apprise_url)",
|
||||||
|
)
|
||||||
notify_on_errors: bool = True
|
notify_on_errors: bool = True
|
||||||
notify_on_success: bool = False
|
notify_on_success: bool = False
|
||||||
notify_threshold: int = Field(default=3, gt=0, le=100)
|
notify_threshold: int = Field(default=3, gt=0, le=100)
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ async def send_user_notification(
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
success = await _send_apprise(str(config.apprise_url), title, body)
|
success = await _send_apprise(config.apprise_url or "", title, body)
|
||||||
if success:
|
if success:
|
||||||
sent += 1
|
sent += 1
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
@@ -99,7 +99,7 @@ async def send_admin_notification(
|
|||||||
sent = 0
|
sent = 0
|
||||||
for config in configs:
|
for config in configs:
|
||||||
try:
|
try:
|
||||||
success = await _send_apprise(str(config.apprise_url), title, body)
|
success = await _send_apprise(config.apprise_url or "", title, body)
|
||||||
if success:
|
if success:
|
||||||
sent += 1
|
sent += 1
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
|
|||||||
+4
-1
@@ -197,7 +197,7 @@ Comprehensive task breakdown for repository improvements and production readines
|
|||||||
- [x] Message deduplication (POP3 UIDL + IMAP \Seen flag + DB tracking)
|
- [x] Message deduplication (POP3 UIDL + IMAP \Seen flag + DB tracking)
|
||||||
- [x] **Debug email**: "Send Debug Email" button in Settings injects a test message (from christian@docuelevate.org, dated today, labelled `test` + `imported`, placed in inbox) to verify end-to-end Gmail API delivery
|
- [x] **Debug email**: "Send Debug Email" button in Settings injects a test message (from christian@docuelevate.org, dated today, labelled `test` + `imported`, placed in inbox) to verify end-to-end Gmail API delivery
|
||||||
- [ ] Implement GDPR data export endpoint
|
- [ ] Implement GDPR data export endpoint
|
||||||
- [ ] Complete notification service integration (Apprise)
|
- [x] Complete notification service integration (Apprise)
|
||||||
- [ ] Add advanced email filtering
|
- [ ] Add advanced email filtering
|
||||||
- [ ] Implement OAuth2 for Gmail (instead of App Passwords)
|
- [ ] Implement OAuth2 for Gmail (instead of App Passwords)
|
||||||
- [ ] Add attachment handling improvements
|
- [ ] Add attachment handling improvements
|
||||||
@@ -238,6 +238,9 @@ because the API client layer is missing.
|
|||||||
- [ ] Error boundary components
|
- [ ] Error boundary components
|
||||||
- [ ] Loading skeletons / proper loading states
|
- [ ] Loading skeletons / proper loading states
|
||||||
- [ ] Notification preferences UI
|
- [ ] Notification preferences UI
|
||||||
|
- [x] Notification channels page (`/notifications`) with full CRUD, wizard, and test button
|
||||||
|
- [x] Apprise-powered notification wizard for Telegram, Discord, Slack, Email, Webhook, and custom URLs
|
||||||
|
- [x] Admin system alert channels section (`/admin` page) with full CRUD and test
|
||||||
- [ ] Subscription management / billing UI
|
- [ ] Subscription management / billing UI
|
||||||
|
|
||||||
### Admin Interface ✅
|
### Admin Interface ✅
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ function buildAppriseUrl(channel: string, fields: Record<string, string>): strin
|
|||||||
}
|
}
|
||||||
case 'email':
|
case 'email':
|
||||||
if (!fields.username || !fields.password || !fields.host) return '';
|
if (!fields.username || !fields.password || !fields.host) return '';
|
||||||
return `mailtos://${encodeURIComponent(fields.username)}:${encodeURIComponent(fields.password)}@${fields.host}${
|
return `mailto://${encodeURIComponent(fields.username)}:${encodeURIComponent(fields.password)}@${fields.host}${
|
||||||
fields.port ? `:${fields.port}` : ''
|
fields.port ? `:${fields.port}` : ''
|
||||||
}`;
|
}`;
|
||||||
case 'webhook':
|
case 'webhook':
|
||||||
|
|||||||
Reference in New Issue
Block a user