mirror of https://github.com/MISP/misp-docker
Initial configuration to split configuration to containers
parent
654ac748f3
commit
b1dd1a81af
|
@ -68,5 +68,20 @@ export PHP_SESSION_COOKIE_SAMESITE=${PHP_SESSION_COOKIE_SAMESITE:-Lax}
|
||||||
export NGINX_X_FORWARDED_FOR=${NGINX_X_FORWARDED_FOR:-false}
|
export NGINX_X_FORWARDED_FOR=${NGINX_X_FORWARDED_FOR:-false}
|
||||||
export NGINX_SET_REAL_IP_FROM=${NGINX_SET_REAL_IP_FROM}
|
export NGINX_SET_REAL_IP_FROM=${NGINX_SET_REAL_IP_FROM}
|
||||||
|
|
||||||
|
if [ -n "$KUBERNETES_SERVICE_HOST" ]; then
|
||||||
|
case "$CONTAINER_NAME" in
|
||||||
|
nginx*)
|
||||||
|
exec /entrypoint_k8s_nginx.sh
|
||||||
|
;;
|
||||||
|
php*)
|
||||||
|
exec /entrypoint_k8s_fpm.sh
|
||||||
|
;;
|
||||||
|
cron*)
|
||||||
|
mv /etc/supervisor/conf.d/10-supervisor.conf{.k8s,}
|
||||||
|
exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
# start supervisord using the main configuration file so we have a socket interface
|
# start supervisord using the main configuration file so we have a socket interface
|
||||||
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|
||||||
|
fi
|
|
@ -60,6 +60,10 @@ change_php_vars() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [ -n "${BASH_SOURCE[0]}" ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Configure PHP | Change PHP values ..." && change_php_vars
|
echo "Configure PHP | Change PHP values ..." && change_php_vars
|
||||||
|
|
||||||
echo "Configure PHP | Starting PHP FPM"
|
echo "Configure PHP | Starting PHP FPM"
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source /entrypoint_nginx.sh
|
||||||
|
source /entrypoint_fpm.sh
|
||||||
|
|
||||||
|
# Initialize MySQL
|
||||||
|
echo "INIT | Initialize MySQL ..." && init_mysql
|
||||||
|
|
||||||
|
# Initialize MISP
|
||||||
|
echo "INIT | Initialize MISP files and configurations ..." && init_misp_data_files
|
||||||
|
echo "INIT | Update MISP app/files directory ..." && update_misp_data_files
|
||||||
|
echo "INIT | Enforce MISP permissions ..." && enforce_misp_data_permissions
|
||||||
|
echo "INIT | Flip NGINX live ..." && flip_nginx true true
|
||||||
|
|
||||||
|
# Run configure MISP script
|
||||||
|
echo "INIT | Configure MISP installation ..."
|
||||||
|
/configure_misp.sh
|
||||||
|
|
||||||
|
if [[ -x /custom/files/customize_misp.sh ]]; then
|
||||||
|
echo "INIT | Customize MISP installation ..."
|
||||||
|
/custom/files/customize_misp.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Configure PHP | Change PHP values ..." && change_php_vars
|
||||||
|
|
||||||
|
echo "Configure PHP | Starting PHP FPM"
|
||||||
|
exec /usr/sbin/php-fpm8.2 -R -F
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source /entrypoint_nginx.sh
|
||||||
|
|
||||||
|
# Initialize nginx
|
||||||
|
echo "INIT | Initialize NGINX ..." && init_nginx
|
||||||
|
|
||||||
|
# launch nginx as current shell process in container
|
||||||
|
exec nginx -g 'daemon off;'
|
||||||
|
|
|
@ -210,7 +210,7 @@ flip_nginx() {
|
||||||
echo "... nginx docroot set to ${NGINX_DOC_ROOT}"
|
echo "... nginx docroot set to ${NGINX_DOC_ROOT}"
|
||||||
sed -i "s|root.*var/www.*|root ${NGINX_DOC_ROOT};|" /etc/nginx/includes/misp
|
sed -i "s|root.*var/www.*|root ${NGINX_DOC_ROOT};|" /etc/nginx/includes/misp
|
||||||
|
|
||||||
if [[ "$reload" = "true" ]]; then
|
if [[ "$reload" = "true" ]] && [[ -z "$KUBERNETES_SERVICE_HOST" ]]; then
|
||||||
echo "... nginx reloaded"
|
echo "... nginx reloaded"
|
||||||
nginx -s reload
|
nginx -s reload
|
||||||
fi
|
fi
|
||||||
|
@ -352,6 +352,9 @@ init_nginx() {
|
||||||
flip_nginx false false
|
flip_nginx false false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [ -n "${BASH_SOURCE[0]}" ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
# Initialize MySQL
|
# Initialize MySQL
|
||||||
echo "INIT | Initialize MySQL ..." && init_mysql
|
echo "INIT | Initialize MySQL ..." && init_mysql
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
[supervisord]
|
||||||
|
nodaemon=true
|
||||||
|
user=root
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
|
||||||
|
[inet_http_server]
|
||||||
|
port=127.0.0.1:9001
|
||||||
|
username=supervisor
|
||||||
|
password=supervisor
|
||||||
|
|
||||||
|
[program:cron]
|
||||||
|
command=/entrypoint_cron.sh
|
||||||
|
autorestart=true
|
||||||
|
redirect_stderr=true
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
Loading…
Reference in New Issue