aboutsummaryrefslogtreecommitdiff
path: root/doc/tips/megaannex.mdwn
blob: 96f6f8a52272e0ef759455bb42795d781e9d1a9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
[Megaannex](https://github.com/TobiasTheViking/megaannex)
is a hook program for git-annex to use mega.co.nz as backend

# Requirements:

    requests>=0.10
    pycrypto

Credit for the mega api interface goes to:
<https://github.com/richardasaurus/mega.py>

## Install

Clone the git repository in your home folder.

    git clone git://github.com/TobiasTheViking/megaannex.git 

This should make a ~/megannex folder

## Setup

Run the program once to make an empty config file.

    cd ~/megaannex; python2 megaannex.py

Edit the megaannex.conf file. Add your mega.co.nz username and password

Note: The folder option in the megaannex.conf file isn't yet used. 

## Configuring git-annex

	git config annex.mega-store-hook 'python2 ~/megaannex/megaannex.py store --subject $ANNEX_KEY --file $ANNEX_FILE'
	git config annex.mega-retrieve-hook 'python2 ~/megaannex/megaannex.py  getfile --subject $ANNEX_KEY --file $ANNEX_FILE'
	git config annex.mega-checkpresent-hook 'python2 ~/megaannex/megaannex.py fileexists --subject $ANNEX_KEY'
	git config annex.mega-remove-hook 'python2 ~/megaannex/megaannex.py delete --subject $ANNEX_KEY'

	git annex initremote mega type=hook hooktype=mega encryption=shared
	git annex describe mega "the mega.co.nz library"

## Notes

You may need to use a different command than "python2", depending
on your python installation.

-- Tobias