show how to set up preferred content for IA like the webapp does

This commit is contained in:
Joey Hess 2014-02-28 18:42:31 -04:00
parent 1a253157f4
commit fb2a38963f
Failed to extract signature

View file

@ -15,7 +15,12 @@ from archive.org, without needing any login or password info. This makes
the Internet Archive a nice way to publish the large files associated with
a public git repository.
----
## webapp setup
Just go to "Add Another Repository", pick "Internet Archive",
and you're on your way.
## basic setup
Sign up for an account, and get your access keys here:
<http://www.archive.org/account/s3.php>
@ -40,7 +45,7 @@ specify `x-archive-meta*` headers to add metadata as explained in their
Then you can annex files and copy them to the remote as usual:
# git annex add photo1.jpeg --backend=SHA1E
# git annex add photo1.jpeg --backend=SHA256E
add photo1.jpeg (checksum...) ok
# git annex copy photo1.jpeg --fast --to archive-panama
copy (to archive-panama...) ok
@ -50,9 +55,31 @@ from it. Also, git-annex whereis will tell you a public url for the file
on archive.org. (It may take a while for archive.org to make the file
publically visibile.)
Note the use of the SHA1E [[backend|backends]] when adding files. That is
Note the use of the SHA256E [[backend|backends]] when adding files. That is
the default backend used by git-annex, but even if you don't normally use
it, it makes most sense to use the WORM or SHA1E backend for files that
it, it makes most sense to use the WORM or SHA256E backend for files that
will be stored in the Internet Archive, since the key name will be exposed
as the filename there, and since the Archive does special processing of
files based on their extension.
## publishing only one subdirectory
Perhaps you have a repository with lots of files in it, and only want
to publish some of them to a particular Internet Archive item. Of course
you can specify which files to send manually, but it's useful to
configure [[preferred_content]] settings so git-annex knows what content
you want to store in the Internet Archive.
One way to do this is using the "public" repository type.
git annex enableremote archive-panama preferreddir=panama
git annex wanted archive-panama standard
git annex group archive-panama public
Now anything in a "panama" directory will be sent to that remote,
and anything else won't. You can use `git annex copy --auto` or the
assistant and it'll do the right thing.
When setting up an Internet Archive item using the webapp, this
configuration is automatically done, using an item name that the user
enters as the name of the subdirectory.