2015-06-05 20:27:41 +00:00
|
|
|
Here's how to create a Amazon [[S3 special remote|special_remotes/S3]] that
|
|
|
|
can be read by anyone who gets a clone of your git-annex repository,
|
|
|
|
without them needing Amazon AWS credentials.
|
|
|
|
|
2017-09-08 20:19:38 +00:00
|
|
|
If you want to publish files to S3 so they can be accessed without using
|
|
|
|
git-annex, see [[publishing_your_files_to_the_public]].
|
|
|
|
|
2015-06-05 20:31:13 +00:00
|
|
|
Note: Bear in mind that Amazon will charge the owner of the bucket
|
|
|
|
for public downloads from that bucket.
|
|
|
|
|
2015-06-05 20:55:45 +00:00
|
|
|
## create public remote
|
2015-06-05 20:27:41 +00:00
|
|
|
|
|
|
|
First, export your Amazon AWS credentials:
|
|
|
|
|
|
|
|
# export AWS_ACCESS_KEY_ID="08TJMT99S3511WOZEP91"
|
|
|
|
# export AWS_SECRET_ACCESS_KEY="s3kr1t"
|
|
|
|
|
|
|
|
Now, create the remote:
|
|
|
|
|
|
|
|
# git annex initremote pubs3 type=S3 encryption=none public=yes
|
|
|
|
initremote pubs3 (checking bucket) (creating bucket in US) ok
|
|
|
|
|
2018-07-02 16:30:39 +00:00
|
|
|
The public=yes makes git-annex set a S3 ACL so the files in the bucket
|
|
|
|
are publically readable. For git-annex to be able to download files from
|
|
|
|
that bucket without needing your AWS credentials, you then need to tell
|
|
|
|
it the url of the bucket. Find that url, and run:
|
|
|
|
|
|
|
|
# git annex enableremote pubs3 publicurl=...
|
2015-06-05 20:27:41 +00:00
|
|
|
|
2015-06-05 20:43:03 +00:00
|
|
|
In the above example, no encryption was used, but it will also work
|
|
|
|
if you enable encryption=shared. Then files will be encrypted on S3, and
|
|
|
|
anyone with a clone of the git repository will be able to download and
|
|
|
|
decrypt them.
|
|
|
|
|
|
|
|
It's also ok to enable chunking when setting up the remote.
|
|
|
|
|
2015-06-05 20:27:41 +00:00
|
|
|
Now, copy some files to the remote, in the usual way, and push your
|
|
|
|
git repository to someplace where someone else can access it.
|
|
|
|
|
|
|
|
## use public remote
|
|
|
|
|
|
|
|
Once the S3 remote is set up, anyone who can clone the git repositry
|
|
|
|
can get files from the remote, without needing any Amazon AWS credentials.
|
|
|
|
|
|
|
|
Start by checking out the git repository.
|
|
|
|
|
|
|
|
In the checkout, enable the S3 remote:
|
|
|
|
|
|
|
|
# git annex enableremote pubs3
|
|
|
|
enableremote pubs3 ok
|
|
|
|
|
|
|
|
Now, git-annex can be used as usual to download files from that remote.
|
|
|
|
|
2015-06-05 20:55:45 +00:00
|
|
|
## sharing urls
|
|
|
|
|
|
|
|
You can also share urls to files stored in a public S3 remote to people
|
|
|
|
who are not using git-annex. To find the url, use `git annex whereis`.
|
|
|
|
|
2015-06-05 20:27:41 +00:00
|
|
|
----
|
|
|
|
|
|
|
|
See [[special_remotes/S3]] for details about configuring S3 remotes.
|