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 840bd50390

Sponsored-By: Brock Spratlen on Patreon
This commit is contained in:
Joey Hess 2023-08-22 10:25:53 -04:00
parent 88b0bb5793
commit 724ceeb1a9
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 6 additions and 2 deletions

View file

@ -83,7 +83,7 @@ getUrlOptions = Annex.getState Annex.urloptions >>= \case
["all"] -> do ["all"] -> do
curlopts <- map Param . annexWebOptions <$> Annex.getGitConfig curlopts <- map Param . annexWebOptions <$> Annex.getGitConfig
allowedurlschemes <- annexAllowedUrlSchemes <$> 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 $ then U.DownloadWithConduit $
U.DownloadWithCurlRestricted mempty U.DownloadWithCurlRestricted mempty
else U.DownloadWithCurl curlopts else U.DownloadWithCurl curlopts

View file

@ -15,6 +15,9 @@ git-annex (10.20230803) UNRELEASED; urgency=medium
* Added AVAILABILITY UNAVAILABLE and the UNAVAILABLERESPONSE extension * Added AVAILABILITY UNAVAILABLE and the UNAVAILABLERESPONSE extension
to the external special remote protocol. to the external special remote protocol.
* The remote.name.annex-availability git config is no longer used. * 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 <id@joeyh.name> Mon, 07 Aug 2023 13:04:13 -0400 -- Joey Hess <id@joeyh.name> Mon, 07 Aug 2023 13:04:13 -0400

View file

@ -1822,7 +1822,8 @@ Remotes are configured using these settings in `.git/config`.
and transferred on to other remotes, exposing its content. and transferred on to other remotes, exposing its content.
Any url schemes supported by curl can be listed here, but you will 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 Some special remotes support their own domain-specific URL
schemes; those are not affected by this configuration setting. schemes; those are not affected by this configuration setting.