Imports contact info from google on an hourly cron schedule
- docker
- docker-compose
nice -19 docker-compose up -d --no-build
To test the script logic with worrying about cronjobs.
Set entrypoint: pipenv run python -u import.py
in the docker-compose file (or equivalent)
Run pipenv install
to setup
pipenv run python import.py
For local development, these should be stored in a .env file
- USER_EMAIL The email address of the google account to fetch contacts from
- GROUP The resourceName of the contact group in the about account to fetch contacts from (usually in the form
contactGroups/<alphanumeric_code>
) - CLIENT_EMAIL The Email Address for a Google IAM Service Account, which has
https://www.googleapis.com/auth/contacts
scope delegated to it - PRIVATE_KEY The Corresponding Private Key for the same Service Account
- LUCOS_CONTACTS The base url for a running instance of lucos_contacts. Defaults to the production url
- LUCOS_CONTACTS_API_KEY A valid api key for LUCOS_CONTACTS. Keys can be created manually through the admin UI at
/admin/lucosauth/apiuser/add/
. Set the system field tolucos_contacts_googlesync_import
.
Dockerfile
,Pipfile
,Pipfile.lock
and the.cirleci
directory are used at build timecron.sh
ensures the cron daemon is running with the right environment set up and sharing its logs in a way that get surfaced to Dockerimport.py
Imports from Google's People API to lucos_contacts