From 724ceeb1a9ef471abdf8d5d2678ab7842cd73b6c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 22 Aug 2023 10:25:53 -0400 Subject: [PATCH] avoid unncessary use of curl when conduit will do Avoid using curl when annex.security.allowed-ip-addresses is set but neither annex.web-options nor annex.security.allowed-url-schemes is set to a value that needs curl. Bug introduced in 840bd50390437a91c39fb7da1ba8d5bf07fed457 Sponsored-By: Brock Spratlen on Patreon --- Annex/Url.hs | 2 +- CHANGELOG | 3 +++ doc/git-annex.mdwn | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Annex/Url.hs b/Annex/Url.hs index 61c52c8a0f..2f12a10768 100644 --- a/Annex/Url.hs +++ b/Annex/Url.hs @@ -83,7 +83,7 @@ getUrlOptions = Annex.getState Annex.urloptions >>= \case ["all"] -> do curlopts <- map Param . annexWebOptions <$> Annex.getGitConfig allowedurlschemes <- annexAllowedUrlSchemes <$> Annex.getGitConfig - let urldownloader = if null curlopts && not (any (`S.member` U.conduitUrlSchemes) allowedurlschemes) + let urldownloader = if null curlopts && not (any (`S.notMember` U.conduitUrlSchemes) allowedurlschemes) then U.DownloadWithConduit $ U.DownloadWithCurlRestricted mempty else U.DownloadWithCurl curlopts diff --git a/CHANGELOG b/CHANGELOG index edd05ef07d..e3c989f141 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -15,6 +15,9 @@ git-annex (10.20230803) UNRELEASED; urgency=medium * Added AVAILABILITY UNAVAILABLE and the UNAVAILABLERESPONSE extension to the external special remote protocol. * The remote.name.annex-availability git config is no longer used. + * Avoid using curl when annex.security.allowed-ip-addresses is set + but neither annex.web-options nor annex.security.allowed-url-schemes + is set to a value that needs curl. -- Joey Hess Mon, 07 Aug 2023 13:04:13 -0400 diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn index b51e6dc881..6683cd79dd 100644 --- a/doc/git-annex.mdwn +++ b/doc/git-annex.mdwn @@ -1822,7 +1822,8 @@ Remotes are configured using these settings in `.git/config`. and transferred on to other remotes, exposing its content. Any url schemes supported by curl can be listed here, but you will - also need to configure annex.allowed-ip-addresses to allow using curl. + also need to configure annex.security.allowed-ip-addresses to allow + using curl. Some special remotes support their own domain-specific URL schemes; those are not affected by this configuration setting.