Skip to content

Commit

Permalink
Fix race conditions and typos
Browse files Browse the repository at this point in the history
  • Loading branch information
ostefano committed Aug 25, 2024
1 parent d6c9bf2 commit 57ce60a
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 21 deletions.
8 changes: 4 additions & 4 deletions core/files/configure_misp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -419,24 +419,24 @@ echo "MISP | Update CA certificates ..." && update_ca_certificates

echo "MISP | Apply minimum configuration directives ..." && init_minimum_config

echo "MISP | Apply DB updates ..." && apply_updates

echo "MISP | Initialize configuration ..." && init_configuration

echo "MISP | Initialize workers ..." && init_workers

echo "MISP | Apply DB updates ..." && apply_updates

echo "MISP | Configure GPG key ..." && configure_gnupg

echo "MISP | Init default user and organization ..." && init_user

echo "MISP | Resolve critical issues ..." && apply_critical_fixes

echo "MISP | Update components ..." && update_components

echo "MISP | Resolve non-critical issues ..." && apply_optional_fixes

echo "MISP | Create sync servers ..." && create_sync_servers

echo "MISP | Update components ..." && update_components

echo "MISP | Set Up OIDC ..." && set_up_oidc

echo "MISP | Set Up LDAP ..." && set_up_ldap
Expand Down
2 changes: 1 addition & 1 deletion core/files/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT:-2048M}
export PHP_MAX_EXECUTION_TIME=${PHP_MAX_EXECUTION_TIME:-300}
export PHP_UPLOAD_MAX_FILESIZE=${PHP_UPLOAD_MAX_FILESIZE:-50M}
export PHP_POST_MAX_SIZE=${PHP_POST_MAX_SIZE:-50M}
export PHP_MAX_INPUT_TIME:${PHP_MAX_INPUT_TIME:-300}
export PHP_MAX_INPUT_TIME=${PHP_MAX_INPUT_TIME:-300}

# start supervisord using the main configuration file so we have a socket interface
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
8 changes: 7 additions & 1 deletion core/files/entrypoint_fpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ change_php_vars() {
for FILE in /etc/php/*/fpm/php.ini
do
[[ -e $FILE ]] || break
echo "Configure PHP | Setting 'memory_limit = ${PHP_MEMORY_LIMIT}'"
sed -i "s/memory_limit = .*/memory_limit = ${PHP_MEMORY_LIMIT}/" "$FILE"
echo "Configure PHP | Setting 'max_execution_time = ${PHP_MAX_EXECUTION_TIME}'"
sed -i "s/max_execution_time = .*/max_execution_time = ${PHP_MAX_EXECUTION_TIME}/" "$FILE"
echo "Configure PHP | Setting 'upload_max_filesize = ${PHP_UPLOAD_MAX_FILESIZE}'"
sed -i "s/upload_max_filesize = .*/upload_max_filesize = ${PHP_UPLOAD_MAX_FILESIZE}/" "$FILE"
echo "Configure PHP | Setting 'post_max_size = ${PHP_POST_MAX_SIZE}'"
sed -i "s/post_max_size = .*/post_max_size = ${PHP_POST_MAX_SIZE}/" "$FILE"
sed -i "s/max_input_time = .*/max_input_time = ${PHP_MAX_INPUT_TIME}|" "$FILE"
echo "Configure PHP | Setting 'max_input_time = ${PHP_MAX_INPUT_TIME}'"
sed -i "s/max_input_time = .*/max_input_time = ${PHP_MAX_INPUT_TIME}/" "$FILE"
sed -i "s/session.save_handler = .*/session.save_handler = redis/" "$FILE"
echo "Configure PHP | Setting 'session.save_path = '$(echo $REDIS_HOST | grep -E '^\w+://' || echo tcp://$REDIS_HOST):6379?auth=${REDIS_PASSWORD}'"
sed -i "s|.*session.save_path = .*|session.save_path = '$(echo $REDIS_HOST | grep -E '^\w+://' || echo tcp://$REDIS_HOST):6379?auth=${REDIS_PASSWORD}'|" "$FILE"
sed -i "s/session.sid_length = .*/session.sid_length = 64/" "$FILE"
sed -i "s/session.use_strict_mode = .*/session.use_strict_mode = 1/" "$FILE"
Expand Down
3 changes: 3 additions & 0 deletions core/files/entrypoint_nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -287,5 +287,8 @@ if [[ -x /custom/files/customize_misp.sh ]]; then
/custom/files/customize_misp.sh
fi

# Restart PHP workers
supervisorctl restart php-fpm

# Wait for it
wait "$master_pid"
6 changes: 0 additions & 6 deletions core/files/etc/misp-docker/initialisation.defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@
"MISP.event_alert_republish_ban_threshold": {
"default_value": 120
},
"Plugin.ZeroMQ_enable": {
"default_value": false
},
"Plugin.Enrichment_services_enable": {
"default_value": true
},
Expand All @@ -98,9 +95,6 @@
"Plugin.Cortex_services_enable": {
"default_value": false
},
"Plugin.Workflow_enable": {
"default_value": true
},
"Security.advanced_authkeys": {
"default_value": true
},
Expand Down
9 changes: 0 additions & 9 deletions core/files/etc/misp-docker/initialisation.envars.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@
"MISP.contact": {
"default_value": "${SETTING_CONTACT}"
},
"Plugin.ZeroMQ_redis_host": {
"default_value": "${REDIS_HOST}"
},
"Plugin.ZeroMQ_redis_port": {
"default_value": "${REDIS_PORT}"
},
"Plugin.ZeroMQ_redis_password": {
"default_value": "${REDIS_PASSWORD}"
},
"Plugin.Enrichment_services_url": {
"default_value": "${MISP_MODULES_FQDN}"
},
Expand Down
3 changes: 3 additions & 0 deletions core/files/etc/misp-docker/minimum_config.defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
"MISP.menu_custom_right_link_html": {
"default_value": ""
},
"Plugin.ZeroMQ_enable": {
"default_value": false
},
"Security.rest_client_enable_arbitrary_urls": {
"default_value": false
},
Expand Down
9 changes: 9 additions & 0 deletions core/files/etc/misp-docker/minimum_config.envars.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
"MISP.redis_password": {
"default_value": "${REDIS_PASSWORD}"
},
"Plugin.ZeroMQ_redis_host": {
"default_value": "${REDIS_HOST}"
},
"Plugin.ZeroMQ_redis_port": {
"default_value": "${REDIS_PORT}"
},
"Plugin.ZeroMQ_redis_password": {
"default_value": "${REDIS_PASSWORD}"
},
"GnuPG.binary": {
"default_value": "${GPG_BINARY}"
},
Expand Down
3 changes: 3 additions & 0 deletions core/files/etc/misp-docker/optional.defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@
},
"Plugin.Enrichment_hover_timeout": {
"default_value": 5
},
"Plugin.Workflow_enable": {
"default_value": true
}
}

0 comments on commit 57ce60a

Please sign in to comment.