https://github.com/ww24/calendar-notifier
Google Calendar Notifier 📅
https://github.com/ww24/calendar-notifier
cloud-pubsub google-calendar
Last synced: 4 months ago
JSON representation
Google Calendar Notifier 📅
- Host: GitHub
- URL: https://github.com/ww24/calendar-notifier
- Owner: ww24
- License: mit
- Created: 2020-01-26T17:24:22.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-15T08:25:54.000Z (almost 3 years ago)
- Last Synced: 2026-01-12T02:40:00.027Z (6 months ago)
- Topics: cloud-pubsub, google-calendar
- Language: Go
- Homepage:
- Size: 453 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
calendar-notifier
===
[![Go Reference][go-dev-img]][go-dev-url]
![test-and-build][github-actions-img]
Calendar Notifier provides event handler and actions triggered by Google Calendar.
[![dockeri.co][dockeri-img]][dockeri-url]
## Features
- Events
- [x] [Calendar Events List API](https://developers.google.com/calendar/v3/reference/events/list)
- [ ] [Calendar Events Watch API](https://developers.google.com/calendar/v3/reference/events/watch)
- Actions
- [x] HTTP Action
- [x] [Cloud Pub/Sub](https://cloud.google.com/pubsub/) Action
- [x] [Cloud Tasks](https://cloud.google.com/tasks/) Action
## Setup
- Create GCP Project
- https://cloud.google.com/resource-manager/docs/creating-managing-projects
- Create GCP Service Account
- Role assignment is not required if it does not use pubsub action.
- https://cloud.google.com/iam/docs/creating-managing-service-accounts
- Share Google Calendar with service account
- Use service account e-mail address. (e.g. `my-service-account@project-id.iam.gserviceaccount.com`)
- https://support.google.com/calendar/answer/37082
- Set `SERVICE_ACCOUNT` environment. Use base64 encoded GCP Service Account JSON.
- `echo "SERVICE_ACCOUNT=$(base64 < service_account.json)" > .env`
- Edit `config.sample.yml` and save as `config.yml`.
- Set `CONFIG` environment. Use base64 encoded config.yml.
- `echo "CONFIG=$(base64 < config.yml)" > .env`
## Usage
### Use docker-compose
- Run `docker-compose up`
### Use docker
- Run `docker build -t calendar-notifier .`
- Run `docker run -e SERVICE_ACCOUNT=$(base64 < service_account.json) -e CONFIG=$(base64 < config.yml) calendar-notifier`
## Permission
### Cloud Tasks
If use Cloud Tasks Action, service account should have the following permissions.
```
cloudtasks.tasks.list
cloudtasks.tasks.create
cloudtasks.tasks.delete
iam.serviceAccounts.actAs
```
For example, give your service account the following roles.
```
roles/cloudtasks.viewer
roles/cloudtasks.enqueuer
roles/cloudtasks.taskDeleter
roles/iam.serviceAccountUser
```
#### References
- https://cloud.google.com/tasks/docs/reference-access-control
- https://cloud.google.com/iam/docs/understanding-service-accounts?hl=ja#sa_common
### Cloud Pub/Sub
If use Cloud Pub/Sub Action, service account should have the following permissions.
```
pubsub.topics.publish
```
For example, give your service account the following roles.
```
roles/pubsub.publisher
```
#### References
- https://cloud.google.com/pubsub/docs/access-control
[github-actions-img]: https://github.com/ww24/calendar-notifier/workflows/Test%20on%20master/badge.svg?branch=master
[dockeri-img]: https://dockeri.co/image/ww24/calendar-notifier
[dockeri-url]: https://hub.docker.com/r/ww24/calendar-notifier
[go-dev-img]: https://pkg.go.dev/badge/github.com/ww24/calendar-notifier.svg
[go-dev-url]: https://pkg.go.dev/github.com/ww24/calendar-notifier