Skip to content

Commit

Permalink
docs: Reformat README
Browse files Browse the repository at this point in the history
  • Loading branch information
yarkhinephyo committed Apr 21, 2021
1 parent 12d6ec0 commit 8758f8c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
34 changes: 20 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
# serverless-freshping-telegram
Serverless solution for freshping-telegram integration. Creates a telegram bot that notifies a group when the server status changes (Available/ Not Responding) that is hosted with AWS Lambda.

### Working Telegram Bot
1. Add @esm_wonderful_bot to the telegram group
2. Get group chat ID by adding @getidsbot
3. Go to Freshping > Setting > Integrations > Webhook
serverless-freshping-telegram
======
![GitHub](https://img.shields.io/github/license/yarkhinephyo/serverless-freshping-telegram?style=flat-square)

Serverless solution for freshping-telegram integration. Creates a telegram bot that notifies a group when the server status changes (Available/ Not Responding) that is hosted with AWS Lambda.

### Integrate In Four Steps
1. Add `@esm_wonderful_bot` to the telegram group
2. Add `@getidsbot` to the telegram group to get group chat ID
3. Go to Freshping Dashboard > Setting > Integrations > Webhook
4. Paste `https://irrb74more.execute-api.ap-southeast-1.amazonaws.com/dev/{chat_id}`
(Example: If group chat ID is -100123456, paste `https://irrb74more.execute-api.ap-southeast-1.amazonaws.com/dev/-100123456`)

### Custom Deployment
Example: If group chat ID is -100123456, paste
`https://irrb74more.execute-api.ap-southeast-1.amazonaws.com/dev/-100123456`

<hr/>

### Custom Setup

1. Ensure you have a [Freshping account](https://www.freshworks.com/website-monitoring/)
2. [Create a Telegram Bot](https://core.telegram.org/bots#6-botfather) with @BotFather and save the bot token
2. [Create a Telegram Bot](https://core.telegram.org/bots#6-botfather) with @BotFather and save the bot token
3. Ensure [AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) are set up on your computer for Serverless to work
4. Clone this repo: `git clone https://github.com/yarkhinephyo/serverless-freshping-telegram.git`
5. Install Dependencies: `npm i`
6. Deploy the webhook: `sls deploy --botToken <Telegram bot token>`
(URL will look like: https://xxxxxxxxxx.execute-api.ap-southeast-1.amazonaws.com/dev/{chat_id})
7. Add webhook URL on Freshping
Freshping > Setting > Integrations > Webhook
Paste the URL while replacing {chat_id} with telegram group's chat id
6. Deploy the webhook and receive a URL: `sls deploy --botToken <Telegram bot token>`
7. Refer to the integration guide above
8 changes: 1 addition & 7 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,8 @@ functions:
plugins:
- serverless-plugin-typescript
- serverless-api-gateway-throttling
# - serverless-domain-manager

custom:
apiGatewayThrottling:
maxRequestsPerSecond: 30
maxConcurrentRequests: 5
# customDomain:
# basePath: "freshping"
# domainName: ""
# certificateArn: ""
# createRoute53Record: true
maxConcurrentRequests: 5

0 comments on commit 8758f8c

Please sign in to comment.