From 6e8aa3ab26e967e3cab9ca6327111dc7d9cbd2b5 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sun, 13 Sep 2026 21:19:42 +0200 Subject: [PATCH] fix(dawarich): say why the address could not be reached The server works out the reason and names it: a rejected certificate, a name that does not resolve, a timeout, or the SSRF guard refusing a private address along with the environment variable that would permit it. All of that reaches the client as `errorDetail`, and the panel dropped it, leaving one sentence that reads the same whether the host is off or TREK refused on purpose. A tester could only report that it did not work. The panel shows the reason under the message now; the toast stays one line, and the vague codes stay vague so an English sentence from Dawarich does not land on a German install. --- client/src/hooks/useDawarichConnection.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/src/hooks/useDawarichConnection.ts b/client/src/hooks/useDawarichConnection.ts index 4a79f12d6..a965ca473 100644 --- a/client/src/hooks/useDawarichConnection.ts +++ b/client/src/hooks/useDawarichConnection.ts @@ -158,7 +158,14 @@ export function useDawarichConnection(): DawarichConnectionState { toast.success(t('dawarich.test.success', { count: result.visitCount ?? 0 })) } else { const message = translateError(result.error ?? null) ?? t('dawarich.test.failed') - setProbeMessage(message) + // The reason underneath, where the server managed to name one. The codes + // above are deliberately vague so an English sentence from Dawarich does + // not land on a German install, but "TREK could not reach that address" + // alone leaves a self-hoster with nothing to act on: it reads the same + // whether the host is down, the certificate was rejected, or TREK refused + // a private address on purpose and would need ALLOW_INTERNAL_NETWORK to + // permit it. The panel gets both; the toast stays one line. + setProbeMessage(result.errorDetail ? `${message} (${result.errorDetail})` : message) toast.error(message) } } catch (err) {