aboutsummaryrefslogtreecommitdiff
path: root/Command/AddUrl.hs
Commit message (Collapse)AuthorAge
* importfeed: Fix a failure when downloading with youtube-dl and the ↵Gravatar Joey Hess2018-02-22
| | | | | | | | | | | | | | destination subdirectory does not exist yet. Noticed while running this (which a user posted in a comment they deleted for some reason): git-annex importfeed https://vimeo.com/logiingimars/videos/rss The filename that youtube-dl suggests included a subdirectory, which didn't exist, so renaming to it failed. This commit was sponsored by mo on Patreon.
* add --json-error-messages (not yet implemented)Gravatar Joey Hess2018-02-19
| | | | | | | | | | Added --json-error-messages option, which includes error messages in the json output, rather than outputting them to stderr. The actual rediretion of errors is not implemented yet, this is only the docs and option plumbing. This commit was supported by the NSF-funded DataLad project.
* finally really add back custom-setup stanzaGravatar Joey Hess2017-12-31
| | | | | | | | | | | | Fourth or fifth try at this and finally found a way to make it work. Absurd amount of busy-work forced on me by change in cabal's behavior. Split up Utility modules that need posix stuff out of ones used by Setup. Various other hacks around inability for Setup to use anything that ifdefs a use of unix. Probably lost a full day of my life to this. This is how build systems make their users hate them. Just saying.
* fix buildGravatar Joey Hess2017-12-31
|
* repeated addurl behavior reversion fixGravatar Joey Hess2017-12-31
| | | | | | | | addurl: When the file youtube-dl will download is already an annexed file, don't download it again and fail to overwrite it, instead just do nothing, like it used to when quvi was used. This commit was sponsored by Anthony DeRobertis on Patreon.
* fix recorded url when using --file with external special remoteGravatar Joey Hess2017-12-11
| | | | | | | The youtube changes accidentially caused the OtherDownloader url to not get used here, which broke datalad's test suite luckily. This commit was supported by the NSF-funded DataLad project.
* more lambda-case conversionGravatar Joey Hess2017-12-05
|
* make --raw avoid ever running youtube-dlGravatar Joey Hess2017-11-30
| | | | | | | added DownloadOptions type to avoid needing two different Bool params for some functions. This commit was sponsored by Thom May on Patreon.
* display filename when file already has urlGravatar Joey Hess2017-11-30
| | | | Otherwise it's confusing what happened..
* improve error messageGravatar Joey Hess2017-11-30
| | | | | checkCanAdd can be called on annexed files too, when youtube-dl is in use.
* check youtube-dl for --fast and --relaxed when adding new fileGravatar Joey Hess2017-11-30
| | | | | | The filename comes from youtube-dl also. This commit was sponsored by Denis Dzyubenko on Patreon.
* rethought --relaxed changeGravatar Joey Hess2017-11-30
| | | | | | | | | Better to make it not be surprising and slow, than surprising and fast. --raw can be used when it needs to be really fast. Implemented adding a youtube-dl supported url to an existing file. This commit was sponsored by andrea rota.
* honor --file when downloading with youtube-dlGravatar Joey Hess2017-11-30
| | | | This used to be done with quvi, and got broken in the transition.
* convert importfeed to youtube-dlGravatar Joey Hess2017-11-29
| | | | | | | | | | | | | | | | | | | | | | | | Fully working, including --fast/--relaxed. Note that, while git-annex addurl --relaxed is not going to check youtube-dl, I kept git annex importfeed --relaxed checking it. Thinking is that, let's not break people's importfeed cron jobs, and importfeed does not typically have to check a large number of new items, so it's ok if it's a little bit slower when used with youtube playlist feeds. importfeed's behavior is also improved (?) when a feed has links in it to non-media files. Before, those were skipped. Now, the content of the link is downloaded. This had to be done, because trying to use youtube-dl is slow, and if those were skipped, it would have to check every time importfeed was run. While this behavior change may not be desirable for some feeds, that intersperse links to web pages with enclosures, it will be desirable for other feeds, that have non-enclosure directy links to media files. Remove old quvi modules. This commit was sponsored by Øyvind Andersen Holm.
* youtube-dl workingGravatar Joey Hess2017-11-29
| | | | | | | | | Including resuming and cleanup of incomplete downloads. Still todo: --fast, --relaxed, importfeed, disk reserve checking, quvi code cleanup. This commit was sponsored by Anthony DeRobertis on Patreon.
* wipGravatar Joey Hess2017-11-28
|
* AssociatedFile newtypeGravatar Joey Hess2017-03-10
| | | | | | To prevent any further mistakes like 1a497cefb47557f0b4788c606f9071be422b2511 This commit was sponsored by Francois Marier on Patreon.
* annex.securehashesonlyGravatar Joey Hess2017-02-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cryptographically secure hashes can be forced to be used in a repository, by setting annex.securehashesonly. This does not prevent the git repository from containing files with insecure hashes, but it does prevent the content of such files from being pulled into .git/annex/objects from another repository. We want to make sure that at no point does git-annex accept content into .git/annex/objects that is hashed with an insecure key. Here's how it was done: * .git/annex/objects/xx/yy/KEY/ is kept frozen, so nothing can be written to it normally * So every place that writes content must call, thawContent or modifyContent. We can audit for these, and be sure we've considered all cases. * The main functions are moveAnnex, and linkToAnnex; these were made to check annex.securehashesonly, and are the main security boundary for annex.securehashesonly. * Most other calls to modifyContent deal with other files in the KEY directory (inode cache etc). The other ones that mess with the content are: - Annex.Direct.toDirectGen, in which content already in the annex directory is moved to the direct mode file, so not relevant. - fix and lock, which don't add new content - Command.ReKey.linkKey, which manually unlocks it to make a copy. * All other calls to thawContent appear safe. Made moveAnnex return a Bool, so checked all callsites and made them deal with a failure in appropriate ways. linkToAnnex simply returns LinkAnnexFailed; all callsites already deal with it failing in appropriate ways. This commit was sponsored by Riku Voipio.
* Some optimisations to string splitting code.Gravatar Joey Hess2017-01-31
| | | | | | | | | | | | | | | | | | | Turns out that Data.List.Utils.split is slow and makes a lot of allocations. Here's a much simpler single character splitter that behaves the same (even in wacky corner cases) while running in half the time and 75% the allocations. As well as being an optimisation, this helps move toward eliminating use of missingh. (Data.List.Split.splitOn is nearly as slow as Data.List.Utils.split and allocates even more.) I have not benchmarked the effect on git-annex, but would not be surprised to see some parsing of eg, large streams from git commands run twice as fast, and possibly in less memory. This commit was sponsored by Boyd Stephen Smith Jr. 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!
* fix regressionGravatar Joey Hess2016-11-22
| | | | | | | | | | | | The file matcher needs to be run on the destination file not the tmp file, in order for filename matches to work properly. However, it also needs to be able to probe the file for size and mime type. This is a quick fix to a regression. The double rename is not pretty. It would be good to either have a way to run the largeFileMatcher such that it is matching on the final filename but looks at the temp file, or to make addAnnexedFile not need the temp file in a different location.
* addurl: Fix bug in checking annex.largefiles expressions using largerthan, ↵Gravatar Joey Hess2016-11-21
| | | | mimetype, and smallerthan; the first two always failed to match, and the latter always matched.
* 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.
* addurl, importfeed: Improve behavior when file being added is gitignored.Gravatar Joey Hess2016-09-21
|
* addurl, get: Added --json-progress option, which adds progress objects to ↵Gravatar Joey Hess2016-09-09
| | | | | | | the json output. This doesn't work right when used with -J yet, and there is some really ugly hand-crafting of part of the json output.
* remove TransferObserverGravatar Joey Hess2016-08-03
| | | | unused after last commit
* Removed dependency on json library; all JSON is now handled by aeson.Gravatar Joey Hess2016-07-26
| | | | | I've eyeballed all --json commands, and the only difference should be that some fields are re-ordered.
* allow using Aeson for streaming JSON outputGravatar Joey Hess2016-07-26
| | | | | | | Keeping Text.JSON use for now, because it seems a better fit for most of the commands, which don't use very structured JSON objects, but just output whatever fields suites them. But this lets Aeson be used when a more structured data type is available to serialize to JSON.
* annex.addunlockedGravatar Joey Hess2016-02-16
| | | | | | | * add, addurl, import, importfeed: When in a v6 repository on a crippled filesystem, add files unlocked. * annex.addunlocked: New configuration setting, makes files always be added unlocked. (v6 only)
* remove 3 build flagsGravatar Joey Hess2016-01-26
| | | | | | | | | | | | | * Removed the webapp-secure build flag, rolling it into the webapp build flag. * Removed the quvi and tahoe build flags, which only adds aeson to the core dependencies. * Removed the feed build flag, which only adds feed to the core dependencies. Build flags have cost in both code complexity and also make Setup configure have to work harder to find a usable set of build flags when some dependencies are missing.
* remove 163 lines of code without changing anything except importsGravatar Joey Hess2016-01-20
|
* addurl --json: Include field for added keyGravatar Joey Hess2016-01-19
| | | | | | (unless the file was added directly to git due to annex.largefiles configuration.) (Also done by add --json and import --json)
* convert existing non-annexed file to non-exceptionGravatar Joey Hess2016-01-15
|
* addurl: Refuse to overwrite any existing, non-annexed file.Gravatar Joey Hess2016-01-13
|
* addurl: Support --json, particularly useful in --batch mode.Gravatar Joey Hess2016-01-13
|
* Merge branch 'master' into smudgeGravatar Joey Hess2015-12-22
|\
* | refactoringGravatar Joey Hess2015-12-22
| | | | | | | | no behavior changes
| * addurl: Added --with-files option.Gravatar Joey Hess2015-12-22
| |
| * refactorGravatar Joey Hess2015-12-22
|/
* addurl: Added --batch option.Gravatar Joey Hess2015-12-21
|
* addurl, importfeed: Changed to honor annex.largefiles settings, when the ↵Gravatar Joey Hess2015-12-02
| | | | | | | | | content of the url is downloaded. (Not when using --fast or --relaxed.) importfeed just calls addurl functions, so inherits this from it. Note that addurl still generates a temp file, and uses that key to download the file. It just adds it to the work tree at the end when the file is small.
* 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.
* -J for add/addurl/importGravatar Joey Hess2015-11-05
|
* other 80% of avoding verification when hard linking to objects in shared repoGravatar Joey Hess2015-10-02
| | | | | | | | | | | | | | | | | | | | In c3b38fb2a075b4250e867ebd910324c65712c747, it actually only handled uploading objects to a shared repository. To avoid verification when downloading objects from a shared repository, was a lot harder. On the plus side, if the process of downloading a file from a remote is able to verify its content on the side, the remote can indicate this now, and avoid the extra post-download verification. As of yet, I don't have any remotes (except Git) using this ability. Some more work would be needed to support it in special remotes. It would make sense for tahoe to implicitly verify things downloaded from it; as long as you trust your tahoe server (which typically runs locally), there's cryptographic integrity. OTOH, despite bup being based on shas, a bup repo under an attacker's control could have the git ref used for an object changed, and so a bup repo shouldn't implicitly verify. Indeed, tahoe seems unique in being trustworthy enough to implicitly verify.
* rename functionGravatar Joey Hess2015-10-01
|
* importfeed --relaxed: Avoid hitting the urls of items in the feed.Gravatar Joey Hess2015-08-19
|
* addurl now accepts --prefix and --suffix options to adjust the filenames usedGravatar Joey Hess2015-07-21
|
* converted ImportFeedGravatar Joey Hess2015-07-13
|
* converted addurlGravatar Joey Hess2015-07-13
|
* convert all commands to work with optparse-applicativeGravatar Joey Hess2015-07-08
| | | | Still no options though.