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.
The supportbot uses GitHub Actions Docker and DockerHub for CI/CD. The GitHub Actions workflow file describes the process.
docker build . -t supportbot
docker run --name nycmesh-support-bot --rm -v "$PWD/.env:/app/.env" supportbot
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!
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Distributed under the MIT License. See the LICENSE
file for more information.
Project Link: https://github.com/nycmeshnet/nycmesh-support-bot