aboutsummaryrefslogtreecommitdiff
path: root/Remote/External.hs
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.
* external crash fixesGravatar Joey Hess2017-09-28
| | | | | | | | | | | | When the external special remote program crashed, a newline could be output, which messed up the expected output for --batch mode. Avoid checking EXPORTSUPPORTED for special remotes that are not configured to use exports. The datalad special remote apparently is/was buggy and crashed on EXPORTSUPPORTED. Anyway, there's no need to send it when the configuration doesn't need it. This commit was supported by the NSF-funded DataLad project.
* split out Types.ExportGravatar Joey Hess2017-09-15
|
* add missing caseGravatar 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.
* export: cache connections for S3 and webdavGravatar Joey Hess2017-09-12
|
* 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.
* prevent exporttree=yes on remotes that don't support exportsGravatar Joey Hess2017-09-07
| | | | | | | | | Don't allow "exporttree=yes" to be set when the special remote does not support exports. That would be confusing since the user would set up a special remote for exports, but `git annex export` to it would later fail. This commit was supported by the NSF-funded DataLad project.
* refactor ExportActionsGravatar Joey Hess2017-09-01
| | | | | | | | This will allow disabling exports for remotes that are not configured to allow them. Also, exportSupported will be useful for the external special remote to probe. This commit was supported by the NSF-funded DataLad project
* add API for exportingGravatar Joey Hess2017-08-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented so far for the directory special remote. Several remotes don't make sense to export to. Regular Git remotes, obviously, do not. Bup remotes almost certianly do not, since bup would need to be used to extract the export; same store for Ddar. Web and Bittorrent are download-only. GCrypt is always encrypted so exporting to it would be pointless. There's probably no point complicating the Hook remotes with exporting at this point. External, S3, Glacier, WebDAV, Rsync, and possibly Tahoe should be modified to support export. Thought about trying to reuse the storeKey/retrieveKeyFile/removeKey interface, rather than adding a new interface. But, it seemed better to keep it separate, to avoid a complicated interface that sometimes encrypts/chunks key/value storage and sometimes users non-key/value storage. Any common parts can be factored out. Note that storeExport is not atomic. doc/design/exporting_trees_to_special_remotes.mdwn has some things in the "resuming exports" section that bear on this decision. Basically, I don't think, at this time, that an atomic storeExport would help with resuming, because exports are not key/value storage, and we can't be sure that a partially uploaded file is the same content we're currently trying to export. Also, note that ExportLocation will always use unix path separators. This is important, because users may export from a mix of windows and unix, and it avoids complicating the API with path conversions, and ensures that in such a mix, they always use the same locations for exports. This commit was sponsored by Bruno BEAUFILS on Patreon.
* 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.
* Windows: Improve handling of shebang in external special remote program, ↵Gravatar Joey Hess2017-03-08
| | | | | | | | | | | | | | | | | | | searching for the program in the PATH. findShellCommand needs a full path to a file in order to check it for a shebang on Windows. It was being run with only the base name of the external special remote program, which would only work when it was in the current directory. This is why users in https://github.com/DanielDent/git-annex-remote-rclone/pull/10 and elsewhere were complaining that the previous improvements to git-annex didn't make git-remote-rclone work on Windows. Also, reworked checkearlytermination, which while it worked, seemed to rely on a race condition. And, improved its error messages. This commit was sponsored by Shane-o on Patreon.
* add SetupStage parameter to RemoteType.setupGravatar Joey Hess2017-02-07
| | | | | | | | | | | | | | | | | Most remotes have an idempotent setup that can be reused for enableremote, but in a few cases, it needs to tell which, and whether a UUID was provided to setup was used. This is groundwork for making initremote be able to provide a UUID. It should not change any behavior. Note that it would be nice to make the UUID always be provided to setup, and make setup not need to generate and return a UUID. What prevented this simplification is Remote.Git.gitSetup, which needs to reuse the UUID of the git remote when setting it up, and so has to return that UUID. This commit was sponsored by Thom May on Patreon.
* Always use filesystem encoding for all file and handle reads and writes.Gravatar Joey Hess2016-12-24
| | | | | This is a big scary change. I have convinced myself it should be safe. I hope!
* Avoid backtraces on expected failures when built with ghc 8; only use ↵Gravatar Joey Hess2016-11-15
| | | | | | | | | | | | | backtraces for unexpected errors. ghc 8 added backtraces on uncaught errors. This is great, but git-annex was using error in many places for a error message targeted at the user, in some known problem case. A backtrace only confuses such a message, so omit it. Notably, commands like git annex drop that failed due to eg, numcopies, used to use error, so had a backtrace. This commit was sponsored by Ethan Aubin.
* 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
|
* Windows: Handle shebang in external special remote program.Gravatar Joey Hess2016-09-05
|
* 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/
* testremote: Fix crash when testing a freshly made external special remote.Gravatar Joey Hess2016-07-05
| | | | | | Ignore exceptions when getting the cost and availability for the remote, and return sane defaults. These defaults are not cached, so if a special remote program has a transient problem, it will re-query it later.
* plumb RemoteGitConfig through to decryptCipherGravatar Joey Hess2016-05-23
|
* plumb RemoteGitConfig through to setRemoteCredPairGravatar Joey Hess2016-05-23
|
* 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.
* Propigate GIT_DIR and GIT_WORK_TREE environment to external special remotes.Gravatar Joey Hess2016-05-06
| | | | | | | | | Since git-annex unsets these when started, they have to be explicitly propigated. Also, this makes --git-dir and --work-tree settings be reflected in the environment. The need for this came up in https://github.com/DanielDent/git-annex-remote-rclone/issues/3
* 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
|
* improve error message when special remote program cannot be runGravatar Joey Hess2015-11-18
|
* Display progress meter in -J mode when downloading from the web.Gravatar Joey Hess2015-11-16
| | | | | Including in addurl, and get --from web, but also in S3 and External special remotes when a web url is known for content in those remotes.
* add removeKey action to RemoteGravatar Joey Hess2015-10-08
| | | | | Not implemented for any remotes yet; probably the git remote is the only one that will ever implement it.
* External special remotes can now be built that can be used in readonly mode, ↵Gravatar Joey Hess2015-08-17
| | | | | | | | | | | | | | | | | where git-annex downloads content from the remote using regular http. Note that, if an url is added to the web log for such a remote, it's not distinguishable from another url that might be added for the web remote. (Because the web log doesn't distinguish which remote owns a plain url. Urls with a downloader set are distinguishable, but we're not using them here.) This seems ok-ish.. In such a case, both remotes will try to use both urls, and both remotes should be able to. The only issue I see is that dropping a file from the web remote will remove both urls in this case. This is not often done, and could even be considered a feature, I suppose.
* Added WHEREIS to external special remote protocol.Gravatar Joey Hess2015-08-13
|
* Simplify setup process for a ssh remote.Gravatar Joey Hess2015-08-05
| | | | | | | | | | | | | | | | | | | | | | Now it suffices to run git remote add, followed by git-annex sync. Now the remote is automatically initialized for use by git-annex, where before the git-annex branch had to manually be pushed before using git-annex sync. Note that this involved changes to git-annex-shell, so if the remote is using an old version, the manual push is still needed. Implementation required git-annex-shell be changed, so configlist can autoinit a repository even when no git-annex branch has been pushed yet. Unfortunate because we'll have to wait for it to get deployed to servers before being able to rely on this change in the documentation. Did consider making git-annex sync push the git-annex branch to repos that didn't have a uuid, but this seemed difficult to do without complicating it in messy ways. It would be cleaner to split a command out from configlist to handle the initialization. But this is difficult without sacrificing backwards compatability, for users of old git-annex versions which would not use the new command.
* add filename to progress bar, and display ok/failed at endGravatar Joey Hess2015-04-14
| | | | This needed plumbing an AssociatedFile through retrieveKeyFileCheap.
* 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.
* Fix GETURLS in external special remote protocol to strip downloader prefix ↵Gravatar Joey Hess2015-03-27
| | | | | | | from logged url info before checking for the specified prefix. This doesn't change what GETURLS returns, but only whether it matches any prefix that the external special remote asked for.
* 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.
* import Data.Default in CommonGravatar Joey Hess2015-01-28
|
* groundwork for parameterizing hash depthGravatar Joey Hess2015-01-28
|
* update my email address and homepage urlGravatar Joey Hess2015-01-21
|
* reformatGravatar Joey Hess2014-12-16
|
* sanitize filepaths provided by checkUrlGravatar Joey Hess2014-12-11
|
* simplify external special remote implementationGravatar Joey Hess2014-12-11
|
* use subdir for addurl when it creates multiple filesGravatar Joey Hess2014-12-11
| | | | The --file parameter specifies the subdir in this mode.
* 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
|