aboutsummaryrefslogtreecommitdiff
path: root/Remote/External
Commit message (Collapse)AuthorAge
* Added EXTENSIONS to external special remote protocol.Gravatar Joey Hess2018-02-07
| | | | | | | | | | | | | | | Allows using new special remote messages when git-annex supports them, and avoiding using them when git-annex is too old. The new INFO is one such message. There's also the possibility, currently unused, for the special remote's reply to include some kind of extensions of its own. Merging this is blocked by https://github.com/datalad/datalad/issues/2124 since it seems it will break datalad. I checked all the other special remotes and they will be ok. This commit was supported by the NSF-funded DataLad project.
* Added INFO to external special remote protocol.Gravatar Joey Hess2018-02-06
| | | | | | | It's left up to the special remote to detect when git-annex is new enough to support the message; an old git-annex will blow up. This commit was supported by the NSF-funded DataLad project.
* add ExportTree table to export dbGravatar Joey Hess2017-09-18
| | | | | | | | | | | | New table needed to look up what filenames are used in the currently exported tree, for reasons explained in export.mdwn. Also, added smart constructors for ExportLocation and ExportDirectory to make sure they contain filepaths with the right direction slashes. And some code refactoring. This commit was sponsored by Francois Marier on Patreon.
* split out Types.ExportGravatar Joey Hess2017-09-15
|
* implement removeExportDirectoryGravatar Joey Hess2017-09-15
| | | | | | | | | | | | | | | Not yet called by Command.Export. WebDAV needs this to clean up empty collections. Also, example.sh turned out to not be cleaning up directories when removing content from them, so it made sense for it to use this. Remote.Directory did not need it, and since its cleanup method for empty directories is more efficient than what Command.Export will need to do to find empty directories, it uses Nothing so that extra work can be avoided. This commit was sponsored by Thom May on Patreon.
* External special remote protocol extended to support export.Gravatar Joey Hess2017-09-08
| | | | | | Also updated example.sh to support export. This commit was supported by the NSF-funded DataLad project.
* external: nice error message for keys with spaces in their nameGravatar Joey Hess2017-08-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | External special remotes will refuse to operate on keys with spaces in their names. That has never worked correctly due to the design of the external special remote protocol. Display an error message suggesting migration. Not super happy with this, but it's a pragmatic solution. Better than complicating the external special remote interface and all external special remotes. Note that I only made it use SafeKey in Request, not Response. git-annex does not construct a Response, so that would not add any safety. And presumably, if git-annex avoids feeding any such keys to an external special remote, it will never have a reason to make a Response using such a key. If it did, it would result in a protocol error anyway. There's still a Serializeable instance for Key; it's used by P2P.Protocol. There, the Key is always in the final position, so it's ok if it contains spaces. Note that the protocol documentation has been fixed to say that the File may contain spaces. One way that can happen, even though the Key can't, is when using direct mode, and the work tree filename contains spaces. When sending such a file to the external special remote the worktree filename is used. This commit was sponsored by Thom May on Patreon.
* implementation of peer-to-peer protocolGravatar Joey Hess2016-11-17
| | | | | | | | | | | | | | | | For use with tor hidden services, and perhaps other transports later. Based on Utility.SimpleProtocol, it's a line-based protocol, interspersed with transfers of bytestrings of a specified size. Implementation of the local and remote sides of the protocol is done using a free monad. This lets monadic code be included here, without tying it to any particular way to get bytes peer-to-peer. This adds a dependency on the haskell package "free", although that was probably pulled in transitively from other dependencies already. This commit was sponsored by Jeff Goeke-Smith on Patreon.
* convert TMVars that are never left empty into TVarsGravatar Joey Hess2016-09-30
| | | | | This is probably more efficient, and it avoids mistakenly leaving them empty.
* include external special remote process number in debugGravatar Joey Hess2016-09-30
| | | | Not actual pid, because System.Process does not expose that.
* allow multiple concurrent external special remote processesGravatar Joey Hess2016-09-30
| | | | | | | | | Multiple external special remote processes for the same remote will be started as needed when using -J. This should not beak any existing external special remotes, because running multiple git-annex commands at the same time could already start multiple processes for the same external special remotes.
* move externalConfig into ExternalStateGravatar Joey Hess2016-09-30
| | | | | Groundwork to having multiple processes running at once for an external special remote; each needs its own externalConfig.
* remove unnecessary mvarGravatar Joey Hess2016-09-30
|
* get, move, copy, mirror: Added --failed switch which retries failed copies/movesGravatar Joey Hess2016-08-03
| | | | | | | | | Note that get --from foo --failed will get things that a previous get --from bar tried and failed to get, etc. I considered making --failed only retry transfers from the same remote, but it was easier, and seems more useful, to not have the same remote requirement. Noisy due to some refactoring into Types/
* Pass the various gnupg-options configs to gpg in several cases where they ↵Gravatar Joey Hess2016-05-23
| | | | | | | | | | | | were not before. Removed the instance LensGpgEncParams RemoteConfig because it encouraged code that does not take the RemoteGitConfig into account. RemoteType's setup was changed to take a RemoteGitConfig, although the only place that is able to provide a non-empty one is enableremote, when it's changing an existing remote. This led to several folow-on changes, and got RemoteGitConfig plumbed through.
* use DIRHASH-LOWER for consistencyGravatar Joey Hess2016-05-03
|
* Added DIRHASH_LOWER to external special remote protocol.Gravatar Joey Hess2016-05-03
|
* remove 163 lines of code without changing anything except importsGravatar Joey Hess2016-01-20
|
* Added WHEREIS to external special remote protocol.Gravatar Joey Hess2015-08-13
|
* relay external special remote stderr through progress suppression machinery ↵Gravatar Joey Hess2015-04-04
| | | | | | | | | | (eep!) It sounds worse than it is. ;) Some external special remotes may run commands that display progress on stderr. If git-annex is run with --quiet, this should filter out such displays while letting the errors through.
* Added SETURIPRESENT and SETURIMISSING to external special remote protocolGravatar Joey Hess2015-03-05
| | | | | | | | | Useful for things like ipfs that don't use regular urls. An external special remote can add a regular url to a key, and then git-annex get will download it from the web. But for ipfs, we want to instead tell git-annex that the uri uses OtherDownloader. Before this change, the external special remote protocol lacked a way to do that.
* update my email address and homepage urlGravatar Joey Hess2015-01-21
|
* Expand checkurl to support recommended filename, and multi-file-urlsGravatar Joey Hess2014-12-11
| | | | This commit was sponsored by an anonymous bitcoiner.
* Revert "let url claims optionally include a suggested filename"Gravatar Joey Hess2014-12-11
| | | | | | This reverts commit bc0bf97b20c48e1d1a35d25e2e76a311c102438c. Putting filename in the claim was a bad idea.
* let url claims optionally include a suggested filenameGravatar Joey Hess2014-12-11
|
* Urls can now be claimed by remotes. This will allow creating, for example, a ↵Gravatar Joey Hess2014-12-08
| | | | external special remote that handles magnet: and *.torrent urls.
* implement CLAIMURL for external special remoteGravatar Joey Hess2014-12-08
|
* External special remote protocol now includes commands for setting and ↵Gravatar Joey Hess2014-12-08
| | | | getting the urls associated with a key.
* unify exception handling into Utility.ExceptionGravatar Joey Hess2014-08-07
| | | | | | | | | | | | | | | | | | | | Removed old extensible-exceptions, only needed for very old ghc. Made webdav use Utility.Exception, to work after some changes in DAV's exception handling. Removed Annex.Exception. Mostly this was trivial, but note that tryAnnex is replaced with tryNonAsync and catchAnnex replaced with catchNonAsync. In theory that could be a behavior change, since the former caught all exceptions, and the latter don't catch async exceptions. However, in practice, nothing in the Annex monad uses async exceptions. Grepping for throwTo and killThread only find stuff in the assistant, which does not seem related. Command.Add.undo is changed to accept a SomeException, and things that use it for rollback now catch non-async exceptions, rather than only IOExceptions.
* factored out Utility.SimpleProtocol from the external special remote ↵Gravatar Joey Hess2014-04-05
| | | | implementation
* reorganize numcopies code (no behavior changes)Gravatar Joey Hess2014-01-21
| | | | | | | Move stuff into Logs.NumCopies. Add a NumCopies newtype. Better names for various serialization classes that are specific to one thing or another.
* add GETAVAILABILITY to external special remote protocolGravatar Joey Hess2014-01-13
| | | | | And some reworking of types, and added an annex-availability git config setting.
* external special remote protocol: Added GETGITDIR.Gravatar Joey Hess2014-01-13
|
* add DEBUGGravatar Joey Hess2014-01-07
|
* add remote state logsGravatar Joey Hess2014-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | This allows a remote to store a piece of arbitrary state associated with a key. This is needed to support Tahoe, where the file-cap is calculated from the data stored in it, and used to retrieve a key later. Glacier also would be much improved by using this. GETSTATE and SETSTATE are added to the external special remote protocol. Note that the state is left as-is even when a key is removed from a remote. It's up to the remote to decide when it wants to clear the state. The remote state log, $KEY.log.rmt, is a UUID-based log. However, rather than using the old UUID-based log format, I created a new variant of that format. The new varient is more space efficient (since it lacks the "timestamp=" hack, and easier to parse (and the parser doesn't mess with whitespace in the value), and avoids compatability cruft in the old one. This seemed worth cleaning up for these new files, since there could be a lot of them, while before UUID-based logs were only used for a few log files at the top of the git-annex branch. The transition code has also been updated to handle these new UUID-based logs. This commit was sponsored by Daniel Hofer.
* added GETWANTED, SETWANTED for Tobias's flickr remoteGravatar Joey Hess2014-01-01
| | | | | | | | | | | | | | | This was unexpectedly difficult because of a depdenency cycle. To parse a preferred content expression involves several things that need to operate on the list of remotes. Which needs Remote.External. The only way to avoid this cycle (I tried breaking it at several points) was to skip parsing the expression in SETWANTED. That's sorta ok, because git-annex already has to deal with unparsable preferred content expressions being stored, in order to handle eg, upgrades. But I'm still not very happy that I cannot check it. I feel this is a strong indication that I need to beware of further bloating the special remote protocol interface.
* external special remote protocol: Added GETUUID.Gravatar Joey Hess2013-12-31
|
* implement PREPARE-FAILURE for TobiasGravatar Joey Hess2013-12-29
|
* add credential storage support for external special remotes & update exampleGravatar Joey Hess2013-12-27
|
* defer SETSTATE and GETSTATE for nowGravatar Joey Hess2013-12-27
| | | | | TAHOE-LAFS may use these eventually, but that's TBD and none of git-annex's own special remotes need that, except for the web special remote's urls.
* implement GETCONFIG and SETCONFIGGravatar Joey Hess2013-12-27
| | | | | | | | | | | Changed protocol spec to make SETCONFIG only store it persistently when run during INITREMOTE. I see no reason to support storing it persistently at other times, and doing so would unnecessarily complicate the code. Also, letting that be done would probably result in use for storing data that doesn't really belong there, and special remote authors who don't understand how the union merging works would probably be surprised the results.
* don't send PREPARE before INITREMOTEGravatar Joey Hess2013-12-27
| | | | | | | | That complicated special remote programs, because they had to avoid making PREPARE fail if some configuration is missing, because the remote might not be initialized yet. Instead, complicate git-annex slightly by only sending PREPARE immediately before some other request other than INITREMOTE (or PREPARE of course).
* make some requests optional, simplify and future-proof protocol moreGravatar Joey Hess2013-12-27
|
* external special remotes mostly implemented (untested)Gravatar Joey Hess2013-12-26
This has not been tested at all. It compiles! The only known missing things are support for encryption, and for get/set of special remote configuration, and of key state. (The latter needs separate work to add a new per-key log file to store that state.) Only thing I don't much like is that initremote needs to be passed both type=external and externaltype=foo. It would be better to have just type=foo Most of this is quite straightforward code, that largely wrote itself given the types. The only tricky parts were: * Need to lock the remote when using it to eg make a request, because in theory git-annex could have multiple threads that each try to use a remote at the same time. I don't think that git-annex ever does that currently, but better safe than sorry. * Rather than starting up every external special remote program when git-annex starts, they are started only on demand, when first used. This will avoid slowdown, especially when running fast git-annex query commands. Once started, they keep running until git-annex stops, currently, which may not be ideal, but it's hard to know a better time to stop them. * Bit of a chicken and egg problem with caching the cost of the remote, because setting annex-cost in the git config needs the remote to already be set up. Managed to finesse that. This commit was sponsored by Lukas Anzinger.