Headless chatbot that detects spam and posts it to chatrooms. Uses ChatExchange, takes questions from the Stack Exchange realtime tab, and accesses answers via the Stack Exchange API.
To set up SmokeDetector, please use
git clone https://github.com/Charcoal-SE/SmokeDetector.git cd SmokeDetector git checkout deploy sudo pip3 install -r requirements.txt --upgrade pip3 install --user -r user_requirements.txt --upgrade
config.sample to a new file called
and edit the values required.
To run, use
(preferably in a daemon-able mode, like a
You can also use
but then SmokeDetector will be shut down after 6 hours;
when running from
nocrash.py, it will be restarted.
(This is to be sure that closed websockets, if any, are reopened.)
Virtual environment setup
Running in a virtual environment
is a good way to isolate dependency packages from your local system.
To set up SmokeDetector in a virtual environment, you can use
git clone https://github.com/Charcoal-SE/SmokeDetector.git cd SmokeDetector git config user.email "[email protected]" git config user.name "SmokeDetector" git checkout deploy python3 -m venv env env/bin/pip3 install -r requirements.txt --upgrade env/bin/pip3 install --user -r user_requirements.txt --upgrade
Next, copy the config file and edit as said above.
To run SmokeDetector in this virtual environment, use
[Note: On some systems (e.g. Mac's and Linux), some circumstances may
--user option be removed from the last
command line in the above instructions. However, the
--user option is
known to be necessary in other circumstances. Further testing is
necessary to resolve the discrepancy.]
Running in a Docker container
is an even better way to isolate dependency packages from your local system.
To set up SmokeDetector in a Docker container, follow the steps below.
- Grab the Dockerfile and build an image of SmokeDetector:
DATE=$(date +%F) mkdir temp cd temp wget https://raw.githubusercontent.com/Charcoal-SE/SmokeDetector/master/Dockerfile docker build -t smokey:$DATE .
- Create a container from the image you just built
docker create --name=mysmokedetector smokedetector:$DATE
- Start the container.
Don't worry, SmokeDetector won't run until it's ready,
so you have the chance to edit the configuration file before SmokeDetector runs.
config.sample to a new file named
and edit the values required,
then copy the file into the container with this command:
docker cp config mysmokedetector:/home/smokey/SmokeDetector/config
- If you would like to set up additional stuff (SSH, Git etc.),
you can do so with a Bash shell in the container:
docker exec -it mysmokedetector bash
After you're ready, put a file named
Automate Docker deployment with Docker Compose
I'll assume you have the basic ideas of Docker and Docker Compose.
The first thing you need is a properly filled
You can start with the sample.
Create a directory (name it whatever you like),
config file and
docker-compose up -d and your SmokeDetector instance is up.
If you want additional control like memory and CPU constraint,
you can edit
docker-compose.yml and add the following keys to
The example values are recommended values.
restart: always # when your host reboots Smokey can autostart mem_limit: 512M cpus: 0.5 # Recommend 2.0 or more for spam waves
SmokeDetector only supports Stack Exchange logins,
and runs on Python 3.6 or higher,
To allow committing blacklist and watchlist modifications
back to GitHub,
your system also needs Git 1.8 or higher,
although we recommend Git 2.11+.