feat(settings): topic ntfy par site, SMTP/ntfy/S3 globaux, DSN GlitchTip fixe + toggle (Fixes #105 #106 #107 #108)
#105 — Topic ntfy cible par site : - Site.NtfyTopic (migration AddSiteNtfyTopic), UI création/édition SitesPage - NotificationService.ResolveNtfyTopicAsync : topic du site sinon heimdall_{userId} #106 — Paramètres SMTP/ntfy/S3 GLOBAUX : - Seed + sections UI : agentScoped=false pour ntfy.*/email.*/storage.*/sentry.* - Migration douce au démarrage : UPDATE des clés existantes en base #107 — GlitchTip : DSN fixes (central projet 6, agent projet 7) dans appsettings, - plus de champ DSN éditable en UI → switch sentry.enabled (nécessite redémarrage) - Init Sentry déplacé après AddInfrastructure, lit sentry.enabled en base (fallback true) #108 — Composants typés : MudNumericField borné (port SMTP, rétention, heartbeat), - switch pour booléens, select pour log.level — pas de saisie libre
This commit is contained in:
1 parent
85bfdac7ee
commit
dc8a24918d
25 files changed
+2485
-153
No files matched your search
@@ -111,7 +111,7 @@ public class NotificationService : INotificationService
|
||||
|
||||
if (config.NtfyEnabled)
|
||||
{
|
||||
var topic = $"heimdall_{userId}";
|
||||
var topic = await ResolveNtfyTopicAsync(notification, userId, ct);
|
||||
await _ntfyService.SendNotificationAsync(
|
||||
topic,
|
||||
notification.Title,
|
||||
@@ -125,6 +125,26 @@ public class NotificationService : INotificationService
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Résout le topic ntfy cible d'une notification (ticket #105) :
|
||||
/// topic du site si défini, sinon topic personnel <c>heimdall_{userId}</c>.
|
||||
/// </summary>
|
||||
private async Task<string> ResolveNtfyTopicAsync(Notification notification, Guid userId, CancellationToken ct)
|
||||
{
|
||||
if (notification.SiteId is { } siteId)
|
||||
{
|
||||
var siteTopic = await _context.Sites
|
||||
.AsNoTracking()
|
||||
.Where(s => s.Id == siteId)
|
||||
.Select(s => s.NtfyTopic)
|
||||
.FirstOrDefaultAsync(ct);
|
||||
if (!string.IsNullOrWhiteSpace(siteTopic))
|
||||
return siteTopic;
|
||||
}
|
||||
|
||||
return $"heimdall_{userId}";
|
||||
}
|
||||
|
||||
public async Task<int> GetUnreadCountAsync(Guid userId, CancellationToken ct = default)
|
||||
{
|
||||
return await _context.Notifications
|
||||
|
||||
Reference in new issue
Block a user