httpalso: Support being used with special remotes that do not have encryption= in...
authorJoey Hess <joeyh@joeyh.name>
Tue, 29 Sep 2020 17:56:27 +0000 (13:56 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 29 Sep 2020 17:56:27 +0000 (13:56 -0400)
CHANGELOG
Remote/HttpAlso.hs
doc/bugs/httpalso_mode_expects_encryption.mdwn
doc/bugs/httpalso_mode_expects_encryption/comment_4_50edcdec6ba08fc739f5c2f4ba826191._comment [new file with mode: 0644]

index 3f69e857bb3a3c3c4b3f8c5951b6ddbd28338386..6dbe6c6d5a318dce8f74e025a1c69fd47a85c7c8 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -32,6 +32,8 @@ git-annex (8.20200909) UNRELEASED; urgency=medium
     (Other special remotes may support this later as well.)
   * addurl: Avoid a redundant git ignores check for speed.
   * upgrade: Avoid an upgrade failure of a bare repo in unusual circumstances.
+  * httpalso: Support being used with special remotes that do not have
+    encryption= in their config.
 
  -- Joey Hess <id@joeyh.name>  Mon, 14 Sep 2020 18:34:37 -0400
 
index 4e71e1ad8541d71940c5e9891bd20abd941b43c4..9411f3a842e82ddeed7ec4c0ab8232569f7d717d 100644 (file)
@@ -105,7 +105,9 @@ httpAlsoSetup _ (Just u) _ c gc = do
        _url <- maybe (giveup "Specify url=")
                (return . fromProposedAccepted)
                (M.lookup urlField c)
-       (c', _encsetup) <- encryptionSetup c gc
+       c' <- if isJust (M.lookup encryptionField c)
+               then fst <$> encryptionSetup c gc
+               else pure c
        gitConfigSpecialRemote u c' [("httpalso", "true")]
        return (c', u)
 
index fa2391d94c115b9c4392cf9444ccbccf2df2a4f8..25557c434deff62fe185bd1aed867521f8e429e4 100644 (file)
@@ -40,3 +40,5 @@ git annex 8.20200908 on current Debian sid (as packaged)
 My first git-annex repository dates back 2010-12-21 ... so: yes.
 
 The introduction of httpalso simplifies the setup in the [annex-to-web](https://gitlab.com/chrysn/annex-to-web)  server, which on one hand consumes them in order to pass out redirects, and on the other hand .
+
+> [[fixed|done]] to the extent this was a bug at all. --[[Joey]]
diff --git a/doc/bugs/httpalso_mode_expects_encryption/comment_4_50edcdec6ba08fc739f5c2f4ba826191._comment b/doc/bugs/httpalso_mode_expects_encryption/comment_4_50edcdec6ba08fc739f5c2f4ba826191._comment
new file mode 100644 (file)
index 0000000..80c1407
--- /dev/null
@@ -0,0 +1,16 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 4"""
+ date="2020-09-29T17:52:03Z"
+ content="""
+Made it check if the inherited config has encryption and skip setting it
+up. So if there is a special remote that does not support encryption
+config, it won't fail this way.
+
+Come to think, at least tahoe does not support encryption config.
+Although it seems very unlikely it would be useful combined with tahoe.
+
+Of course, it still won't, and cannot possibly work when combined with a
+http export of a git working tree. But then the docs are clear it won't
+work with everything.
+"""]]