Gratibot is based off of HowdyAI's Botkit framework. We appreciate all the hard work they have done to give us this framework to extend.
If you don't already have a Slack app for testing/development create a new one
- Goto api.slack.com/apps.
- Add an App Name like YOUR_NAME-bot.
- Select a Development Slack Workspace you want to test the bot in.
- Press the
Create App
button.
Run bot locally and expose port
- Clone project
git clone https://github.com/liatrio/gratibot.git
- Start ngrok
ngrok http 3000
- Edit .env file and add the
clientId
,clientSecret
from the Slack app you create and setPORT
to 3000. Also addbotHostname
and set it equal to the hostname generated by ngrok, https://NGROK_HOST - Start docker containers
docker-compose up --build
Configure the follow Slack app features settings under each menu item
- Bot User: Set display name and default username and Save Changes
- OAuth & permission: Add a redirect URL which points to the ngrok forward
https://NGROK_HOST/oauth
- Event Subscriptions: Enable events, Set Request URL to ngrok forward
https://NGROK_HOST/slack/receive
and subscribe to bot events formessage.channels
,message.groups
,message.im
,message.mpim
.
Connect bot to Slack
- Goto https://NGROK_HOST/ and follow instructions to add bot to Slack.
The infrastructure code cannot be set up without the appropriate security pieces in place include:
- KMS key for the parameters
- Parameter store set up for slack credentials (clientId, clientSecret, clientSigningSecret)
- IAM Role to allow ECS task to utilize the parameters and key
This can be done manually or via the infra_admin
Terraform configuration. This must be run by someone with the ability to create roles, keys, and parameters.
For more information on the AWS Requirements check out The ECS Docs
Jenkins needs the AWS Credentials Plugin installed and configured with AWS-SVC-Jenkins-non-prod-dev
and AWS-SVC-Jenkins-prod-dev