|
1 |
| -# Google Admin |
| 1 | +# Compiler Admin |
2 | 2 |
|
3 |
| -Administrative tasks in Compiler's Google Workspace. |
| 3 | +Automating Compiler's administrative tasks. |
4 | 4 |
|
5 | 5 | Built on top of [GAMADV-XTD3](https://github.com/taers232c/GAMADV-XTD3) and [GYB](https://github.com/GAM-team/got-your-back).
|
6 | 6 |
|
7 |
| -## Initial setup |
| 7 | +**Note:** This tool can only be used by those with administrator access to Compiler's Google Workspace. |
8 | 8 |
|
9 |
| -Initial setup of a GAMADV-XTD3 project is required to provide necessary API access to the Google Workspace. |
| 9 | +## Usage |
10 | 10 |
|
11 |
| -Follow the steps in the [GAMADV-XTD3 Wiki](https://github.com/taers232c/GAMADV-XTD3/wiki/#requirements), and read |
12 |
| -[Compiler's setup notes](https://docs.google.com/document/d/1UEwQzJZyJEkRs3PRwOi0-KXwBFne70am4Nk9-_qYItE/edit#heading=h.gbmx14gcpp2a) |
13 |
| -for more information. |
| 11 | +```bash |
| 12 | +$ compiler-admin -h |
| 13 | +usage: compiler-admin [-h] [-v] {info,init,create,convert,delete,offboard,restore,signout} ... |
| 14 | + |
| 15 | +positional arguments: |
| 16 | + {info,init,create,convert,delete,offboard,restore,signout} |
| 17 | + info Print configuration and debugging information. |
| 18 | + init Initialize a new admin project. This command should be run once before any others. |
| 19 | + create Create a new user in the Compiler domain. |
| 20 | + convert Convert a user account to a new type. |
| 21 | + delete Delete a user account. |
| 22 | + offboard Offboard a user account. |
| 23 | + restore Restore an email backup from a prior offboarding. |
| 24 | + signout Signs a user out from all active sessions. |
| 25 | + |
| 26 | +options: |
| 27 | + -h, --help show this help message and exit |
| 28 | + -v, --version show program's version number and exit |
| 29 | +``` |
14 | 30 |
|
15 |
| -Additionally, GYB is used for Gmail backup/restore. See the [GYB Wiki](https://github.com/GAM-team/got-your-back/wiki) |
16 |
| -for more information. |
| 31 | +## Getting started |
17 | 32 |
|
18 |
| -**Note:** This setup can only be performed by those with administrator access to Compiler's Google Workspace. |
| 33 | +```bash |
| 34 | +git clone https://github.com/compilerla/compiler-admin.git |
19 | 35 |
|
20 |
| -## Creating a user |
| 36 | +cd compiler-admin |
| 37 | +``` |
| 38 | +
|
| 39 | +Now open in VS Code, and when prompted, reopen in the devcontainer. |
21 | 40 |
|
22 |
| -**Usage:** |
| 41 | +## Initial setup |
| 42 | +
|
| 43 | +Initial setup of a GAMADV-XTD3 project and GYB project is required to provide necessary API access to the Google Workspace. |
23 | 44 |
|
24 | 45 | ```bash
|
25 |
| -bin/create.sh USER [OPTIONS] |
| 46 | +$ compiler-admin init -h |
| 47 | +usage: compiler-admin init [-h] username |
| 48 | +
|
| 49 | +positional arguments: |
| 50 | + username The user's account name, sans domain. |
| 51 | + |
| 52 | +options: |
| 53 | + -h, --help show this help message and exit |
26 | 54 | ```
|
27 | 55 |
|
28 |
| -- `USER` is the username (sans domain) to create |
29 |
| -- `OPTIONS` is a list of options for [GAM user create](https://github.com/taers232c/GAMADV-XTD3/wiki/Users#create-a-user) |
| 56 | +The `init` commands follows the steps in the [GAMADV-XTD3 Wiki](https://github.com/taers232c/GAMADV-XTD3/wiki/#requirements). |
30 | 57 |
|
31 |
| -## Convert a user |
| 58 | +Additionally, GYB is used for Gmail backup/restore. See the [GYB Wiki](https://github.com/GAM-team/got-your-back/wiki) for more information. |
32 | 59 |
|
33 |
| -**Usage:** |
| 60 | +## Creating a user |
34 | 61 |
|
35 | 62 | ```bash
|
36 |
| -bin/convert.sh USER TYPE |
| 63 | +$ compiler-admin create -h |
| 64 | +usage: compiler-admin create [-h] username [OPTIONS] |
| 65 | + |
| 66 | +positional arguments: |
| 67 | + username The user's account name, sans domain. |
| 68 | +
|
| 69 | +options: |
| 70 | + -h, --help show this help message and exit |
37 | 71 | ```
|
38 | 72 |
|
39 |
| -- `USER` is the username (sans domain) to convert |
40 |
| -- `TYPE` is either `STAFF` to convert the user to a staff member, or `PARTNER` to conver the user to a partner. |
| 73 | +Additional options are passed through to GAM, see more about [GAM user create](https://github.com/taers232c/GAMADV-XTD3/wiki/Users#create-a-user) |
41 | 74 |
|
42 |
| -## Offboarding a user |
| 75 | +## Convert a user |
| 76 | +
|
| 77 | +```bash |
| 78 | +$ compiler-admin convert -h |
| 79 | +usage: compiler-admin convert [-h] username {contractor,partner,staff} |
| 80 | +
|
| 81 | +positional arguments: |
| 82 | + username A Compiler user account name, sans domain. |
| 83 | + {contractor,partner,staff} |
| 84 | + Target account type for this conversion. |
| 85 | +
|
| 86 | +options: |
| 87 | + -h, --help show this help message and exit |
| 88 | +``` |
43 | 89 |
|
44 |
| -**Usage:** |
| 90 | +## Offboarding a user |
45 | 91 |
|
46 | 92 | ```bash
|
47 |
| -bin/offboard.sh USER [ALIAS] |
| 93 | +$ compiler-admin offboard -h |
| 94 | +usage: compiler-admin offboard [-h] [--alias ALIAS] username |
| 95 | +
|
| 96 | +positional arguments: |
| 97 | + username A Compiler user account name, sans domain. |
| 98 | +
|
| 99 | +options: |
| 100 | + -h, --help show this help message and exit |
| 101 | + --alias ALIAS Account to assign username as an alias. |
48 | 102 | ```
|
49 | 103 |
|
50 |
| -- `USER` is the username (sans domain) to offboard |
51 |
| -- `ALIAS` is optional, and is a username (sans domain) that will get an alias |
52 |
| - added for the offboarded `USER` |
| 104 | +This script creates a local backup of `USER`'s inbox, see [Restore](#restore-an-email-backup) |
53 | 105 |
|
54 |
| -Read more about the [offboarding process in Compiler's notes](https://docs.google.com/document/d/1UEwQzJZyJEkRs3PRwOi0-KXwBFne70am4Nk9-_qYItE/edit#heading=h.liqi1hwxykhs). |
| 106 | +## Restore an email backup |
55 | 107 |
|
56 |
| -This script creates a local backup of `USER`'s inbox; a separate script can be run to archive this backup into the `[email protected]` account : |
| 108 | +Retore a backup from a prior [Offboarding](#offboarding-a-user) into the `[email protected]` account. |
57 | 109 |
|
58 | 110 | ```bash
|
59 |
| -bin/archive-gmail-backup.sh USER |
60 |
| -``` |
| 111 | +$ compiler-admin restore -h |
| 112 | +usage: compiler-admin restore [-h] username |
| 113 | +
|
| 114 | +positional arguments: |
| 115 | + username The user's account name, sans domain. |
61 | 116 |
|
62 |
| -- `USER` is the account in compiler.la (sans domain) with a local backup to archive |
| 117 | +options: |
| 118 | + -h, --help show this help message and exit |
| 119 | +``` |
0 commit comments