current directory, rather than the path from the top of the repository.
* importfeed: Avoid using youtube-dl when a feed does not contain an
enclosure, but only a link to an url which youtube-dl does not support.
+ * initremote: Prevent enabling encryption with exporttree=yes/importtree=yes.
-- Joey Hess <id@joeyh.name> Mon, 30 Nov 2020 12:55:49 -0400
cipherKey,
extractCipher,
isEncrypted,
+ encryptionIsEnabled,
describeEncryption,
encryptionField,
highRandomQualityField
isEncrypted :: ParsedRemoteConfig -> Bool
isEncrypted = isJust . extractCipher
+-- Check if encryption is enabled. This can be done before encryption
+-- is fully set up yet, so the cipher might not be present yet.
+encryptionIsEnabled :: ParsedRemoteConfig -> Bool
+encryptionIsEnabled c = case getRemoteConfigValue encryptionField c of
+ Nothing -> False
+ Just NoneEncryption -> False
+ Just _ -> True
+
describeEncryption :: ParsedRemoteConfig -> String
describeEncryption c = case extractCipher c of
Nothing -> "none"
import Types.Key
import Types.ProposedAccepted
import Backend
-import Remote.Helper.Encryptable (isEncrypted)
+import Remote.Helper.Encryptable (encryptionIsEnabled)
import qualified Database.Export as Export
import qualified Database.ContentIdentifier as ContentIdentifier
import Annex.Export
ifM (supported rt pc gc)
( case st of
Init
- | configured pc && isEncrypted pc ->
+ | configured pc && encryptionIsEnabled pc ->
giveup $ "cannot enable both encryption and " ++ fromProposedAccepted configfield
| otherwise -> cont
Enable oldc -> do
There is code in adjustExportImportRemoteType, and I remember it used to
work. --[[Joey]]
+
+> [[fixed|done]] --[[Joey]]