{"id":1513,"date":"2013-03-18T22:06:43","date_gmt":"2013-03-18T21:06:43","guid":{"rendered":"http:\/\/blog.guiguiabloc.fr\/?p=1513"},"modified":"2013-10-08T18:45:16","modified_gmt":"2013-10-08T17:45:16","slug":"monter-votre-hubic-dans-un-repertoire-linux","status":"publish","type":"post","link":"http:\/\/blog.guiguiabloc.fr\/index.php\/2013\/03\/18\/monter-votre-hubic-dans-un-repertoire-linux\/","title":{"rendered":"Monter votre Hubic dans un r\u00e9pertoire Linux"},"content":{"rendered":"<p><a href=\"http:\/\/blog.guiguiabloc.fr\/wp-content\/2013\/03\/hubic.png\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1520\" title=\"hubic\" src=\"http:\/\/blog.guiguiabloc.fr\/wp-content\/2013\/03\/hubic.png\" alt=\"\" width=\"285\" height=\"180\" \/><\/a><\/p>\n<p>Un petit billet vite fait suite a l&rsquo;avalanche de mails que j&rsquo;ai re\u00e7u apr\u00e8s mon tweet sur mon montage local de mon d\u00e9pot <a title=\"http:\/\/www.ovh.fr\/hubiC\/\" href=\"http:\/\/www.ovh.fr\/hubiC\/\" target=\"_blank\">Hubic<\/a>.<\/p>\n<p>Apparemment, cette technique semble tr\u00e8s recherch\u00e9e actuellement (surtout depuis l&rsquo;abandon du support \u00ab\u00a0non officiel\u00a0\u00bb webdav de <a title=\"http:\/\/www.ovh.fr\/hubiC\/\" href=\"http:\/\/www.ovh.fr\/hubiC\/\" target=\"_blank\">Hubic<\/a>).<\/p>\n<p>Donc je vais vous expliquer rapidement, comment monter votre d\u00e9p\u00f4t Hubic sous Linux, et l&rsquo;utiliser comme un simple r\u00e9pertoire local (synchro comprise).<\/p>\n<p><a title=\"http:\/\/www.ovh.fr\/hubiC\/\" href=\"http:\/\/www.ovh.fr\/hubiC\/\" target=\"_blank\">Hubic<\/a> utilise <a title=\"http:\/\/www.openstack.org\/\" href=\"http:\/\/www.openstack.org\/\" target=\"_blank\">Open Stack<\/a>, un projet opensource ax\u00e9 sur le \u00ab\u00a0cloud computing\u00a0\u00bb.<\/p>\n<p>A ce titre on pourrait imaginer qu&rsquo;il est totalement compatible avec les librairies OpenStack (comme<a title=\"http:\/\/docs.openstack.org\/developer\/swift\/\" href=\"http:\/\/docs.openstack.org\/developer\/swift\/\" target=\"_blank\"> Swift<\/a>), mais en fait, pas vraiment&#8230;<\/p>\n<p>Si, intrins\u00e8quement, le client Swift fonctionne, OVH a rajout\u00e9 une couche\u00a0 suppl\u00e9mentaire d&rsquo;authentification \u00e0 base de token, et \u00e7a, c&rsquo;est pas vraiment bien g\u00e9r\u00e9 par Swift.<\/p>\n<p>Heureusement, des confr\u00e8res bloggeurs comme <a title=\"https:\/\/github.com\/gierschv\/node-hubic-swiftauth\" href=\"https:\/\/github.com\/gierschv\/node-hubic-swiftauth\" target=\"_blank\">Vincent Giersch<\/a> ou <a title=\"http:\/\/blog.toorop.fr\/hubic-swift-client-cyberduck\/\" href=\"http:\/\/blog.toorop.fr\/hubic-swift-client-cyberduck\/\" target=\"_blank\">Toorop<\/a> ont propos\u00e9 des solutions pour s&rsquo;authentifier sur Hubic via Swift.<\/p>\n<p>Toorop propose m\u00eame une <a title=\"https:\/\/hubic.toorop.fr \" href=\"https:\/\/hubic.toorop.fr \" target=\"_blank\">passerelle de pr\u00e9-authentification<\/a> en libre service pour votre Hubic, mais dans notre cas, nous allons tout g\u00e9rer en interne.<\/p>\n<ul>\n<li>G\u00e9rer en interne la pr\u00e9-authentification Hubic<\/li>\n<\/ul>\n<p>Je me suis bas\u00e9 sur l&rsquo;excellent travail de Toorop et son HubicSwiftGateway.<\/p>\n<p>T\u00e9l\u00e9charger les sources :<\/p>\n<p><a title=\"https:\/\/github.com\/Toorop\/HubicSwiftGateway\" href=\"https:\/\/github.com\/Toorop\/HubicSwiftGateway\" target=\"_blank\">https:\/\/github.com\/Toorop\/HubicSwiftGateway<\/a><\/p>\n<p>D\u00e9compresser le tout et copier l&rsquo;int\u00e9gralit\u00e9 du contenu du r\u00e9pertoire \u00ab\u00a0www\u00a0\u00bb dans un des r\u00e9pertoires de votre serveur web local (ah bah oui, je suppose quand m\u00eame que vous avec un petit serveur web dans votre r\u00e9seau interne&#8230; (et qui supporte php aussi&#8230;)<br \/>\nUn niveau au dessus, il vous faut cr\u00e9er un r\u00e9pertoire \u00ab\u00a0cache\u00a0\u00bb avec les droits 777 (je sais c&rsquo;est crade&#8230; mais bon, ca reste du local)<\/p>\n<p>Pour ma part, j&rsquo;ai tout d\u00e9pos\u00e9 dans le r\u00e9pertoire \u00ab\u00a0hubic\u00a0\u00bb et la gateway est donc accessible via http:\/\/lan.web\/hubic (et donc le cache sur http:\/\/lan.web\/cache)<\/p>\n<p>D\u00e8s maintenant vous pouvez utiliser le client <a title=\"http:\/\/docs.openstack.org\/developer\/swift\/getting_started.html\" href=\"http:\/\/docs.openstack.org\/developer\/swift\/getting_started.html\" target=\"_blank\">Swift officiel <\/a>en ligne de commande (y&rsquo;a que \u00e7a de vrai) gr\u00e2ce a un :<\/p>\n<pre lang=\"text\">swift -A http:\/\/lan.web\/hubic\/ -U loginhubic -K motdepassehubic<\/pre>\n<p>Je vous conseille un petit \u00ab\u00a0alias hubic= &#8230;\u00a0\u00bb dans votre .bashrc \ud83d\ude09<\/p>\n<p>et donc un \u00ab\u00a0hubic list\u00a0\u00bb vous donnera la liste de vos fichiers.<\/p>\n<p>(ou swift -A http:\/\/lan.web\/hubic\/ -U loginhubic -K motdepassehubic list , si vous aimez taper au clavier)<\/p>\n<p>bref, swift -h pour l&rsquo;aide ou le site web \ud83d\ude42<\/p>\n<ul>\n<li>Installer cloudfuse<\/li>\n<\/ul>\n<p><a title=\"http:\/\/www.weirdlooking.com\/\" href=\"http:\/\/www.weirdlooking.com\/\" target=\"_blank\">Michael Barton<\/a> nous offre une petit bout de code bien sympa permettant de monter sous linux des stockages distants type <a title=\"http:\/\/www.rackspace.com\/cloud\/\" href=\"http:\/\/www.rackspace.com\/cloud\/\" target=\"_blank\">Rackspace<\/a> (et Swift \u00e9galement) via la biblioth\u00e8que <a title=\"http:\/\/fr.wikipedia.org\/wiki\/Filesystem_in_Userspace\" href=\"http:\/\/fr.wikipedia.org\/wiki\/Filesystem_in_Userspace\" target=\"_blank\">FUSE<\/a>.<\/p>\n<p>T\u00e9l\u00e9charger les sources de CloudFuse ici :<\/p>\n<p><a title=\"https:\/\/github.com\/redbo\/cloudfuse\" href=\"https:\/\/github.com\/redbo\/cloudfuse\" target=\"_blank\">https:\/\/github.com\/redbo\/cloudfuse<\/a><\/p>\n<p>Pr\u00e9parer les pr\u00e9-requis sous notre nunux favori :<br \/>\nlibcurl, libcurl-devel, fuse, fuse-devel, fuse-libs, libxml2 et libxml2-devel<\/p>\n<p>Installation comme je les aime :<\/p>\n<pre lang=\"text\">tar xvzf redbo-cloudfuse-809b07e.tar.gz\r\ncd redbo-cloudfuse-809b07e\r\n.\/configure\r\nmake\r\nmake install<\/pre>\n<p>Un petit fichier de config dans votre home directory (.cloudfuse) :<\/p>\n<pre lang=\"text\">username=loginhubic\r\napi_key=motdepassehubic\r\nauthurl=http:\/\/lan.web\/hubic\/\r\ncache_timeout=20<\/pre>\n<p>Et voila, ne reste qu&rsquo;a se mkdir un \/mnt\/hubic<\/p>\n<p>et la commande magique&#8230; tadammm :<\/p>\n<pre lang=\"text\">\/usr\/local\/bin\/cloudfuse \/mnt\/hubic\/ -o noauto_cache,sync_read<\/pre>\n<p>(bon je vous laisse lire le man de cloudfuse si vous voulez peaufiner ;))<\/p>\n<p>Et voila, vous avez votre Hubic directement sous \/mnt\/hubic.<br \/>\nCr\u00e9er ou supprimer un fichier et vous le retrouverez synchroniser avec vos autres clients Hubic officiels \ud83d\ude00<\/p>\n<p>Magique non ?<\/p>\n<p>Amusez-vous bien \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Un petit billet vite fait suite a l&rsquo;avalanche de mails que j&rsquo;ai re\u00e7u apr\u00e8s mon tweet sur mon montage local de mon d\u00e9pot Hubic. Apparemment, cette technique semble tr\u00e8s recherch\u00e9e actuellement (surtout depuis l&rsquo;abandon du support \u00ab\u00a0non officiel\u00a0\u00bb webdav de &hellip; <a href=\"http:\/\/blog.guiguiabloc.fr\/index.php\/2013\/03\/18\/monter-votre-hubic-dans-un-repertoire-linux\/\">Read More <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[200,221,60,202,204],"_links":{"self":[{"href":"http:\/\/blog.guiguiabloc.fr\/index.php\/wp-json\/wp\/v2\/posts\/1513"}],"collection":[{"href":"http:\/\/blog.guiguiabloc.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.guiguiabloc.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.guiguiabloc.fr\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.guiguiabloc.fr\/index.php\/wp-json\/wp\/v2\/comments?post=1513"}],"version-history":[{"count":14,"href":"http:\/\/blog.guiguiabloc.fr\/index.php\/wp-json\/wp\/v2\/posts\/1513\/revisions"}],"predecessor-version":[{"id":1593,"href":"http:\/\/blog.guiguiabloc.fr\/index.php\/wp-json\/wp\/v2\/posts\/1513\/revisions\/1593"}],"wp:attachment":[{"href":"http:\/\/blog.guiguiabloc.fr\/index.php\/wp-json\/wp\/v2\/media?parent=1513"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.guiguiabloc.fr\/index.php\/wp-json\/wp\/v2\/categories?post=1513"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.guiguiabloc.fr\/index.php\/wp-json\/wp\/v2\/tags?post=1513"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}