nycmeshnet / nycmesh-support-bot

Slack chatbot to automate on-demand diagnostics collection for NYC Mesh equipment
MIT License
6 stars 2 forks source link

NYC Mesh Support Bot

Contributors Forks Stargazers Issues MIT License

Slack chatbot to help with NYC Mesh support requests

GIF showing usage of supportbot in NYC Mesh Slack

Usage

Use the included CLI to run the server like so:

supportbot-server

The server connects to the Slack API via websockets, bypassing the need for a public IP / port.

Getting Started

Installation

To install the supportbot-server command, do the following:

git clone https://github.com/andybaumgar/nycmesh-support-bot.git
cd nycmesh-support-bot/

A virtual environment is optional but recommended:

python3 -m venv venv
source venv/bin/activate

Finally, install this package with

pip install -e .

Prerequisites

You'll need python and pip to install this client. Confirm these are available with:

python3 --version
python3 -m pip --version

If not, install them using the appropriate instructions for your OS here

Credentials

The bot needs Slack API credentials to operate. They are supplied in the .env file.

You can obtain credentials for a Slack workspace by creating a socket-mode app following these instructions.

Usage

> supportbot-server
Starting bolt app...
Bolt app is running!

CLI Arguments

The supportbot-server command is configurable via a few CLI arguments. Use supportbot-server --help to learn more about the available options.

Autoreload (Linux and Mac)

Deploy Process

The supportbot uses GitHub Actions Docker and DockerHub for CI/CD. The GitHub Actions workflow file describes the process.

Running with Docker

Testing with Docker

Dockerhub

Dockerhub is used as an image registry to store our built code before deployment.

Secrets

Secrets are stored in GitHub Secrets, and locally in a .env file. In production a script is used to convert the GitHub Secrets to .env.

GitHub Actions/Runner setup

Github Actions Self Hosted Runner setup description

Starting and Stopping the Runner

An extra command is used to setup the runner as a service:

cd /home/supportbot/actions-runner
sudo ./svc.sh start

Built With

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See the LICENSE file for more information.

Contact

Project Link: https://github.com/nycmeshnet/nycmesh-support-bot

Acknowledgments