Skip to content

DominicTWHV/Cockatoo_Edge

Repository files navigation

Cockatoo Edge

A Dynamic Discord Moderation Platform

Important

Work in progress — NOT production ready. Waiting for readme revision

CodeQL GHCR Build Python Tests

Deployment Options:

GHCR Docker Image (GHCR is ONLY available for x86_64 architecture. Use Local Build - Docker for other architectures.)

Local Build - Docker

Local Build - Bare Metal (Linux)

Local Build - Bare Metal (Windows)

Deployment - GHCR Image:

Docker:

We provide a ghcr.io image that automatically updates once there is a stable push on the main branch (currently only available for x86_64 arch).

Install dependencies:

sudo apt update
sudo apt install docker.io screen -y

sudo usermod aG docker $USER #optional, add current user to docker group
exit #you need to start a new shell session for changes to take effect

Pull the image

docker pull ghcr.io/dominictwhv/cockatoo-edge:latest

Environment setup

#create a standalone dir for this project
mkdir -p cockatoo-edge
cd cockatoo-edge

#change the placeholder for your actual bot token. Do NOT fork this repository and commit this token into the .env file.
echo 'TOKEN=<your token here>' >> .env

Running

screen -dmS cockatoo docker run --env-file .env ghcr.io/dominictwhv/cockatoo-edge

Updating the image

Stop the container

screen -r cockatoo

Then press ctrl + c once and wait for the bot to terminate

Pull the update from GHCR

docker pull ghcr.io/dominictwhv/cockatoo-edge:latest

And then restart the container.

Deployment - Local Build:

Docker (Recommended):

Install dependencies:

sudo apt update
sudo apt install docker.io screen -y

sudo usermod aG docker $USER #optional, add current user to docker group
exit #you need to start a new shell session for changes to take effect

Clone the repository

git clone https://github.com/DominicTWHV/Cockatoo_Edge.git
cd Cockatoo_Edge

Edit the environment variables

cp example.env .env
nano .env

Insert your Discord bot token into the .env file, then use ctrl+o ctrl+x to save and quit.

Next, configure settings, they are located within Cockatoo_Edge/edge/registry with a .py suffix. This step is optional, default settings will work fine out of the box.

Use the provided Docker build script to automate the build process

./setup_docker.sh -b -t -c

Run the bot in a screen session

Optionally, put this line into a bash file and use crontab to automatically start the bot upon reboot.

screen -dmS cockatoo docker run cockatoo_edge:latest

Bare Metal (Linux):

Clone the repository

git clone https://github.com/DominicTWHV/Cockatoo_Edge.git
cd Cockatoo_Edge

We provide a streamlined bare metal deployment script

./setup_raw.sh

Next, edit your .env file to include the bot token

nano .env

Finally, use a screen session to run the bot:

screen -dmS cockatoo python3 main.py

Bare Metal (Windows):

Install Python 3.12.x or above from https://www.python.org/downloads/

Clone the repository (with Git CLI)

git clone https://github.com/DominicTWHV/Cockatoo_Edge.git

Navigate to the folder, copy the example.env file and rename it to .env in the same folder.

Edit the file, insert your bot token into the file.

Install dependencies

python -m venv venv
venv/Scripts/activate
pip install -r requirements.txt

Run the bot with

python main.py

Changing settings

For prebuilt Docker containers:

Attach the image to your console, then directly modify the values under /app/edge/registry. After, apply the changes by committing it into a new image.

For all other deployment methods:

Modify the files under edge/registry. After, either rebuild the Docker image, or just restart the app.


How it works

Cockatoo Edge consumes a public database published by Cockatoo Core (a proprietary, real-time ML-powered component of the Cockatoo family) to identify and mitigate known threats.

The Edge deployment minimizes computational overhead and improves reaction times by handling decisions locally.


Contributing

Issues

  • Search for existing reports before opening a new issue.
  • Ensure the problem is reproducible and not caused by bad configuration.
  • Include steps to reproduce, expected vs. actual behavior, and any relevant logs or screenshots.

Pull requests

  • Explain the goal of the change and reference any related issues.

About

A Dynamic Discord Moderation Platform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages