V0.38.5 git board rewrite (#238)

Co-authored-by: gobha <jasafpro@gmail.com>
Co-committed-by: gobha <jasafpro@gmail.com>
This commit is contained in:
2026-03-25 22:24:59 +00:00
committed by xcaliber
parent 495bcc94f4
commit c03ece4230
24 changed files with 1354 additions and 413 deletions

View File

@@ -63,6 +63,12 @@ type HTTPModuleConfig struct {
// Ignored when AllowDomains is non-empty.
BlockDomains []string
// AllowPrivateIPs disables the SSRF check that blocks connections to
// private/loopback/link-local addresses. Use for self-hosted deployments
// where extensions need to reach internal services.
// Default: false (private IPs blocked).
AllowPrivateIPs bool
// Timeout overrides the default 10 s request timeout.
// Zero means use default.
Timeout time.Duration
@@ -345,11 +351,13 @@ func (ac *accessControl) checkDomain(host string) error {
return nil
}
// client builds an SSRF-safe http.Client with IP validation on connect.
// client builds an HTTP client with optional SSRF IP validation on connect.
func (ac *accessControl) client() *http.Client {
dialer := &net.Dialer{
Timeout: 5 * time.Second,
Control: ssrfControl,
}
if !ac.cfg.AllowPrivateIPs {
dialer.Control = ssrfControl
}
transport := &http.Transport{