Slack chatbot to help with NYC Mesh support requests
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.
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 .
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
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.
> supportbot-server
Starting bolt app...
Bolt app is running!
find . -name \*.py -print | entr -r supportbot-server
The supportbot-server
command is configurable via a few CLI arguments. Use
supportbot-server --help
to learn more about the available options.
- install entr
The supportbot uses GitHub Actions Docker and DockerHub for CI/CD. The GitHub Actions workflow file describes the process.
- install Docker Desktop
- start Docker Desktop
- clone the repo and open a shell in the root folder
- ensure you have a .env file with all required credentials
- if you are running on Windows change the bin/nn_stats.sh carriage return back to LF (cloning on Windows will set it to CRLF, but this will not work in the Linux container)
- run the following commands:
docker build . -t supportbot
docker run --name nycmesh-support-bot --rm -v "$PWD/.env:/app/.env" supportbot
- follow the directions above for running
- run the following commands:
docker build . -t supportbot
docker run -v "$PWD/.env:/app/.env" --rm nycmesh-support-bot-test pytest
Dockerhub is used as an image registry to store our built code before deployment.
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 Self Hosted Runner setup description
An extra command is used to setup the runner as a service:
cd /home/supportbot/actions-runner
sudo ./svc.sh start
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!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See the LICENSE
file for more information.
- Andrew Dickinson - [email protected]
- Andy Baumgar - [email protected]
- Daniel Heredia - [email protected]
- Marg Suarez - [email protected]
Project Link: https://github.com/nycmeshnet/nycmesh-support-bot