2012-03-04 00:06:27 +00:00
|
|
|
[Box.com](http://box.com/) is a file storage service, currently notable
|
|
|
|
for providing 50 gb of free storage if you sign up with its Android client.
|
2012-03-04 17:16:35 +00:00
|
|
|
(Or a few gb free otherwise.)
|
2012-03-04 00:06:27 +00:00
|
|
|
|
2012-11-16 04:42:33 +00:00
|
|
|
git-annex can use Box as a [[special remote|special_remotes]].
|
|
|
|
Recent versions of git-annex make this very easy to set up:
|
|
|
|
|
|
|
|
WEBDAV_USERNAME=you@example.com WEBDAV_PASSWORD=xxxxxxx git annex initremote box.com type=webdav url=https://www.box.com/dav/git-annex chunksize=75mb encryption=you@example.com
|
|
|
|
|
|
|
|
Note the use of chunksize; Box has a 100 mb maximum file size, and this
|
|
|
|
breaks up large files into chunks before that limit is reached.
|
|
|
|
|
|
|
|
# old davfs2 method
|
|
|
|
|
|
|
|
This method is deprecated, but still documented here just in case.
|
|
|
|
Note that the files stored using this method cannot reliably be retreived
|
|
|
|
using the webdav special remote.
|
2012-03-04 00:06:27 +00:00
|
|
|
|
|
|
|
## davfs2 setup
|
|
|
|
|
|
|
|
* First, install
|
|
|
|
the [davfs2](http://savannah.nongnu.org/projects/davfs2) program,
|
|
|
|
which can mount Box using WebDAV. On Debian, just `sudo apt-get install davfs2`
|
|
|
|
* Allow users to mount davfs filesystems, by ensuring that
|
|
|
|
`/sbin/mount.davfs` is setuid root. On Debian, just `sudo dpkg-reconfigure davfs2`
|
|
|
|
* Add yourself to the davfs2 group.
|
2012-03-12 11:22:21 +00:00
|
|
|
|
|
|
|
sudo adduser $(whoami) davfs2
|
|
|
|
|
2012-03-04 00:06:27 +00:00
|
|
|
* Edit `/etc/fstab`, and add a line to mount Box using davfs.
|
2012-03-12 11:22:21 +00:00
|
|
|
|
|
|
|
sudo mkdir -p /media/box.com
|
|
|
|
echo "https://www.box.com/dav/ /media/box.com davfs noauto,user 0 0" | sudo tee -a /etc/fstab
|
|
|
|
|
2012-03-04 15:12:52 +00:00
|
|
|
* Create `~/.davfs2/davfs2.conf` with some important settings:
|
2012-03-12 11:22:21 +00:00
|
|
|
|
|
|
|
mkdir ~/.davfs2/
|
2012-06-07 14:37:06 +00:00
|
|
|
echo use_locks 0 > ~/.davfs2/davfs2.conf
|
2012-03-12 11:22:21 +00:00
|
|
|
echo cache_size 1 >> ~/.davfs2/davfs2.conf
|
|
|
|
echo delay_upload 0 >> ~/.davfs2/davfs2.conf
|
|
|
|
|
2012-03-04 00:06:27 +00:00
|
|
|
* Create `~/.davfs2/secrets`. This file contains your Box.com login and password.
|
|
|
|
Your login is probably the email address you signed up with.
|
2012-03-12 11:22:21 +00:00
|
|
|
|
|
|
|
echo "/media/box.com joey@kitenet.net mypassword" > ~/.davfs2/secrets
|
|
|
|
chmod 600 ~/.davfs2/secrets
|
|
|
|
|
2012-03-04 00:06:27 +00:00
|
|
|
* Now you should be able to mount Box, as a non-root user:
|
2012-03-12 11:22:21 +00:00
|
|
|
|
|
|
|
mount /media/box.com
|
2012-03-04 00:06:27 +00:00
|
|
|
|
|
|
|
## git-annex setup
|
|
|
|
|
|
|
|
You need git-annex version 3.20120303 or newer, which adds support for chunking
|
|
|
|
files larger than Box's 100 mb limit.
|
|
|
|
|
|
|
|
Create the special remote, in your git-annex repository.
|
|
|
|
** This example is non-encrypted; fill in your gpg key ID for a securely
|
|
|
|
encrypted special remote! **
|
|
|
|
|
2012-03-04 15:02:41 +00:00
|
|
|
git annex initremote box.com type=directory directory=/media/box.com chunksize=2mb encryption=none
|
2012-03-04 00:06:27 +00:00
|
|
|
|
|
|
|
Now git-annex can copy files to box.com, get files from it, etc, just like
|
|
|
|
with any other special remote.
|
|
|
|
|
|
|
|
% git annex copy bigfile --to box.com
|
|
|
|
bigfile (to box.com...) ok
|
|
|
|
% git annex drop bigfile
|
|
|
|
bigfile (checking box.com...) ok
|
|
|
|
% git annex get bigfile
|
|
|
|
bigfile (from box.com...) ok
|