Hi,
Use case: I would like to have a "Public" top-level directory in my annex, which gets files in there published over HTTP on a particular server.
How I see doing this:
- Put my annex to an http server with exported-over-http
/Public/
directory. Configure a
post-update
hook with the following:$ git annex fix
Push files on
/Public/
to that annex.
Does it make sense? If yes, are there any gotchas I should beware of?
Thanks.
I see no need for
git annex fix
here.Web server default configurations may not allow following symlinks outside the web server document root. On apache, it can be enabled with
Options FollowSymLinks
I love the idea of pushing files to "visible" using annex, but I'm wondering how difficult to would be to make this even fancier.
For instance, if there are files that were originally imported from the web special remote (and have http:// prefixes, since that's not guaranteed), and they're not actually in the pushed annex, generate a redirect for all of them and write a special remote-local .htaccess file.
Or, similarly, allow each remote to have some metadata which specifies what, if any, the URL prefix for a directory in annex is. Then, whenever you update a web remote, the auto-generated redirects list could contain not only files not present but with web-remote locations, but also other remotes which have the file under a web-visible path prefix. Bonus for allowing URL prefixes for S3-style remotes that are not encrypted.
My use case for this sort of fancy is that I have a large server with gobs of space but on a personal (slower) internet connection, and a much smaller hosted instance with much faster bandwidth. With this smarts, I could push and pull large/expected high traffic files to the higher bandwidth/smaller machine ahead of, say, announcing a new feature or sharing a link to a video via e-mail.. or even reactively if the lower-bandwidth server is getting overwhelmed.