fix(browser): add IP validation, fix upgrade handler for non-loopback bind

- Zod schema: validate relayBindHost with ipv4/ipv6 instead of bare string
- Upgrade handler: allow non-loopback connections when bindHost is explicitly
  non-loopback (e.g. 0.0.0.0 for WSL2), keeping loopback-only default
- Test: verify actual bind address via relay.bindHost instead of just checking
  reachability on 127.0.0.1 which passes regardless
- Expose bindHost on ChromeExtensionRelayServer type for inspection

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt Van Horn
2026-03-07 18:22:50 -08:00
committed by Peter Steinberger
parent 436ae8a07c
commit e883d0b556
3 changed files with 10 additions and 3 deletions

View File

@@ -372,7 +372,7 @@ export const OpenClawSchema = z
)
.optional(),
extraArgs: z.array(z.string()).optional(),
relayBindHost: z.string().optional(),
relayBindHost: z.union([z.string().ipv4(), z.string().ipv6()]).optional(),
})
.strict()
.optional(),