tips/publishing your files to the public/old methodgit-annexhttp://git-annex.branchable.com/tips/publishing_your_files_to_the_public/old_method/git-annexikiwiki2017-09-08T20:29:27Znice tiphttp://git-annex.branchable.com/tips/publishing_your_files_to_the_public/old_method/comment_1_48f545ce26dbec944f96796ed3b9204d/joey2017-09-08T20:29:27Z2014-12-01T22:59:58Z
<p>Thanks Giovanni for that nice tip!</p>
<p>You can additionally publish the whole git repository
by eg pushing it to github. (Not if it contains private files
or if you have embedded encryption keys or credentials though.)</p>
<p>You can tell git-annex the public url for the files too, and then others
can just clone the git repository and use git-annex to download the files
from S3.</p>
<p>You could set that up by running something like this:</p>
<pre><code>for filename in $(git annex find --in public-s3); do
git annex addurl --file "$filename" https://public-annex.s3.amazonaws.com/"$(git annex lookupkey $filename)"
done
</code></pre>
Publishing using rsync/directory layouthttp://git-annex.branchable.com/tips/publishing_your_files_to_the_public/old_method/comment_2_27a40806d009d617b3ad56873197bf87/BojanNikolic2017-09-08T20:29:27Z2015-02-16T10:04:41Z
Is it possible to easily do the same with rsync/directory layout of the special remote? These have prefixes which are not shown when doing git annex lookupkey
comment 3http://git-annex.branchable.com/tips/publishing_your_files_to_the_public/old_method/comment_3_2f5045629e40e8d881725876190c7846/joey2017-09-08T20:29:27Z2015-02-25T19:44:40Z
<p>You can look up the hash directories for a key using:</p>
<p>git annex examinekey $key --format '${hashdirlower}\n'</p>
comment 4http://git-annex.branchable.com/tips/publishing_your_files_to_the_public/old_method/comment_4_37405f20da790141187e9f780c999448/BojanNikolic2017-09-08T20:29:27Z2015-02-27T09:55:15Z
<p>Many thanks. The command line I ended up using is:</p>
<pre><code>fname="2015/01/04/myfile.pdf" ; git annex copy --to pubweb $fname; key=`git annex lookupkey "$fname"`; git annex examinekey $key --format 'https://www.myweb.com/d/${hashdirlower}${key}/${key}\n'
</code></pre>
<p>to publish selected documents in my git-annex repository onto the web via a rsync special remote on a conventional http server.</p>
comment 5http://git-annex.branchable.com/tips/publishing_your_files_to_the_public/old_method/comment_5_29c3ee4aed6a5b53b6767a96a7b85ad9/anarcat [id.koumbit.net]2017-09-08T20:29:27Z2015-05-27T21:50:10Z
<a href="http://source.git-annex.branchable.com/?p=source.git;a=blobdiff;f=doc/git-annex.mdwn;h=c33633e03378b0125a3feb5d1a9fa61ce9bfa9cc;hp=3af9bbb8c1d2e84506f3db80ad7253a7cd8de1d4;hb=abfe3c09b2caac0827a2196076c9bd9185451b9f;hpb=b24bb6b435ddc91510163c7b22db2ba52703724c">registerurl</a> may provide a faster version of the above. i've also creted a <span class="createlink"><a href="http://git-annex.branchable.com/ikiwiki.cgi?do=create&from=tips%2Fpublishing_your_files_to_the_public%2Fold_method%2Fcomment_5_29c3ee4aed6a5b53b6767a96a7b85ad9&page=todo%2Fcredentials-less_access_to_s3" rel="nofollow">?</a>feature request</span> to make this easier with s3 (so that we don't have to setup urls for each individual file). --<a href="http://git-annex.branchable.com/users/anarcat/">anarcat</a>