From 54cb3f268d1cbc1e59ad3b6a7243ded2856834f4 Mon Sep 17 00:00:00 2001 From: Garrit Schroeder Date: Mon, 22 Feb 2021 13:12:21 +0100 Subject: [PATCH 1/5] Fix docker volume persistent for directory of custom org images --- .gitignore | 4 +++- docker-compose.yml | 2 ++ server/Dockerfile | 2 ++ server/files/entrypoint_nginx.sh | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 07c7cdd..a709ef8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ /logs/ /files/ /ssl/ -/server-configs/ \ No newline at end of file +/server-configs/ +/org_img/ +/custom_img/ \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 659aad2..45b2f0a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,6 +35,8 @@ services: - "./logs/:/var/www/MISP/app/tmp/logs/" - "./files/:/var/www/MISP/app/files" - "./ssl/:/etc/nginx/certs" + - "./org_img/:/var/www/MISP/app/webroot/img/orgs" + - "./custom_img/: /var/www/MISP/app/webroot/img/custom" # - "./examples/custom-entrypoint.sh:/custom-entrypoint.sh" # Use the example custom-entrypoint.sh environment: - "HOSTNAME=https://localhost" diff --git a/server/Dockerfile b/server/Dockerfile index 3c1aa07..a56f507 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -151,6 +151,8 @@ ARG PHP_VER # Make a copy of the file store, so we can sync from it RUN cp -R /var/www/MISP/app/files /var/www/MISP/app/files.dist + RUN cp -R /var/www/MISP/app/webroot/img/orgs /var/www/MISP/app/webroot/img/orgs.dist + # Make a copy of the configurations, so we can sync from it RUN cp -R /var/www/MISP/app/Config /var/www/MISP/app/Config.dist diff --git a/server/files/entrypoint_nginx.sh b/server/files/entrypoint_nginx.sh index 6bb0495..826b259 100755 --- a/server/files/entrypoint_nginx.sh +++ b/server/files/entrypoint_nginx.sh @@ -104,6 +104,7 @@ sync_files(){ for DIR in $(ls /var/www/MISP/app/files.dist); do rsync -azh --delete "/var/www/MISP/app/files.dist/$DIR" "/var/www/MISP/app/files/" done + rsync -azh --delete /var/www/MISP/app/webroot/img/orgs.dist/* /var/www/MISP/app/webroot/img/orgs } # Ensure SSL certs are where we expect them, for backward comparibility See issue #53 From d07e32af6d195ade83f8f18d81b750b581d5a2eb Mon Sep 17 00:00:00 2001 From: Garrit Schroeder Date: Mon, 22 Feb 2021 13:36:40 +0100 Subject: [PATCH 2/5] Fix docker volume persistent for directory of custom org images --- server/files/entrypoint_nginx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/files/entrypoint_nginx.sh b/server/files/entrypoint_nginx.sh index 826b259..d38b629 100755 --- a/server/files/entrypoint_nginx.sh +++ b/server/files/entrypoint_nginx.sh @@ -104,7 +104,7 @@ sync_files(){ for DIR in $(ls /var/www/MISP/app/files.dist); do rsync -azh --delete "/var/www/MISP/app/files.dist/$DIR" "/var/www/MISP/app/files/" done - rsync -azh --delete /var/www/MISP/app/webroot/img/orgs.dist/* /var/www/MISP/app/webroot/img/orgs + rsync -azh --delete "/var/www/MISP/app/webroot/img/orgs.dist/*" "/var/www/MISP/app/webroot/img/orgs" } # Ensure SSL certs are where we expect them, for backward comparibility See issue #53 From 51c3be16dd1e25b06debe225f69016b7e68be807 Mon Sep 17 00:00:00 2001 From: Garrit Schroeder Date: Mon, 22 Feb 2021 14:03:41 +0100 Subject: [PATCH 3/5] Fix docker volume persistent for directory of custom org images --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 45b2f0a..e2eb4c3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -36,7 +36,7 @@ services: - "./files/:/var/www/MISP/app/files" - "./ssl/:/etc/nginx/certs" - "./org_img/:/var/www/MISP/app/webroot/img/orgs" - - "./custom_img/: /var/www/MISP/app/webroot/img/custom" + - "./custom_img/:/var/www/MISP/app/webroot/img/custom" # - "./examples/custom-entrypoint.sh:/custom-entrypoint.sh" # Use the example custom-entrypoint.sh environment: - "HOSTNAME=https://localhost" From 21ed4de6b91a463c16a9ab262ff1323f4dc4380f Mon Sep 17 00:00:00 2001 From: Garrit Schroeder Date: Mon, 22 Feb 2021 14:07:37 +0100 Subject: [PATCH 4/5] Fix docker volume persistent for directory of custom org images --- server/files/entrypoint_nginx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/files/entrypoint_nginx.sh b/server/files/entrypoint_nginx.sh index d38b629..174cf6b 100755 --- a/server/files/entrypoint_nginx.sh +++ b/server/files/entrypoint_nginx.sh @@ -104,7 +104,7 @@ sync_files(){ for DIR in $(ls /var/www/MISP/app/files.dist); do rsync -azh --delete "/var/www/MISP/app/files.dist/$DIR" "/var/www/MISP/app/files/" done - rsync -azh --delete "/var/www/MISP/app/webroot/img/orgs.dist/*" "/var/www/MISP/app/webroot/img/orgs" + rsync -azh --delete "/var/www/MISP/app/webroot/img/orgs.dist/" "/var/www/MISP/app/webroot/img/orgs" } # Ensure SSL certs are where we expect them, for backward comparibility See issue #53 From b34184db834ad35538f72f10ef3ea2db7200182a Mon Sep 17 00:00:00 2001 From: Garrit Schroeder Date: Fri, 26 Feb 2021 23:10:44 +0100 Subject: [PATCH 5/5] remove deleting flag of rsync --- server/files/entrypoint_nginx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/files/entrypoint_nginx.sh b/server/files/entrypoint_nginx.sh index 174cf6b..43c7080 100755 --- a/server/files/entrypoint_nginx.sh +++ b/server/files/entrypoint_nginx.sh @@ -104,7 +104,7 @@ sync_files(){ for DIR in $(ls /var/www/MISP/app/files.dist); do rsync -azh --delete "/var/www/MISP/app/files.dist/$DIR" "/var/www/MISP/app/files/" done - rsync -azh --delete "/var/www/MISP/app/webroot/img/orgs.dist/" "/var/www/MISP/app/webroot/img/orgs" + rsync -azh "/var/www/MISP/app/webroot/img/orgs.dist/" "/var/www/MISP/app/webroot/img/orgs" } # Ensure SSL certs are where we expect them, for backward comparibility See issue #53