The PromptConf Code of Conduct Hotline
Python 3.6+ as well as a Twilio number
This hotline reuses the setup from the PyCascades Code of Conduct hotline created by @mariatta and @cache-rules; two amazing Pythonistas that are truly committed to building a safe and inclusive environment in all of tech. You all rock, thanks for making this hotline so easy to setup!
Directions below are taken from their project README.
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.
You'll need to get Twilio voice number and configure your voice number to use this hotline. Specifically you will need to setup the Webhook for receiving inbound calls and a Webhook for receiving inbound SMS messages.
- 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.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
You can either deploy your service and use the AWS Lambda link zappa deploy
returns to you. Or you can use ngrok - a
Go powered tool that lets you open a local port up to the internet. As the below shows, after install ngrok you can
exeucte it ./ngrok http [port_number]
to generate a public URL that points to your local port. You can use these
URLs e.g. http://3dae1196.ngrok.io/inbound
for your voice and messaging Webhooks.
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]
- Take the AWS Lambda link from
zappa deploy
and configure in your Twilio voice number.
Contact me at me@lorenamesa.com! Or see the [original project]((https://github.com/cache-rules/coc-hotline).