2011-05-16 06:07:59 +00:00
|
|
|
[The Internet Archive](http://www.archive.org/) allows members to upload
|
|
|
|
collections using an Amazon S3
|
|
|
|
[compatible API](http://www.archive.org/help/abouts3.txt), and this can
|
|
|
|
be used with git-annex's [[special_remotes/S3]] support.
|
|
|
|
|
2011-05-16 15:52:33 +00:00
|
|
|
So, you can locally archive things with git-annex, define remotes that
|
|
|
|
correspond to "items" at the Internet Archive, and use git-annex to upload
|
|
|
|
your files to there. Of course, your use of the Internet Archive must
|
|
|
|
comply with their [terms of service](http://www.archive.org/about/terms.php).
|
2011-05-16 06:07:59 +00:00
|
|
|
|
2013-04-26 05:00:58 +00:00
|
|
|
A nice added feature is that whenever git-annex sends a file to the
|
|
|
|
Internet Archive, it records its url, the same as if you'd run `git annex
|
|
|
|
addurl`. So any users who can clone your repository can download the files
|
2017-09-12 16:33:08 +00:00
|
|
|
from archive.org, without needing any login or password info.
|
|
|
|
The url to the content in the Internet Archive is also displayed by
|
|
|
|
`git annex whereis`. This makes the Internet Archive a nice way to
|
|
|
|
publish the large files associated with a public git repository.
|
2013-04-26 05:00:58 +00:00
|
|
|
|
2014-02-28 22:42:31 +00:00
|
|
|
## webapp setup
|
|
|
|
|
|
|
|
Just go to "Add Another Repository", pick "Internet Archive",
|
|
|
|
and you're on your way.
|
|
|
|
|
|
|
|
## basic setup
|
2013-04-26 05:00:58 +00:00
|
|
|
|
2011-05-16 06:07:59 +00:00
|
|
|
Sign up for an account, and get your access keys here:
|
|
|
|
<http://www.archive.org/account/s3.php>
|
|
|
|
|
|
|
|
# export AWS_ACCESS_KEY_ID=blahblah
|
|
|
|
# export AWS_SECRET_ACCESS_KEY=xxxxxxx
|
|
|
|
|
2011-05-16 15:20:30 +00:00
|
|
|
Specify `host=s3.us.archive.org` when doing `initremote` to set up
|
|
|
|
a remote at the Archive. This will enable a special Internet Archive mode:
|
|
|
|
Encryption is not allowed; you are required to specify a bucket name
|
2011-05-16 16:12:03 +00:00
|
|
|
rather than having git-annex pick a random one; and you can optionally
|
2011-05-16 15:20:30 +00:00
|
|
|
specify `x-archive-meta*` headers to add metadata as explained in their
|
|
|
|
[documentation](http://www.archive.org/help/abouts3.txt).
|
|
|
|
|
2011-05-16 15:52:33 +00:00
|
|
|
# git annex initremote archive-panama type=S3 \
|
|
|
|
host=s3.us.archive.org bucket=panama-canal-lock-blueprints \
|
2011-05-16 15:20:30 +00:00
|
|
|
x-archive-meta-mediatype=texts x-archive-meta-language=eng \
|
2018-11-05 16:02:23 +00:00
|
|
|
x-archive-meta-collection=test_collection \
|
2011-05-16 15:20:30 +00:00
|
|
|
x-archive-meta-title="original Panama Canal lock design blueprints"
|
2011-05-16 17:10:26 +00:00
|
|
|
initremote archive-panama (Internet Archive mode) ok
|
2011-05-16 17:33:33 +00:00
|
|
|
# git annex describe archive-panama "a man, a plan, a canal: panama"
|
2011-05-16 06:07:59 +00:00
|
|
|
describe archive-panama ok
|
|
|
|
|
2018-11-05 16:02:23 +00:00
|
|
|
The above uploads to the [test collection](https://archive.org/details/test_collection) where items are removed
|
|
|
|
after thirty days. Uploads can persist by changing to another writable
|
|
|
|
[collection](https://internetarchive.readthedocs.io/en/latest/metadata.html#collection).
|
|
|
|
|
2011-05-16 06:07:59 +00:00
|
|
|
Then you can annex files and copy them to the remote as usual:
|
|
|
|
|
2014-02-28 22:42:31 +00:00
|
|
|
# git annex add photo1.jpeg --backend=SHA256E
|
2011-05-16 15:46:34 +00:00
|
|
|
add photo1.jpeg (checksum...) ok
|
2011-05-16 15:20:30 +00:00
|
|
|
# git annex copy photo1.jpeg --fast --to archive-panama
|
|
|
|
copy (to archive-panama...) ok
|
|
|
|
|
2017-09-12 16:45:33 +00:00
|
|
|
## update lag
|
|
|
|
|
2017-09-12 16:33:08 +00:00
|
|
|
It may take a while for archive.org to make files publically visible after
|
|
|
|
they've been uploaded.
|
|
|
|
|
|
|
|
While files can be removed from the Internet Archive,
|
|
|
|
[derived versions](https://archive.org/help/derivatives.php)
|
2017-09-12 16:45:33 +00:00
|
|
|
of some files may continued to be stored there for a while
|
|
|
|
after the originals were removed.
|
2013-10-16 20:35:47 +00:00
|
|
|
|
2017-09-08 19:41:31 +00:00
|
|
|
## exporting trees
|
2014-02-28 22:42:31 +00:00
|
|
|
|
2017-09-08 19:41:31 +00:00
|
|
|
By default, files stored in the Internet Archive will show up there named
|
|
|
|
by their git-annex key, not the original filename. If the filenames
|
|
|
|
are important, you can run `git annex initremote` with an additional
|
|
|
|
parameter "exporttree=yes", and then use [[git-annex-export]] to publish
|
|
|
|
a tree of files to the Internet Archive.
|
2014-02-28 22:42:31 +00:00
|
|
|
|
2017-09-12 16:33:08 +00:00
|
|
|
Note that the Internet Archive may not support certian characters
|
|
|
|
in filenames ([see FAQ](http://archive.org/about/faqs.php#1099)).
|
|
|
|
If exporting a filename fails due to such limitations, you would need
|
|
|
|
to rename it in your git annex repository in order to export it.
|