From c6b4f0ef1ec8447da3dea2e4f998608360db0613 Mon Sep 17 00:00:00 2001 From: Einar Lanfranco Date: Fri, 18 Nov 2022 16:00:09 -0300 Subject: [PATCH] Fixing some more paths, and something in install_reqs_and_deploy_bots --- .docker/intelmq-full-dev/Dockerfile | 35 +++++++++++-------- .../install_reqs_and_deploy_bots | 5 +-- docker-compose-dev.yml | 4 +-- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/.docker/intelmq-full-dev/Dockerfile b/.docker/intelmq-full-dev/Dockerfile index fe0f83b..05a40bc 100644 --- a/.docker/intelmq-full-dev/Dockerfile +++ b/.docker/intelmq-full-dev/Dockerfile @@ -1,18 +1,25 @@ -FROM certat/intelmq-full:1.0 +FROM certat/intelmq-full:latest +ENV LANG C.UTF-8 -ADD entrypoint_dev.sh /opt/dev/entrypoint_dev.sh -ADD update.sh /opt/dev/update.sh -ADD merge_BOTS.py /opt/dev/merge_BOTS.py +LABEL maintainer="Einar " +LABEL maintainer="Jeremias " +LABEL maintainer="Mateo " +RUN sudo apt-get update \ + && sudo apt-get install -y --no-install-recommends \ + git \ + vim \ + ssh \ + && sudo rm -rf /var/lib/apt/lists/* -# Merge bots for merge_BOTS.py -RUN sudo python3 -m pip install jsonmerge +WORKDIR /opt +ADD entrypoint-dev.sh /opt/entrypoint-dev.sh +ADD install_reqs_and_deploy_bots /opt/install_reqs_and_deploy_bots.sh +RUN sudo chmod +x /opt/entrypoint-dev.sh \ + && sudo chown intelmq:intelmq /opt/entrypoint-dev.sh +RUN sudo chmod +x /opt/install_reqs_and_deploy_bots.sh \ + && sudo chown intelmq:intelmq /opt/install_reqs_and_deploy_bots.sh +RUN usermod -aG intelmq www-data -USER intelmq:intelmq - -# Permission denied when installing new bots -RUN sudo chown -R intelmq:intelmq /opt/intelmq/intelmq.egg-info - -ENV PATH="/opt/intelmq/.local/bin:${PATH}" - -ENTRYPOINT ["/opt/dev/entrypoint_dev.sh"] +USER intelmq +ENTRYPOINT [ "/opt/entrypoint-dev.sh" ] \ No newline at end of file diff --git a/.docker/intelmq-full-dev/install_reqs_and_deploy_bots b/.docker/intelmq-full-dev/install_reqs_and_deploy_bots index 6006121..6ba799c 100755 --- a/.docker/intelmq-full-dev/install_reqs_and_deploy_bots +++ b/.docker/intelmq-full-dev/install_reqs_and_deploy_bots @@ -1,12 +1,13 @@ #!/bin/bash -sudo cp -r $MY_FORK/$MY_BOTS_FOLDER/* /etc/intelmq/intelmq/bots/ +sudo cp -r $MY_FORK/$MY_BOTS_FOLDER/* /opt/intelmq/intelmq/bots/ sudo rm -f /tmp/orderfullrequirements.txt /tmp/fullrequirements.txt for req in $(find $MY_FORK/$MY_BOTS_FOLDER -name "*REQUIREMENTS.txt"); do cat $req >> /tmp/fullrequirements.txt + echo "" >> /tmp/fullrequirements.txt done cat /tmp/fullrequirements.txt | sort | uniq > /tmp/orderfullrequirements.txt sudo pip3 install -r /tmp/orderfullrequirements.txt; -cd /etc/intelmq +cd /opt/intelmq sudo pip3 install --no-cache-dir -e . sudo intelmqsetup diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index 038bad1..f6361af 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -22,7 +22,7 @@ services: image: certunlp/intelmq3-full-dev:latest volumes: - ./example_config/intelmq/etc/:/opt/intelmq/etc/ - - ./example_config/intelmq-api/config.json:/opt/intelmq/api-config.json + - ./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 @@ -38,7 +38,7 @@ services: INTELMQ_SOURCE_PIPELINE_HOST: redis INTELMQ_DESTINATION_PIPELINE_HOST: redis INTELMQ_REDIS_CACHE_HOST: redis - MY_FORK: "/my_bots" + MY_FORK: "/my_bots/" MY_BOTS_FOLDER: "bots" networks: - intelmq-internal