From 073d61182556b009762952665aac3a7006b03bc1 Mon Sep 17 00:00:00 2001 From: Paal Braathen Date: Tue, 9 Nov 2021 19:26:10 +0100 Subject: [PATCH 1/2] Add optional PHP_TIMEZONE env variable --- docker-compose.yml | 1 + server/files/entrypoint_fpm.sh | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 5af92b7..a18bd93 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -51,6 +51,7 @@ services: # - "NOREDIR=true" # Do not redirect port 80 # - "DISIPV6=true" # Disable IPV6 in nginx # - "CERTAUTH=optional" # Can be set to optional or on - Step 2 of https://github.com/MISP/MISP/tree/2.4/app/Plugin/CertAuth is still required +# - "PHP_TIMEZONE=Europe/Oslo" # Set timezone in PHP FPM https://www.php.net/manual/en/timezones.php # - "SECURESSL=true" # Enable higher security SSL in nginx # - "MISP_MODULES_FQDN=http://misp-modules" # Set the MISP Modules FQDN, used for Enrichment_services_url/Import_services_url/Export_services_url # - "WORKERS=1" #If set to a value larger than 1 this will increase the number of parallel worker processes diff --git a/server/files/entrypoint_fpm.sh b/server/files/entrypoint_fpm.sh index 825624b..53d8170 100755 --- a/server/files/entrypoint_fpm.sh +++ b/server/files/entrypoint_fpm.sh @@ -8,6 +8,10 @@ change_php_vars(){ sed -i "s/max_execution_time = .*/max_execution_time = 300/" "$FILE" sed -i "s/upload_max_filesize = .*/upload_max_filesize = 50M/" "$FILE" sed -i "s/post_max_size = .*/post_max_size = 50M/" "$FILE" + if [ ! -z "$PHP_TIMEZONE" ]; + then + sed -i -E "s|^;?date.timezone =.*$|date.timezone = $PHP_TIMEZONE|" "$FILE" + fi done } From 60dea3dc834f10aab8b1c2c44b395263401c0c4c Mon Sep 17 00:00:00 2001 From: Paal Braathen Date: Thu, 14 Jul 2022 11:36:01 +0200 Subject: [PATCH 2/2] Fix timezone for cli config --- server/files/entrypoint_fpm.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/files/entrypoint_fpm.sh b/server/files/entrypoint_fpm.sh index 53d8170..60f010a 100755 --- a/server/files/entrypoint_fpm.sh +++ b/server/files/entrypoint_fpm.sh @@ -13,6 +13,13 @@ change_php_vars(){ sed -i -E "s|^;?date.timezone =.*$|date.timezone = $PHP_TIMEZONE|" "$FILE" fi done + for FILE in /etc/php/*/cli/php.ini + do + if [ ! -z "$PHP_TIMEZONE" ]; + then + sed -i -E "s|^;?date.timezone =.*$|date.timezone = $PHP_TIMEZONE|" "$FILE" + fi + done } echo "Configure PHP | Change PHP values ..." && change_php_vars