From 3773870ae36d0cc3e2825795a6383443394d2115 Mon Sep 17 00:00:00 2001 From: Jason Kendall Date: Thu, 28 May 2020 19:49:27 -0400 Subject: [PATCH] Ensure upstream files are synced to virtual mount - closes 52 --- server/Dockerfile | 1 + server/files/entrypoint_nginx.sh | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/server/Dockerfile b/server/Dockerfile index 5a05e1c..4d8a4a4 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -78,6 +78,7 @@ ARG PHP_VER ssdeep \ libfuzzy2 \ mariadb-client \ + rsync \ # Python Requirements python3 \ python3-setuptools \ diff --git a/server/files/entrypoint_nginx.sh b/server/files/entrypoint_nginx.sh index 64ddab0..5f8cd16 100755 --- a/server/files/entrypoint_nginx.sh +++ b/server/files/entrypoint_nginx.sh @@ -88,6 +88,9 @@ init_mysql(){ } 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 } # Things we should do when we have the INITIALIZE Env Flag @@ -103,6 +106,8 @@ echo "Configure Cake | Change Redis host to $REDIS_FQDN ... " && setup_cake_conf # Things we should do if we're configuring MISP via ENV echo "Configure MISP | Initialize misp base config..." && init_misp_config +echo "Configure MISP | Sync app files..." && sync_files + echo "Configure MISP | Enforce permissions ..." echo "... chown -R www-data.www-data /var/www/MISP ..." && find /var/www/MISP -not -user www-data -exec chown www-data.www-data {} + echo "... chmod -R 0750 /var/www/MISP ..." && find /var/www/MISP -perm 550 -type f -exec chmod 0550 {} + && find /var/www/MISP -perm 770 -type d -exec chmod 0770 {} +