All Projects → Charcoal-SE → Smokedetector

Charcoal-SE / Smokedetector

Licence: other
Headless chatbot that detects spam and posts links to it to chatrooms for quick deletion.

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Smokedetector

Anymatch
‼️ Matches strings against configurable strings, globs, regular expressions, and/or functions
Stars: ✭ 289 (-23.95%)
Mutual labels:  regex
Regex
The Hoa\Regex library.
Stars: ✭ 308 (-18.95%)
Mutual labels:  regex
Artificial Adversary
🗣️ Tool to generate adversarial text examples and test machine learning models against them
Stars: ✭ 348 (-8.42%)
Mutual labels:  spam
Recaptcha
PHP client library for reCAPTCHA, a free service to protect your website from spam and abuse.
Stars: ✭ 3,149 (+728.68%)
Mutual labels:  spam
Bilibili Block List
基于正则表达式的Bilibili弹幕屏蔽规则
Stars: ✭ 304 (-20%)
Mutual labels:  regex
Generex
A Java library for generating String from a regular expression.
Stars: ✭ 316 (-16.84%)
Mutual labels:  regex
Kawaiideauther
Jam all wifi clients/routers.
Stars: ✭ 284 (-25.26%)
Mutual labels:  spam
Recog
Pattern recognition for hosts, services, and content
Stars: ✭ 360 (-5.26%)
Mutual labels:  regex
Regex
Regular expressions for swift
Stars: ✭ 306 (-19.47%)
Mutual labels:  regex
Fd
A simple, fast and user-friendly alternative to 'find'
Stars: ✭ 19,851 (+5123.95%)
Mutual labels:  regex
Attributedstring
基于Swift插值方式优雅的构建富文本, 支持点击长按事件, 支持不同类型过滤, 支持自定义视图等.
Stars: ✭ 294 (-22.63%)
Mutual labels:  regex
Hyperscan
High-performance regular expression matching library
Stars: ✭ 3,427 (+801.84%)
Mutual labels:  regex
Ictextview
UITextView subclass supporting string/regex search and highlighting
Stars: ✭ 321 (-15.53%)
Mutual labels:  regex
Idiosyncratic Ruby.com
Documenting All Ruby Specialities 💎︎
Stars: ✭ 292 (-23.16%)
Mutual labels:  regex
Expynent
A library that provides regular expression patterns. If you hate to write regular expressions, then expynent can help you.
Stars: ✭ 350 (-7.89%)
Mutual labels:  regex
Url Regex
Regular expression for matching URLs
Stars: ✭ 286 (-24.74%)
Mutual labels:  regex
Cursive re
Readable regular expressions for Python 3.6 and up.
Stars: ✭ 311 (-18.16%)
Mutual labels:  regex
Netease Music Cracker
🎵 将可下载的网易云音乐的缓存文件转换为 MP3 文件
Stars: ✭ 373 (-1.84%)
Mutual labels:  regex
Minta
✳️  Electron app for generating regular expressions
Stars: ✭ 353 (-7.11%)
Mutual labels:  regex
Social Media Profiles Regexs
📇 Extract social media profiles and more with regular expressions
Stars: ✭ 324 (-14.74%)
Mutual labels:  regex

SmokeDetector

Build Status Circle CI Coverage Status Open issues Open PRs

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.

Example chat post:

Example chat post

Documentation

User documentation is in the wiki.

Detailed documentation for setting up and running SmokeDetector is in the wiki.

Basic setup

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

Next, copy config.sample to a new file called config, and edit the values required.

To run, use python3 nocrash.py (preferably in a daemon-able mode, like a screen session.) You can also use python3 ws.py, 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 env/bin/python3 nocrash.py.

[Note: On some systems (e.g. Mac's and Linux), some circumstances may require the --user option be removed from the last pip3 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.]

Docker setup

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.

  1. 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 .
  1. Create a container from the image you just built
docker create --name=mysmokedetector smokedetector:$DATE
  1. 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.

Copy config.sample to a new file named config and edit the values required, then copy the file into the container with this command:

docker cp config mysmokedetector:/home/smokey/SmokeDetector/config
  1. 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 ready under /home/smokey:

touch ~smokey/ready

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 config file. You can start with the sample.

Create a directory (name it whatever you like), place the config file and docker-compose.yml file. Run 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 smokey. 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

Requirements

SmokeDetector only supports Stack Exchange logins, and runs on Python 3.5 or higher, for now.

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+.

License

Licensed under either of

at your option.

Contribution Licensing

By submitting your contribution for inclusion in the work as defined in the Apache-2.0 license, you agree that it be dual licensed as above, without any additional terms or conditions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].