From 2a99df0588e168660d3b528209d8f51689ca92b7 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Fri, 7 Jul 2023 16:17:39 +0200 Subject: [feature] enable + document explicit IP dialer allowing/denying (#1950) * [feature] enable + document explicit IP dialer allowing/denying * lord have mercy * allee jonge * shortcut check ipv6 prefixes * comment * separate httpclient_test, export Sanitizer --- cmd/gotosocial/action/server/server.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cmd') diff --git a/cmd/gotosocial/action/server/server.go b/cmd/gotosocial/action/server/server.go index fa4ec9b82..cdcedd47f 100644 --- a/cmd/gotosocial/action/server/server.go +++ b/cmd/gotosocial/action/server/server.go @@ -105,8 +105,12 @@ var Start action.GTSAction = func(ctx context.Context) error { // Set the state storage driver state.Storage = storage - // Build HTTP client (TODO: add configurables here) - client := httpclient.New(httpclient.Config{}) + // Build HTTP client + client := httpclient.New(httpclient.Config{ + AllowRanges: config.MustParseIPPrefixes(config.GetHTTPClientAllowIPs()), + BlockRanges: config.MustParseIPPrefixes(config.GetHTTPClientBlockIPs()), + Timeout: config.GetHTTPClientTimeout(), + }) // Initialize workers. state.Workers.Start() -- cgit v1.3