A Git annex hook for Hubic

I've just finished the git annex hook I was writing. It create a special remote that will use Hubic as a storage for git annex's objects.

To use it, you will have to download it from github. It depend on

  • ruby (the ruby debian package will do)
  • mechanize (the ruby-mechanize debian package, you can also use gems)
  • dbus (the ruby-dbus package)

To use it, you first need to initialize your account.

You need an hubic account, but also a client_id and client_secret, that you can generate in My account then Developer. For my hook to work, you need to use http://localhost:4090/ as the Redirect URI (Domaine de redirection in french)

Credential will be stored in dbus's org.freedesktop.secrets service, both gnome and kde will give you one. So run hubic-git-annex-hook --init, it will ask for your hubic username, password, your client id and your client secret that you just generate, and store them in the org.freedesktop.secrets service.

Then configure git-annex to use it :

git config annex.hubic-hook /full/path/to/hubic-git-annex-hook $HUBIC_USERNAME $CONTAINER

the CONTAINER is openstack concept, that contain the files. Hubic use the container default for its synchronization application, you should probably use another. If the CONTAINER do not exist, the hook will create it.

You finally need to create the special remote :

git annex initremote hubic type=hook hooktype=hubic encryption=none

(you could chose any other name than hubic), you can then git annex copy --to=hubic