Skip to content

liatrio-apprenticeship/Blog-Buddy-Rational-Yaks

Repository files navigation

Blog Buddy - A Hello DevOps Project

Blog Buddy- or BB for short- is a slackbot that filters through and lists Liatrio's blogs based on specified criteria.

  • Blog buddy uses SQLite as its database to store blog data and allows filtering by author, title, and summary.
  • Blog buddy can also list all available blogs and suggest random blogs.

Local Development

If you don't already have a Slack app for testing/development create a new one

  1. Goto api.slack.com/apps.
  2. Add an App Name like YOUR_NAME-bot.
  3. Select a Development Slack Workspace you want to test the bot in.
  4. Press the Create App button.

Run bot locally and expose port

  1. Clone project git clone https://github.com/liatrio-apprenticeship/Blog-Buddy-Rational-Yaks.git
  2. Start ngrok ngrok http 3000
  3. Edit .env file and add the CLIENT_SIGNING_SECRET, BOT_TOKEN from the Slack app you create and set PORT to 3000. Also add botHostname and set it equal to the hostname generated by ngrok, https://NGROK_HOST
  4. Start docker containers docker-compose up --build

Configure the follow Slack app features settings under each menu item

  1. Bot User: Set display name and default username and Save Changes
  2. OAuth & permission: Add a redirect URL which points to the ngrok forward https://NGROK_HOST/oauth
  3. Event Subscriptions: Enable events, Set Request URL to ngrok forward https://NGROK_HOST/slack/receive and subscribe to bot events for message.channels, message.groups, message.im, message.mpim.

Connect bot to Slack

  1. Goto https://NGROK_HOST/ and follow instructions to add bot to Slack.

Troubleshooting

This bot was developed in a Mac environment. If you are working in a Windows or Linux environment, you may receive docker issues when running "docker-compose up" in regards to the bot_vol/npm_scripts.sh file.

For Windows:

1. Install Notepad++

2. Import npm_scripts.sh

3. Edit -> EOL Conversion -> Unix (LF)

4. Save

For Linux:

1. Install dos2unix ( sudo apt-get install -y dos2unix )

2. Nagivate to project root directory and run "dos2unix bot_vol/npm_script.sh"

About

A slackbot that helps filter through Liatrio's blogs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •