App to mount cloud drives in linux
|
7 سال پیش | |
---|---|---|
internal | 7 سال پیش | |
vendor | 7 سال پیش | |
.gitignore | 7 سال پیش | |
README.md | 7 سال پیش | |
SPEC.md | 7 سال پیش | |
flags.go | 7 سال پیش | |
main.go | 7 سال پیش | |
version.go | 7 سال پیش |
Linux util to Mount cloud drives
####Usage:
$ cloudmount -h
cloudmount-0.3-3-gadf4880 - built: 2017-07-11 01:34:58 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,gid ex: -o uid=1000,gid=0
-r duration
Timed cloud synchronization interval [if applied] (default 2m0s)
-t string
which cloud service to use [gdrive] (default "gdrive")
-v Verbose log
-w string
Work dir, path that holds configurations (default "<homedir>/.cloudmount")
$ go get dev.hexasoftware.com/hxs/cloudmount
# will default source file to $HOME/.cloudmount/gdrive.json
$ cloudmount MOUNTPOINT
# or
$ cloudmount gdrive.json MOUNTPOINT
Configuration files/source can be written in following formats:
Setup Google client secrets:
https://console.developers.google.com/apis/credentials
Turn on the Drive API
- 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.
- On the Add credentials to your project page, click the Cancel button.
- 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.
- Select the Credentials tab, click the Create credentials button and select OAuth client ID.
- Select the application type Other, enter the name "Drive API Quickstart", and click the Create button.
- 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.json config:
{
"client_secret": {
"client_id": "CLIENTID",
"client_secret": "CLIENTSECRET"
}
}
or yaml format:
client_secret:
client_id: CLIENTID
client_secret: CLIENTSECRET
$ cloudmount gdrive.json $HOME/mntpoint
Also it's possible to create the json/yaml file in home directory as $HOME/.cloudmount/gdrive.json if <source> parameter is ommited it will default to this file
cloudmount gdrivefs will retrieve an oauth2 token and save in same file
Signal | Action | ex |
---|---|---|
USR1 | Refreshes directory tree from file system | killall -USR1 gdrivemount |
HUP | Perform a GC and shows memory usage Works when its not running in daemon mode | killall -HUP gdrivemount |
Create a common structure for driver // Driver needs populate list somehow