diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c60ddb13..abcd7459 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,13 +12,13 @@ defaults: working-directory: src env: - BUILD_PYTHON_VERSION: "3.9.6" - MIN_PYTHON_VERSION: "3.9.6" + BUILD_PYTHON_VERSION: "3.9.7" + MIN_PYTHON_VERSION: "3.9.7" BUILD_OPENSSL_VERSION: "1.1.1l" - MIN_OPENSSL_VERSION: "1.1.1k" + MIN_OPENSSL_VERSION: "1.1.1l" PATCHELF_VERSION: "0.12" # PYINSTALLER_VERSION can be full commit hash or version like v4.20 - PYINSTALLER_VERSION: "bcb824c1ad2989855a5fc01d95e5fc693b2f0966" + PYINSTALLER_VERSION: "5a02f55c696f16b98f23a8b487f3daa8f644a8d2" jobs: build: @@ -97,7 +97,7 @@ jobs: path: | ~/python ~/ssl - key: ${{ matrix.os }}-${{ matrix.jid }}-20210628 + key: ${{ matrix.os }}-${{ matrix.jid }}-20210910 - name: Set env variables env: @@ -166,6 +166,7 @@ jobs: echo "pip=$pip" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV echo -e "Python: $python\nPip: $pip\nLD_LIB...: $LD_LIBRARY_PATH" + $pip install --upgrade pip $pip install wheel export url="https://codeload.github.com/pyinstaller/pyinstaller/tar.gz/${PYINSTALLER_VERSION}" echo "Downloading ${url}" @@ -184,7 +185,8 @@ jobs: $python ./waf all $TARGETARCH cd .. fi - $python setup.py install + $pip install . + #$python setup.py install #$pip install pyinstaller - name: Install pip requirements diff --git a/README.md b/README.md index 1117a2d4..efc4bdaa 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,46 @@ GAM is a command line tool for Google Workspace (fka G Suite) Administrators to manage domain and user settings quickly and easily. ![Build Status](https://github.com/jay0lee/GAM/workflows/Build%20and%20test%20GAM/badge.svg) + # Quick Start + ## Linux / MacOS + Open a terminal and run: -``` + +```sh bash <(curl -s -S -L https://git.io/install-gam) ``` + this will download GAM, install it and start setup. + +To install with `pip`, run + +```sh +pip install git+https://github.com/jay0lee/GAM.git#subdirectory=src +``` + +This will only download and install GAM. To start setup, simply invoke the `gam` CLI. + ## Windows + Download the MSI Installer from the [GitHub Releases] page. Install the MSI and you'll be prompted to setup GAM. + # Documentation + The GAM documentation is hosted in the [GitHub Wiki] + # Mailing List / Discussion group + The GAM mailing list / discussion group is hosted on [Google Groups]. You can join the list and interact via email, or just post from the web itself. + # Chat Room + There is a public chat room hosted in Google Chat. [Instructions to join](https://git.io/gam-chat). + # Author -GAM is maintained by Jay Lee. Please direct "how do I?" questions to [Google Groups]. + +GAM is maintained by [Jay Lee](mailto:jay0lee@gmail.com). Please direct "how do I?" questions to [Google Groups]. [GAM release]: https://git.io/gamreleases [GitHub Releases]: https://github.com/jay0lee/GAM/releases diff --git a/src/GamCommands.txt b/src/GamCommands.txt index 682eb2d3..d8a5cdc2 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -720,6 +720,7 @@ Specify a collection of Users by directly specifying them or by specifiying item (customfootertext )| (customreplyto )| (defaultmessagedenynotificationtext )| + (defaultsender default_self|group)| (description )| (enablecollaborativeinbox|collaborative )| (includeinglobaladdresslist|gal )| diff --git a/src/gam/gapi/chromepolicy.py b/src/gam/gapi/chromepolicy.py index 7876ef87..2acd0938 100644 --- a/src/gam/gapi/chromepolicy.py +++ b/src/gam/gapi/chromepolicy.py @@ -86,6 +86,7 @@ def printshow_policies(): for namespace in namespaces: spacing = ' ' body['policySchemaFilter'] = f'{namespace}.*' + body['pageToken'] = None try: policies = gapi.get_all_pages(svc.customers().policies(), 'resolve', items='resolvedPolicies', diff --git a/src/gam/gapi/directory/groups.py b/src/gam/gapi/directory/groups.py index 735c11e8..138c5b4c 100644 --- a/src/gam/gapi/directory/groups.py +++ b/src/gam/gapi/directory/groups.py @@ -266,6 +266,8 @@ GROUP_ATTRIBUTES_ARGUMENT_TO_PROPERTY_MAP = { 'customReplyTo', 'defaultmessagedenynotificationtext': 'defaultMessageDenyNotificationText', + 'defaultsender': + 'defaultSender', 'enablecollaborativeinbox': 'enableCollaborativeInbox', 'favoriterepliesontop': @@ -979,6 +981,9 @@ def update(): sys.stderr.write( f'Group: {group}, Will add {len(to_add)} and remove {len(to_remove)} {role}s.\n' ) + for user in to_remove: + items.append( + ['gam', 'update', 'group', group, 'remove', user]) for user in to_add: item = ['gam', 'update', 'group', group, 'add'] if role: @@ -987,9 +992,6 @@ def update(): item.append(delivery) item.append(user) items.append(item) - for user in to_remove: - items.append( - ['gam', 'update', 'group', group, 'remove', user]) elif myarg in ['delete', 'remove']: _, users_email, _ = _getRoleAndUsers() if not exists(cd, group): @@ -1219,7 +1221,7 @@ def getGroupAttrValue(myarg, value, gs_object, gs_body, function): params) in list(gs_object['schemas']['Groups']['properties'].items()): if attrib in ['kind', 'etag', 'email']: continue - if myarg == attrib.lower(): + if myarg == attrib.lower().replace('_', ''): if params['type'] == 'integer': try: if value[-1:].upper() == 'M': diff --git a/src/gam/var.py b/src/gam/var.py index 951e85db..a565d2e6 100644 --- a/src/gam/var.py +++ b/src/gam/var.py @@ -8,7 +8,7 @@ import platform import re GAM_AUTHOR = 'Jay Lee ' -GAM_VERSION = '6.07' +GAM_VERSION = '6.08' GAM_LICENSE = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)' GAM_URL = 'https://git.io/gam' @@ -1110,7 +1110,8 @@ GROUP_SETTINGS_LIST_ATTRIBUTES = set([ 'whoCanUnmarkFavoriteReplyOnAnyTopic', 'whoCanViewGroup', 'whoCanViewMembership', - # Miscellaneous hoices + # Miscellaneous choices + 'default_sender', 'messageModerationLevel', 'replyTo', 'spamModerationLevel', diff --git a/src/setup.cfg b/src/setup.cfg index a6f5f8e9..bedd5d8a 100644 --- a/src/setup.cfg +++ b/src/setup.cfg @@ -8,7 +8,7 @@ url = https://github.com/jay0lee/GAM author = Jay Lee author_email = jay0lee@gmail.com license = Apache -license_file = src/license.rtf +license_files = LICENSE keywords = google, oauth2, gsuite, google-apps, google-admin-sdk, google-drive, google-cloud, google-calendar, gam, google-api, oauth2-client, google-workspace classifiers = Programming Language :: Python :: 3