Sign inSign up

ulope/gcal-push-proxy

By ulope

•Updated over 9 years ago

gcal-push-proxy

Image
0

1.0K

ulope/gcal-push-proxy repository overview

⁠=============== GCal Push Proxy

Google calendar doesn't natively support "real" webhooks. It can only send a notification that a change has happened which can then be used to fetch the changes.

This project acts as a simple proxy that emulates the regular webhook behaviour of sending payload data along with the notification.

⁠Python Requirements

Python >= 3.6, sorry :)

.. include:: requirements/base.in :literal:

⁠Google setup process

This is basically taken from the Google calendar push notification documentation_ with some additions learned by painful trial and error

#. Verify ownership of the target domain (i.e. where this service will be running) in the Google search console. #. Register the target domain in the Google API console (create a project first if you don't have one yet) #. Create oAuth 2.0 client credentials in the Google API console (credentials tab)_

  • Click on "Create credentials"
  • Choose "oAuth client ID"
  • Select "Web application"
  • Give a name
  • Enter https://<your-domain.name.here>/authorize/2/ in the Authorized redirect URIs field
  • Note the Client ID and Client secret

.. _Google search console: https://www.google.com/webmasters/tools/home?hl=de⁠ .. _Google calendar push notification documentation: https://developers.google.com/google-apps/calendar/v3/push⁠ .. _Google API console: https://console.developers.google.com/apis/credentials/domainverification⁠ .. _Google API console (credentials tab): https://console.developers.google.com/apis/credentials⁠

⁠Running

⁠Using docker

The following environment variables are needed:

  • CLIENT_ID - Google oAuth client id (see above)
  • CLIENT_SECRET - Google oAuth client secret (see above)
  • DOMAIN - Fully qualified domain name the app will be running on
  • SECRET_KEY - Djano SECRET_KEY; can be any string, recommended length: 50 characters

Optional:

  • EXTERNAL_PORT - external port the docker container is bound to, defaults to 8000

The easiest way to set those is to put them in the .env file which will automatically be picked up by docker-compose.

Steps:

#. Clone repo #. Run docker-compose build #. Ensure env variables are set (see above) #. Run docker-compose up -d #. Ensure docker-compose ps shows web, worker, scheduler and redis as Up #. Try connecting to http://localhost:8000_ in your browser #. Setup forwading proxy

Tag summary

Content type

Image

Digest

Size

296.6 MB

Last updated

over 9 years ago

docker pull ulope/gcal-push-proxy