Giter Club home page Giter Club logo

dcfg's Introduction

About DCFG

Build Status Coverage Status

DCFG allows syncing between Google Apps and Dropbox Business. DCFG automates provisioning and deprovisioning of both users and groups. DCFG reads users and groups on Google Apps, then create/update/delete Dropbox accounts and groups.

Feature

user-provision

Invite users to Dropbox Business team who are in Google Apps but NOT in Dropbox. Users are identified by primary email address.

user-deprovision

Delete users from Dropbox Business team who are NOT in Google Apps but in Dropbox. Users are identified by primary email address.

group-provision

Create/update Dropbox Groups by refering Google Group. Google Group can have nested groups, DCFG expands all nested group, then add all members to Dropbox Group. In some usecase, Google Groups have tons of unmanaged groups. Most IT admins don't want to sync all group into Dropbox. DCFG requires white list of Google Groups (group emali address).

example

Sample structure of Google Groups.

[email protected] (Name: Japan)
  |
  +- [email protected] (USER)
  +- [email protected] (GROUP)
  
[email protected] (Name: Tokyo)
  |
  +- [email protected] (USER)

If IT admin add [email protected] to the white list, DCFG creates Dropbox Group named "Japan". And the group has both [email protected] and [email protected].

Requirements

  • Administrator priviledges required for both Google Apps and Dropbox Business.

How to use: Preparation

Prepare directory

  1. DCFG requires directory for configuration files and writing logs. Create DCFG directory somewhere on your machine.
  2. Download DCFG binary into DCFG directory

Create Project on Google APIs

  1. Login to Google Apps as administrator.
  2. Create project on Google APIs Portal.
  3. Enable Admin SDK.
  4. Create credentials. Select "Admin SDK" for "Which API are you using?", "Other UI (e.g. Windows, CLI tool)" for "Where will you be calling the API from?". Choose "User data" for "What data will you be accessing?".
  5. Create Client ID.
  6. Then download client secret JSON file.
  7. Rename client_secret_*.json to google_client_secret.json
  8. Move google_client_secret.json to DCFG directory.

Authorise and store token of Google Apps

  1. `dcfg -path DCFG directory -auth google
  2. Open link, which displayed by above command.
  3. Approve and copy code.
  4. Paste code into dcfg

Create App on Dropbox Business

  1. Login to Dropbox Business as team admin.
  2. Create app on My Apps.
  3. Choose Dropbox Business API
  4. Choose Team member management for access type.
  5. Name your app.
  6. Generate access token by clicking "Generate" button.

Store token of Dropbox Business

  1. dcfg -path *DCFG directory* -auth dropbox
  2. Paste generated token

Create Google Group white list (optional)

Create list of Google Group emails. Format is like below:

How to use: Provisioning, deprovisioning

Dryrun

DCFG runs as dryrun by default. If you don't need to sync groups, -group-provision-list *white list file* is not required.

dcfg -path *DCFG directory* -group-provision-list *white list file* -sync user-provision,group-provision,user-deprovision

Run

add option -dryrun=false

Build

$ docker build -t dcfg . && rm -fr /tmp/dist && docker run -v /tmp/dist:/dist:rw --rm dcfg

LICENSE

Copyright (c) 2016 Takayuki Okazaki

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

dcfg's People

Contributors

watermint avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

dcfg's Issues

Panic on sync

map not initialised.

panic: assignment to entry in nil map

goroutine 1 [running]:
panic(0x887f00, 0xc0823809f0)
        /usr/local/go/src/runtime/panic.go:481 +0x3f4
github.com/watermint/dcfg/integration/directory.(*GoogleDirectory).loadCustomerMembers(0xc0823609a0,
 0xc0823801c0, 0x9, 0x0)
        /go/src/github.com/watermint/dcfg/integration/directory/google.go:145 +0x6c8
github.com/watermint/dcfg/integration/directory.(*GoogleDirectory).getFlattenMember(0xc0823609a0, 0x
c0820fc990, 0xc0823b7ac0, 0x14, 0x0, 0xc0823abf50)
        /go/src/github.com/watermint/dcfg/integration/directory/google.go:189 +0xae8
github.com/watermint/dcfg/integration/directory.(*GoogleDirectory).createGroupFromRaw(0xc0823609a0,
0xc08214c5b0, 0xc082100148, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /go/src/github.com/watermint/dcfg/integration/directory/google.go:41 +0x11b
github.com/watermint/dcfg/integration/directory.(*GoogleDirectory).Group(0xc0823609a0, 0xc0823ae4a8,
 0x14, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /go/src/github.com/watermint/dcfg/integration/directory/google.go:35 +0x44c
github.com/watermint/dcfg/sync/groupsync.(*GroupSync).Sync(0xc08208bc88, 0xc0823ae4a8, 0x14)
        /go/src/github.com/watermint/dcfg/sync/groupsync/groupsync.go:96 +0x172
github.com/watermint/dcfg/sync/groupsync.(*GroupSync).SyncFromList(0xc08208bc88, 0x0, 0x0, 0xc082006
200, 0x2f, 0xc082008220, 0x9, 0x1, 0x0, 0x0, ...)
        /go/src/github.com/watermint/dcfg/sync/groupsync/groupsync.go:119 +0x30d
github.com/watermint/dcfg/cli/dispatch.DispatchSync(0x0, 0x0, 0xc082006200, 0x2f, 0xc082008220, 0x9,
 0x1, 0x0, 0x0, 0xc082002660, ...)
        /go/src/github.com/watermint/dcfg/cli/dispatch/dispatch.go:41 +0x5cc
github.com/watermint/dcfg/cli/dispatch.Dispatch(0x0, 0x0, 0xc082006200, 0x2f, 0xc082008220, 0x9, 0x1
, 0x0, 0x0, 0xc082002660, ...)
        /go/src/github.com/watermint/dcfg/cli/dispatch/dispatch.go:51 +0xab
main.main()
        /go/src/github.com/watermint/dcfg/dcfg.go:34 +0x207

Lazy load for Google Group

There are no reason to load entire Google Group before start sync. This may cause larger traffic to Google Directory API. Require refactoring for lazy loading of specific Google Group.

Load Google Directory without specifying domain

Google Directory API requires customer or domain for loading data. Regarding docs of Google, "my_customer" is default name for current instance. Use this default for loading Google data.

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.