diff --git a/DEVELOP-GUIDE.md b/DEVELOP-GUIDE.md index 994ba90..262f494 100644 --- a/DEVELOP-GUIDE.md +++ b/DEVELOP-GUIDE.md @@ -12,13 +12,6 @@ sudo apt update && sudo apt upgrade -y && sudo apt install docker.io git docker- ``` git clone https://github.com/certat/intelmq-docker.git --recursive cd intelmq-docker -docker-compose -f docker-compose-dev.yml build -``` - -### In next step replace git@github.com:certtools/intelmq.git by your fork of intelmq - -``` -git clone git@github.com:certtools/intelmq.git my_fork_of_intelmq/ docker-compose -f docker-compose-dev.yml up ``` @@ -28,21 +21,36 @@ docker-compose -f docker-compose-dev.yml up ## Docker-compose-dev.yml file +Docker dev shares almost all volumes and environment variables from intelmq-full image. But some are new: + ### Volumes: -- **./my_bots:/my_bots** -> this is the folder where your bots source code need to be. +- **./example_bots:/my_bots** -> this is the folder where your bots source code need to be. ### Environment - #Folder where you clone your repository + +* Two variables to indicate where the source code of your bots is located: + + #Volume in the container where you clone your repository MY_FORK: "/my_bots" - #Folder in your repo where bots are located + #Subfolder in MY_FORK where your where bots are located MY_BOTS_FOLDER: "bots" +* Another thing, you could make your bots to be running when container startup, just setting + ENABLE_BOTNET_AT_BOOT: "true"* + ### Add your own bots -Just start coding or pull your bots repository in ./my_bots by default in a subfolder bots, so you need for example my_bots/bots/[collectors,parsers,experts,output,parsers] +Just start coding or pull your bots repository in some folder like ./my_bots in a subfolder bots, so you need for example my_bots/bots/[collectors,parsers,experts,output,parsers] + +You could take a look at the folder and files in https://github.com/certtools/intelmq/tree/develop/intelmq/bots to start. + +``` +git clone https://github.com/AAAAA/BBBB.git my_bots +``` + +After doing this, you need to change in docker-compose-dev.yml the volume definition from **./example_bots:/my_bots** to **./my_bots:/my_bots** -You could take a look at the folder and files in https://github.com/certtools/intelmq/tree/develop/intelmq/bots ### How to install and look yours bots running @@ -54,8 +62,8 @@ docker-compose exec -f docker-compose-dev.yml intelmq sudo bash /opt/install_req When you do this: -* Yours bots REQUERIMENTS.txt and the bots will be installed -* Another thing, you could make your bots to be running when container startup, just setting ENABLE_BOTNET_AT_BOOT: "true" +* Yours bots REQUERIMENTS.txt and yout bots will be installed or updated from **MY_FORK** + ## Dependencies problems diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index f6361af..f1131cb 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -25,7 +25,7 @@ services: - ./example_config/intelmq-api/config.json:/etc/intelmq/api-config.json - ./intelmq_logs:/opt/intelmq/var/log - ./intelmq_output:/opt/intelmq/var/lib/bots - - ./my_bots:/my_bots + - ./mybots:/my_bots depends_on: - redis environment: diff --git a/mybots/BOTS b/example_bots/BOTS similarity index 100% rename from mybots/BOTS rename to example_bots/BOTS diff --git a/mybots/bots/collectors/otherexample/collector.py b/example_bots/bots/collectors/otherexample/collector.py similarity index 100% rename from mybots/bots/collectors/otherexample/collector.py rename to example_bots/bots/collectors/otherexample/collector.py diff --git a/mybots/bots/experts/example/expert.py b/example_bots/bots/experts/example/expert.py similarity index 100% rename from mybots/bots/experts/example/expert.py rename to example_bots/bots/experts/example/expert.py