From 003d4cd1d7d5683596d825890db059c5f6bc484e Mon Sep 17 00:00:00 2001 From: Jason Kendall Date: Fri, 6 Mar 2020 11:00:35 -0500 Subject: [PATCH] Add custom entrypoint closes #15 --- docker-compose.yml | 1 + examples/custom-entrypoint.sh | 4 ++++ server/files/entrypoint_nginx.sh | 10 +++++++--- 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100755 examples/custom-entrypoint.sh diff --git a/docker-compose.yml b/docker-compose.yml index b729c16..dc42183 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,6 +31,7 @@ services: - "./logs/:/var/www/MISP/app/tmp/logs/" - "./files/:/var/www/MISP/app/files" - "./ssl/:/etc/ssl/certs" +# - "./examples/custom-entrypoint.sh:/custom-entrypoint.sh" # Use the example custom-entrypoint.sh environment: - "CRON_USER_ID=1" - "REDIS_FQDN=redis" diff --git a/examples/custom-entrypoint.sh b/examples/custom-entrypoint.sh new file mode 100755 index 0000000..2ed8ef1 --- /dev/null +++ b/examples/custom-entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +echo Custom Entrypoint that runs just prior to nginx start + diff --git a/server/files/entrypoint_nginx.sh b/server/files/entrypoint_nginx.sh index b03f02a..2cd6ee2 100755 --- a/server/files/entrypoint_nginx.sh +++ b/server/files/entrypoint_nginx.sh @@ -106,9 +106,6 @@ echo "... chmod -R g+ws /var/www/MISP/app/tmp ..." && chmod -R g+ws /var/www/MIS echo "... chmod -R g+ws /var/www/MISP/app/files ..." && chmod -R g+ws /var/www/MISP/app/files echo "... chmod -R g+ws /var/www/MISP/app/files/scripts/tmp ..." && chmod -R g+ws /var/www/MISP/app/files/scripts/tmp -# delete pid file -[ -f $ENTRYPOINT_PID_FILE ] && rm $ENTRYPOINT_PID_FILE - # Work around https://github.com/MISP/MISP/issues/5608 if [[ ! -f /var/www/MISP/PyMISP/pymisp/data/describeTypes.json ]]; then mkdir -p /var/www/MISP/PyMISP/pymisp/data/ @@ -121,5 +118,12 @@ else ln -s /etc/nginx/sites-available/misp80 /etc/nginx/sites-enabled/misp80 fi +if [[ -x /custom-entrypoint.sh ]]; then + /custom-entrypoint.sh +fi + +# delete pid file +[ -f $ENTRYPOINT_PID_FILE ] && rm $ENTRYPOINT_PID_FILE + # Start NGINX nginx -g 'daemon off;'