Coder Social home page Coder Social logo

cloudmount's Introduction

cloudmount

Linux util to Mount cloud drives

Table of Contents

Installation

$ go get github.com/gohxs/cloudmount

Usage

$ cloudmount -h

cloudmount-0.4-5-gf01e8fb - built: 2017-07-17 05:09:51 UTC

Usage: cloudmount [options] [<source>] <directory>

Source: can be json/yaml configuration file usually with credentials or cloud specific configuration

Options:
  -d	Run app in background
  -o string
    	uid=1000,gid=1000,ro=false
  -r duration
    	Timed cloud synchronization interval [if applied] (default 5s)
  -t string
    	which cloud service to use [gdrive] (default "gdrive")
  -v	Verbose log
  -vv
    	Extra Verbose log
  -w string
    	Work dir, path that holds configurations (default "$HOME/.cloudmount")

Example

# will default source file to $HOME/.cloudmount/gdrive.yaml
$ cloudmount -t gdrive /mnt/gdrive
# or 
$ cloudmount -t dropbox dropbox.yaml /mnt/dropbox

Source config Configuration files/source can be written in following formats:

  • yaml
  • json

Cloud services

  • Google Drive
  • Dropbox

Google Drive

Setup Google client secrets:

https://console.developers.google.com/apis/credentials

Turn on the Drive API

  1. Use this wizard to create or select a project in the Google Developers Console and automatically turn on the API. Click Continue, then Go to credentials.
  2. On the Add credentials to your project page, click the Cancel button.
  3. At the top of the page, select the OAuth consent screen tab. Select an Email address, enter a Product name if not already set, and click the Save button.
  4. Select the Credentials tab, click the Create credentials button and select OAuth client ID.
  5. Select the application type Other, enter the name "Drive API Quickstart", and click the Create button.
  6. With the result dialog, copy clientID and client secret and create json file as shown in example (this can be retrieved any time by clicking on the api key)

sample gdrive.yaml config:

client_secret:
  client_id: *Client ID*
  client_secret: *Client Secret*
$ cloudmount gdrive.yaml $HOME/mntpoint

Also it's possible to create the yaml file in home directory as $HOME/.cloudmount/gdrive.yaml if <source> parameter is omitted it will default to this file

cloudmount gdrivefs will retrieve an oauth2 token and save in same file

Dropbox

Setup Dropbox client secrets:

https://www.dropbox.com/developers/apps

  1. Click Create App
  2. Select the API, type of access, and App name
  3. Use the values from App key and App secret

sample dropbox.yaml file:

client_secret:
  client_id: *App Key*
  client_secret: *App secret*
$ cloudmount -t dropbox savedfile.yaml /mnt/point

On the first run a link will appear and it will request a token resulting from the link


Signals

Signal Action ex
USR1 Refreshes directory tree from file system killall -USR1 cloudmount
HUP Perform a GC and shows memory usage Works when its not running in daemon mode killall -HUP cloudmount

TODO & IDEAS:

  • Consider using github.com/codegangsta/cli
  • Create test suit to implement new packages
  • Caching: long term caching, maintain most used files locally until flush/change
  • Add logging to syslog while on -d

cloudmount's People

Contributors

hexasoftware avatar

Watchers

James Cloos avatar Leo Palomares avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.