feat: remplacer Gotify par ntfy — push notifications multi-utilisateur avec isolation par topic
- Nouveau NtfyService: topic isolé par user (heimdall_{userId})
- Configuration globale Ntfy:BaseUrl + Ntfy:Token (plus de token par user)
- Renommage UserNotificationConfig: Gotify* → Ntfy*
- Migration des colonnes DB: gotify_enabled/url/token → ntfy_enabled/url
- Ajout service ntfy dans docker-compose (binwiederhier/ntfy)
- Mise à jour .env.example avec NTFY__BASE_URL et NTFY__TOKEN
- Suppression GotifyService et IGotifyService
This commit is contained in:
1 parent
1080f26591
commit
f800103239
25 files changed
+159
-117
No files matched your search
@@ -16,7 +16,7 @@ public class NotificationService : INotificationService
|
||||
private readonly IMapper _mapper;
|
||||
private readonly INotificationBroadcastService _broadcast;
|
||||
private readonly IEmailService _emailService;
|
||||
private readonly IGotifyService _gotifyService;
|
||||
private readonly INtfyService _ntfyService;
|
||||
private readonly INotificationRateLimiter _rateLimiter;
|
||||
private readonly ILogger<NotificationService> _logger;
|
||||
|
||||
@@ -25,7 +25,7 @@ public class NotificationService : INotificationService
|
||||
IMapper mapper,
|
||||
INotificationBroadcastService broadcast,
|
||||
IEmailService emailService,
|
||||
IGotifyService gotifyService,
|
||||
INtfyService ntfyService,
|
||||
INotificationRateLimiter rateLimiter,
|
||||
ILogger<NotificationService> logger)
|
||||
{
|
||||
@@ -33,7 +33,7 @@ public class NotificationService : INotificationService
|
||||
_mapper = mapper;
|
||||
_broadcast = broadcast;
|
||||
_emailService = emailService;
|
||||
_gotifyService = gotifyService;
|
||||
_ntfyService = ntfyService;
|
||||
_rateLimiter = rateLimiter;
|
||||
_logger = logger;
|
||||
}
|
||||
@@ -89,13 +89,11 @@ public class NotificationService : INotificationService
|
||||
ct);
|
||||
}
|
||||
|
||||
if (config.GotifyEnabled
|
||||
&& !string.IsNullOrEmpty(config.GotifyUrl)
|
||||
&& !string.IsNullOrEmpty(config.GotifyToken))
|
||||
if (config.NtfyEnabled)
|
||||
{
|
||||
await _gotifyService.SendNotificationAsync(
|
||||
config.GotifyUrl,
|
||||
config.GotifyToken,
|
||||
var topic = $"heimdall_{userId}";
|
||||
await _ntfyService.SendNotificationAsync(
|
||||
topic,
|
||||
notification.Title,
|
||||
notification.Message,
|
||||
ct: ct);
|
||||
|
||||
Reference in new issue
Block a user