mooyoul / google-sites-slack-notification

Receive Slack notification when Google Sites has updated.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

google-sites-slack-notification

serverless

demo

Receive Slack notification when Google Sites has updated.

This service also supports Service Account, including G Suite domain-wide authority delegation to access private site.

Limitation

Currently this service only supports Classic Google Sites, since Google Sites Data API does not support rebuilt Google Site.

See also: Google Developers - Google Sites API

Configuration

Please refer src/config.ts.

Deploying service

There's two kinds of service deployment type.

Serverless deployment (Preferred)

NOTE

  • Currently Serverless deployment only supports AWS Lambda environment.
  • Serverless deployment only supports DynamoDB state store.
  • Preconfigured sync interval is 5 minutes. you can change this by editing cron expression on serverless.yml

Serverless deployment is preferred since this method does not require additional service management.

$ git clone https://github.com/mooyoul/google-sites-slack-notification
$ cd google-sites-slack-notification
$ vi src/config.ts # Setup target Google site and DynamoDB Store
$ npm run dynamodb:migrate
$ npm run deploy:prod 

That's it!

old-fashioned deployment

$ git clone https://github.com/mooyoul/google-sites-slack-notification
$ cd google-sites-slack-notification
$ vi src/config.ts # Setup target Google site and Store (FileStore or DynamoDB)
$ npm start # Execute sync task to test configuration 

If sync task was successfully done, add sync task to crontab:

$ crontab -e

and add rule:

0/5 * * * * cd PROJECT_ROOT && flock -xn /tmp/.google-sites-sync.lock -c npm start

License

MIT

See full license on mooyoul.mit-license.org

About

Receive Slack notification when Google Sites has updated.

License:MIT License


Languages

Language:TypeScript 100.0%