From 8ae5ecba4124071bf2791f1ec512129f8a94e507 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Thu, 28 May 2026 19:45:14 +0200 Subject: [PATCH] feat: policy-controlled push relay URL with optional user lock --- app/(main)/admin/_tabs/policy.tsx | 40 +++++++++++++++++++ components/settings/notification-settings.tsx | 30 +++++++++++--- lib/admin/types.ts | 6 +++ locales/cs/common.json | 2 + locales/en/common.json | 2 + locales/nl/common.json | 2 + 6 files changed, 77 insertions(+), 5 deletions(-) diff --git a/app/(main)/admin/_tabs/policy.tsx b/app/(main)/admin/_tabs/policy.tsx index 78755819..f6e12307 100644 --- a/app/(main)/admin/_tabs/policy.tsx +++ b/app/(main)/admin/_tabs/policy.tsx @@ -74,6 +74,18 @@ export function PolicyTab() { setMessage(null); } + function setPushRelayUrl(value: string) { + setPolicy(prev => ({ ...prev, pushRelayUrl: value })); + setDirty(true); + setMessage(null); + } + + function togglePushRelayLocked() { + setPolicy(prev => ({ ...prev, pushRelayUrlLocked: !prev.pushRelayUrlLocked })); + setDirty(true); + setMessage(null); + } + function toggleLocked(settingKey: string) { setPolicy(prev => { const existing = prev.restrictions[settingKey] || {}; @@ -183,6 +195,34 @@ export function PolicyTab() { +
Override the Web Push relay URL shown in user notification settings. Leave empty to use the built-in default.
+{t('push.relay_desc')}
++ {pushRelayLocked ? t('push.relay_locked_desc') : t('push.relay_desc')} +
setRelayUrl(e.target.value)} placeholder={t('push.relay_placeholder')} - disabled={busy || pushStatus.kind === 'unsupported'} + disabled={busy || pushStatus.kind === 'unsupported' || pushRelayLocked} + readOnly={pushRelayLocked} className="w-full rounded border bg-background px-3 py-2 text-sm disabled:opacity-50" />