mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-21 14:36:31 +00:00
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.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user