Files
Rbm.FamStack/tools/generate-vapid-keys.cs
JannisandCopilot 18a0a06e06 feat: add task API with approval, points, live updates and web push
Minimal API slice /api/tasks (idempotent create with client ids, versioned updates, state-based status changes, checklist, parent approval/rejection, points overview and audited adjustments, recurring next instance), per-user SignalR broadcasts that respect private tasks, /api/push subscription endpoints, a dependency-free Web Push sender (RFC 8291/8292) and a minimal reminder service. VAPID keys via Aspire parameters and deploy/.env (tools/generate-vapid-keys.cs); integration test login limit raised.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 21:58:10 +02:00

19 lines
1.1 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Erzeugt ein VAPID-Schlüsselpaar für Web-Push-Erinnerungen (ADR-0014).
// Aufruf aus dem Repository-Wurzelverzeichnis: dotnet run tools/generate-vapid-keys.cs
// Die Ausgabe enthält ein Geheimnis – nicht einchecken! Werte als Aspire-Parameter (User Secrets) bzw. in deploy/.env eintragen.
using System.Security.Cryptography;
using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256);
var parameters = key.ExportParameters(includePrivateParameters: true);
byte[] publicKey = [0x04, .. parameters.Q.X!, .. parameters.Q.Y!];
Console.WriteLine("# Docker (deploy/.env):");
Console.WriteLine($"VAPID_PUBLIC_KEY={Base64Url(publicKey)}");
Console.WriteLine($"VAPID_PRIVATE_KEY={Base64Url(parameters.D!)}");
Console.WriteLine();
Console.WriteLine("# Lokal mit Aspire (im Ordner src/FamilyPlanner.AppHost):");
Console.WriteLine($"dotnet user-secrets set \"Parameters:vapid-public-key\" \"{Base64Url(publicKey)}\"");
Console.WriteLine($"dotnet user-secrets set \"Parameters:vapid-private-key\" \"{Base64Url(parameters.D!)}\"");
static string Base64Url(byte[] data) => Convert.ToBase64String(data).TrimEnd('=').Replace('+', '-').Replace('/', '_');