The PyCascades Code of Conduct Hotline
Python 3.6+ because F strings are the best strings.
When the hotline is called, it will ring the phones listed in the COC_NUMBERS
env variable.
The caller will be connected to the first person who responds.
At PyCascades, it will also post to a private slack channel so we have a record of who called, who answered, how long was the call, and when.
It is easier to share one consistent phone number to call, as opposed to listing various phone numbers. We can repurpose the same number year after year, and have the flexibility to add/remove people who will answer the call.
- Create and activate a virtual environment.
- Run
pip install -r requirements.txt
to install the dependencies - (Optional) Add the "Incoming Webhooks" integration to your slack team of choice
- Follow the configuration instructions and write down your WebHook URL
- Set the following environment variables:
COC_NUMBERS
: A comma separated list of phone numbers prefixed with+
, numbers should include country code. Optionally add a;Name
to each number to show the name of the responder rather than their number in logs.COC_HTTP_SCHEME
: eitherhttp
orhttps
, we recommend deploying with AWS Lambda which will provide https for you.COC_SLACK_URL
: (Optional) The WebHook URL provided by the Incoming Webhooks Slack integration.
- Run
python coc-hotline.py
This tool was built to be run on AWS Lambda, but could easily be adapted to run anywhere you can run Python 3.6+. To deploy to AWS Lambda follow the below instructions:
- Create an AWS account and configure your AWS credentials file.
- Create and activate a virtual environment.
- Run
pip install -r requirements.txt
- Run
zappa init
- Answer all of the questions asked.
- Add an
environment_variables
attribute to your zappa config and fill out the environment variables listed in the installation instructions above. - Run
zappa deploy [your environment name here]