Skip to content

This repo defines the Telegram Bot for the Big Brother project

Notifications You must be signed in to change notification settings

labbsr0x/bb-bot

Repository files navigation

Big Brother Bot

A repository to define a Telegram Bot for handling alerts emitted by a Big Brother installation

How to Run locally

  1. Talk to Telegram's Bot Father, create your own bot and get it's Telegram Token;

  2. Open a Dialogflow account, create a new project and import the configs from the folder bot/dialogflow;

  3. Setup a Telegram integration on Dialogflow with the Token obtained in step 1;

  4. Send messages to your bot on telegram and then train your intents on Dialogflow website;

  5. Expose your port 3000 and inform a reachable HTTPS address to the Dialogflow fulfillment configuration. We recommend using ngrok for that;

  6. Type the following commands in your terminal to interact with your bot directly through Telegram:

    TELEGRAM_TOKEN=<XXXXX:YYYYYY> docker-compose up -d --build

    This will run an example app with its own bb-promster cluster and the Big Brother app with its components.

  7. Now go to the bot on Telegram, and add a new App. Inform the App name (e.g. Example) and the app address (e.g. example-bb-promster:9090). You'll be automatically subscribed to the app you've just added.

The example client app bb-promster cluster will get registered to the Big Brother's ETCD and Big Brother will then start collecting metrics by federating it.

Also, access http://localhost:3000/test on your browser to dispatch test alerts and see if you get them at your Telegram chat.

Basic Auth

It's possible to configure a basic auth to provide security to the API:

  1. Set the environment variable BASIC_AUTH_USERNAME with the value of the desired username
  2. Set the environment variable BASIC_AUTH_PASSWORD with the value of the desired password

Now, to complete an API request is necessary to have a basic auth with valid credentials. If these environment variables weren't set, the authentication is not required.

Big Brother

This is part of a more large application called Big Brother.