Giter Club home page Giter Club logo

compiler-admin's Introduction

Compiler Admin

Automating Compiler's administrative tasks.

Built on top of GAMADV-XTD3 and GYB.

Note: This tool can only be used by those with administrator access to Compiler's Google Workspace.

Usage

$ compiler-admin -h
usage: compiler-admin [-h] [-v] {info,init,time,user} ...

positional arguments:
  {info,init,time,user}
                        The command to run
    info                Print configuration and debugging information.
    init                Initialize a new admin project. This command should be run once before any others.
    time                Work with Compiler time entries.
    user                Work with users in the Compiler org.

options:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit

Getting started

git clone https://github.com/compilerla/compiler-admin.git

cd compiler-admin

Now open in VS Code, and when prompted, reopen in the devcontainer.

Initial setup

Initial setup of a GAMADV-XTD3 project and GYB project is required to provide necessary API access to the Google Workspace.

$ compiler-admin init -h
usage: compiler-admin init [-h] [--gam] [--gyb] username

positional arguments:
  username    A Compiler user account name, sans domain.

options:
  -h, --help  show this help message and exit
  --gam       If provided, initialize a new GAM project.
  --gyb       If provided, initialize a new GYB project.

The init commands follows the steps in the GAMADV-XTD3 Wiki.

Additionally, GYB is used for Gmail backup/restore. See the GYB Wiki for more information.

Working with time entires

The time command provides an interface for working with time entries from Compiler's various systems:

$ compiler-admin time -h
usage: compiler-admin time [-h] {convert} ...

positional arguments:
  {convert}   The time command to run.
    convert   Convert a time report from one format into another.

options:
  -h, --help  show this help message and exit

Converting an hours report

With a CSV exported from either Harvest or Toggl, use this command to convert to the opposite format:

$ compiler-admin time convert -h
usage: compiler-admin time convert [-h] [--input INPUT] [--output OUTPUT] [--client CLIENT]

options:
  -h, --help       show this help message and exit
  --input INPUT    The path to the source data for conversion. Defaults to stdin.
  --output OUTPUT  The path to the file where converted data should be written. Defaults to stdout.
  --client CLIENT  The name of the client to use in converted data.

Working with users

The following commands are available to work with users in the Compiler domain:

$ compiler-admin user -h
usage: compiler-admin user [-h] {create,convert,delete,offboard,reset-password,restore,signout} ...

positional arguments:
  {create,convert,delete,offboard,reset-password,restore,signout}
                        The user command to run.
    create              Create a new user in the Compiler domain.
    convert             Convert a user account to a new type.
    delete              Delete a user account.
    offboard            Offboard a user account.
    reset-password      Reset a user's password to a randomly generated string.
    restore             Restore an email backup from a prior offboarding.
    signout             Signs a user out from all active sessions.

options:
  -h, --help            show this help message and exit

Creating a user

$ compiler-admin user create -h
usage: compiler-admin user create [-h] [--notify NOTIFY] username

positional arguments:
  username         A Compiler user account name, sans domain.

options:
  -h, --help       show this help message and exit
  --notify NOTIFY  An email address to send the newly created account info.

Additional options are passed through to GAM, see more about GAM user create

Convert a user

$ compiler-admin user convert -h
usage: compiler-admin user convert [-h] username {contractor,partner,staff}

positional arguments:
  username              A Compiler user account name, sans domain.
  {contractor,partner,staff}
                        Target account type for this conversion.

options:
  -h, --help            show this help message and exit

Offboarding a user

$ compiler-admin user offboard -h
usage: compiler-admin user offboard [-h] [--alias ALIAS] [--force] username

positional arguments:
  username       A Compiler user account name, sans domain.

options:
  -h, --help     show this help message and exit
  --alias ALIAS  Account to assign username as an alias.
  --force        Don't ask for confirmation before offboarding.

This script creates a local backup of USER's inbox, see Restore

Restore an email backup

Retore a backup from a prior Offboarding into the [email protected] account.

$ compiler-admin user restore -h
usage: compiler-admin user restore [-h] username

positional arguments:
  username    The user's account name, sans domain.

options:
  -h, --help  show this help message and exit

compiler-admin's People

Contributors

dependabot[bot] avatar thekaveman avatar

Stargazers

 avatar

Watchers

 avatar  avatar

compiler-admin's Issues

Add Slack option for onboard command

Acceptance criteria

  • --slack or similar option should create a new user in Slack with a default set of channels
  • Based on --account-type, add user to more/different channels
  • Based on --account-type, add user to Slack group

Research

This may not be possible unless we upgrade to an Enterprise plan: https://api.slack.com/admins

The following list of features and APIs are available in Enterprise Grid workspaces only.

Add Slack removal to delete command

Check if the user to be deleted has a Slack account. If so, delete/deactivate the Slack account as well.

Will also cover the offboard command, since internally it uses delete.

GYB initialization should write to CONFIG_PATH

Otherwise the project setup will get lost between rebuilds of the devcontainer.

Store it in CONFIG_PATH, the same place we store the GAM project configuration, which is mapped to a local directory via a Docker Volume.

Create a Slack API service

Define a basic compiler_admin.services to connect to the Slack API. Credentials from environment variables?

Acceptance criteria

  • Get basic workspace info
  • Check if a user is a member of workspace

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.