From 54f1808f90484a39bab105a347a788111c273ea2 Mon Sep 17 00:00:00 2001 From: LSI-ZuagrastaWastl <253091510+LSI-ZuagrastaWastl@users.noreply.github.com> Date: Sat, 14 Feb 2026 16:05:29 +0100 Subject: [PATCH 01/15] Add timezone setting to template.env Add timezone setting option to template.env --- template.env | 3 +++ 1 file changed, 3 insertions(+) diff --git a/template.env b/template.env index 17d09d4..789f411 100644 --- a/template.env +++ b/template.env @@ -74,6 +74,9 @@ ENABLE_BACKGROUND_UPDATES= # use a different attachments_dir. defaults to /var/www/MISP/app/files ATTACHMENTS_DIR= +# Setting the timezone (UTC, CET, Europe/Berlin etc.). Default is UTC. +# TZ="UTC" + # By default, a daily synchronization is performed, but you can modify this by changing the push and pull frequency (in seconds). # CRON_PULLALL="86400" # CRON_PUSHALL="86400" From 9b9ff56a9546bb133d96644e1e6d6bead6ba2f6a Mon Sep 17 00:00:00 2001 From: LSI-ZuagrastaWastl <253091510+LSI-ZuagrastaWastl@users.noreply.github.com> Date: Sat, 14 Feb 2026 16:12:25 +0100 Subject: [PATCH 02/15] Add timezone environment variable to services - Add timezone environment variable to all services - Setting Default to "UTC" --- docker-compose.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 01d02c5..31a082c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,6 +16,7 @@ services: - "SMARTHOST_USER=${SMARTHOST_USER}" - "SMARTHOST_PASSWORD=${SMARTHOST_PASSWORD}" - "SMARTHOST_ALIASES=${SMARTHOST_ALIASES}" + - "TZ=${TZ:-UTC}" redis: image: ${REGISTRY_MIRROR_URL:-}valkey/valkey:7.2 @@ -31,6 +32,7 @@ services: environment: - "ENABLE_REDIS_EMPTY_PASSWORD=${ENABLE_REDIS_EMPTY_PASSWORD:-false}" - "REDIS_PASSWORD=${REDIS_PASSWORD:-redispassword}" + - "TZ=${TZ:-UTC}" healthcheck: test: | sh -c ' @@ -57,6 +59,7 @@ services: - "MYSQL_PASSWORD=${MYSQL_PASSWORD:-example}" - "MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-password}" - "MYSQL_DATABASE=${MYSQL_DATABASE:-misp}" + - "TZ=${TZ:-UTC}" command: "\ --innodb-buffer-pool-size=${INNODB_BUFFER_POOL_SIZE:-2048M} \ --innodb-change-buffering=${INNODB_CHANGE_BUFFERING:-none} \ @@ -153,6 +156,7 @@ services: - "ADMIN_ORG_UUID=${ADMIN_ORG_UUID}" - "GPG_PASSPHRASE=${GPG_PASSPHRASE}" - "ATTACHMENTS_DIR=${ATTACHMENTS_DIR}" + - "TZ=${TZ:-UTC}" # OIDC authentication settings - "OIDC_ENABLE=${OIDC_ENABLE}" - "OIDC_PROVIDER_URL=${OIDC_PROVIDER_URL}" @@ -334,6 +338,8 @@ services: - "./custom/expansion/:/custom/expansion/:Z" - "./custom/export_mod/:/custom/export_mod/:Z" - "./custom/import_mod/:/custom/import_mod/:Z" + environment: + - "TZ=${TZ:-UTC}" misp-guard: profiles: @@ -352,6 +358,7 @@ services: environment: - "GUARD_PORT=${GUARD_PORT:-8888}" - "GUARD_ARGS=${GUARD_ARGS}" + - "TZ=${TZ:-UTC}" volumes: - ./guard/config.json:/config.json:ro - misp_guard_ca:/misp_guard_ca From 6f3aa899ab43a27540a14dba10a424dd2873b589 Mon Sep 17 00:00:00 2001 From: LSI-ZuagrastaWastl <253091510+LSI-ZuagrastaWastl@users.noreply.github.com> Date: Sat, 14 Feb 2026 16:17:44 +0100 Subject: [PATCH 03/15] Add PHP timezone config to docker-compose - Add timezone configuration for PHP in docker-compose file. - Replace PHP timezone in misp-core with the new config-file tzone.ini Perhaps there are better solutions for changing the time zone from PHP during runtime. --- docker-compose.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 31a082c..473eb83 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -315,6 +315,9 @@ services: - "CONTENT_SECURITY_POLICY=${CONTENT_SECURITY_POLICY}" # compose profiles - "COMPOSE_PROFILES=${COMPOSE_PROFILES}" + configs: + - source: tzone.ini + target: /etc/php/8.2/fpm/conf.d/99-tzone.ini misp-modules: image: ${REGISTRY_MIRROR_URL:-}ghcr.io/misp/misp-docker/misp-modules:${MODULES_RUNNING_TAG:-latest} @@ -369,6 +372,12 @@ services: retries: 3 start_period: 10s +configs: + tzone.ini: + content: | + [PHP] + date.timezone = "${TZ:-UTC}" + volumes: mysql_data: cache_data: From 2c8d4fd4424172ac84269ecb21d0b62fa25f3dc5 Mon Sep 17 00:00:00 2001 From: LSI-ZuagrastaWastl <253091510+LSI-ZuagrastaWastl@users.noreply.github.com> Date: Wed, 25 Feb 2026 11:00:37 +0100 Subject: [PATCH 04/15] Change PHP timezone variable and set localtime Updated PHP timezone configuration and added symlink for timezone for supervisord. --- core/files/entrypoint.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/files/entrypoint.sh b/core/files/entrypoint.sh index d40f1c3..2969b4a 100755 --- a/core/files/entrypoint.sh +++ b/core/files/entrypoint.sh @@ -88,7 +88,7 @@ export PHP_SESSION_CHECK_AGENT=${PHP_SESSION_CHECK_AGENT:-false} export PHP_SESSION_COOKIE_SECURE=${PHP_SESSION_COOKIE_SECURE:-true} export PHP_SESSION_COOKIE_DOMAIN=${PHP_SESSION_COOKIE_DOMAIN} export PHP_SESSION_COOKIE_SAMESITE=${PHP_SESSION_COOKIE_SAMESITE:-Lax} -export PHP_TIMEZONE=${PHP_TIMEZONE:-UTC} +export PHP_TIMEZONE=${TZ:-UTC} export NGINX_X_FORWARDED_FOR=${NGINX_X_FORWARDED_FOR:-false} export NGINX_SET_REAL_IP_FROM=${NGINX_SET_REAL_IP_FROM} @@ -101,6 +101,9 @@ export SUPERVISOR_HOST=${SUPERVISOR_HOST:-127.0.0.1} export SUPERVISOR_USERNAME=${SUPERVISOR_USERNAME:-supervisor} export SUPERVISOR_PASSWORD=${SUPERVISOR_PASSWORD:-supervisor} +# Setting Timezone for supervisord +ln -sf /usr/share/zoneinfo/${TZ:-UTC} /etc/localtime + # Hinders further execution when sourced from other scripts if [[ "${BASH_SOURCE[0]}" != "$0" ]]; then return From f712ff70beb0d5e9d2f754ac5763276b1a48856d Mon Sep 17 00:00:00 2001 From: LSI-ZuagrastaWastl <253091510+LSI-ZuagrastaWastl@users.noreply.github.com> Date: Wed, 25 Feb 2026 11:03:25 +0100 Subject: [PATCH 05/15] Fix timezone setting in PHP configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sed dosen“t use "?" so PHP_TIMEZONE was setting in php.ini --- core/files/entrypoint_fpm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/files/entrypoint_fpm.sh b/core/files/entrypoint_fpm.sh index 1882746..a734225 100755 --- a/core/files/entrypoint_fpm.sh +++ b/core/files/entrypoint_fpm.sh @@ -47,7 +47,7 @@ change_php_vars() { sed -i "s/session.sid_length = .*/session.sid_length = 64/" "$FILE" sed -i "s/session.use_strict_mode = .*/session.use_strict_mode = 1/" "$FILE" echo "Configure PHP | Setting 'date.timezone = ${PHP_TIMEZONE}'" - sed -i "s/;?date.timezone = .*/date.timezone = ${PHP_TIMEZONE}/" "$FILE" + sed -i "s/;date.timezone = .*/date.timezone = ${PHP_TIMEZONE}/" "$FILE" done for FILE in /etc/php/*/fpm/pool.d/www.conf From dce56697922d18ca819673df7e219a9ef2135129 Mon Sep 17 00:00:00 2001 From: LSI-ZuagrastaWastl <253091510+LSI-ZuagrastaWastl@users.noreply.github.com> Date: Wed, 25 Feb 2026 11:05:30 +0100 Subject: [PATCH 06/15] Change PHP_TIMEZONE variable to use TZ PHP_TIMEZONE wasn`t in template.env and so most not in use. TZ Variable the global Timezone variable in this Project --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 473eb83..1d5fdbc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -308,7 +308,7 @@ services: - "PHP_SESSION_COOKIE_SECURE=${PHP_SESSION_COOKIE_SECURE:-true}" - "PHP_SESSION_COOKIE_DOMAIN=${PHP_SESSION_COOKIE_DOMAIN}" - "PHP_SESSION_COOKIE_SAMESITE=${PHP_SESSION_COOKIE_SAMESITE:-Lax}" - - "PHP_TIMEZONE=${PHP_TIMEZONE:-UTC}" + - "PHP_TIMEZONE=${TZ:-UTC}" # security settings - "HSTS_MAX_AGE=${HSTS_MAX_AGE}" - "X_FRAME_OPTIONS=${X_FRAME_OPTIONS}" From da0e4e4ea26fc391699c7e670701b6cba79c7569 Mon Sep 17 00:00:00 2001 From: LSI-ZuagrastaWastl <253091510+LSI-ZuagrastaWastl@users.noreply.github.com> Date: Wed, 25 Feb 2026 11:07:50 +0100 Subject: [PATCH 07/15] Remove tzone.ini configuration from docker-compose Removed timezone configuration from docker-compose. With the "sed fix" in the entrypoint_fpm.sh, No need to mount a separate file now --- docker-compose.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1d5fdbc..25d8ca8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -315,9 +315,6 @@ services: - "CONTENT_SECURITY_POLICY=${CONTENT_SECURITY_POLICY}" # compose profiles - "COMPOSE_PROFILES=${COMPOSE_PROFILES}" - configs: - - source: tzone.ini - target: /etc/php/8.2/fpm/conf.d/99-tzone.ini misp-modules: image: ${REGISTRY_MIRROR_URL:-}ghcr.io/misp/misp-docker/misp-modules:${MODULES_RUNNING_TAG:-latest} @@ -372,12 +369,6 @@ services: retries: 3 start_period: 10s -configs: - tzone.ini: - content: | - [PHP] - date.timezone = "${TZ:-UTC}" - volumes: mysql_data: cache_data: From 25e999fdd711bdc83c2d92fb9fb704c6b85e10cb Mon Sep 17 00:00:00 2001 From: LSI-ZuagrastaWastl <253091510+LSI-ZuagrastaWastl@users.noreply.github.com> Date: Mon, 9 Mar 2026 15:15:10 +0100 Subject: [PATCH 08/15] Change timezone setting to use update-alternatives Updated timezone setting method for supervisord compatibility with debian standard methode --- core/files/entrypoint.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/files/entrypoint.sh b/core/files/entrypoint.sh index 2969b4a..6e5c8d1 100755 --- a/core/files/entrypoint.sh +++ b/core/files/entrypoint.sh @@ -102,7 +102,9 @@ export SUPERVISOR_USERNAME=${SUPERVISOR_USERNAME:-supervisor} export SUPERVISOR_PASSWORD=${SUPERVISOR_PASSWORD:-supervisor} # Setting Timezone for supervisord -ln -sf /usr/share/zoneinfo/${TZ:-UTC} /etc/localtime +update-alternatives --install /etc/localtime localtime /usr/share/zoneinfo/${TZ:UTC} 0 +# Also set /etc/timezone for broader compatibility +echo "${TZ:UTC}" > /etc/timezone # Hinders further execution when sourced from other scripts if [[ "${BASH_SOURCE[0]}" != "$0" ]]; then From 44f0c8cccf90948c97f643e80770e15708ca2956 Mon Sep 17 00:00:00 2001 From: LSI-ZuagrastaWastl <253091510+LSI-ZuagrastaWastl@users.noreply.github.com> Date: Tue, 10 Mar 2026 13:42:09 +0100 Subject: [PATCH 09/15] sed TZ:UTC to TZ:-UTC add `-` so default (UTC) is in use, if TZ is not in use --- core/files/entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/files/entrypoint.sh b/core/files/entrypoint.sh index 7df0451..ca597a8 100755 --- a/core/files/entrypoint.sh +++ b/core/files/entrypoint.sh @@ -103,9 +103,9 @@ export SUPERVISOR_USERNAME=${SUPERVISOR_USERNAME:-supervisor} export SUPERVISOR_PASSWORD=${SUPERVISOR_PASSWORD:-supervisor} # Setting Timezone for supervisord -update-alternatives --install /etc/localtime localtime /usr/share/zoneinfo/${TZ:UTC} 0 +update-alternatives --install /etc/localtime localtime /usr/share/zoneinfo/${TZ:-UTC} 0 # Also set /etc/timezone for broader compatibility -echo "${TZ:UTC}" > /etc/timezone +echo "${TZ:-UTC}" > /etc/timezone # Hinders further execution when sourced from other scripts if [[ "${BASH_SOURCE[0]}" != "$0" ]]; then From 578b14140f0a01752aa1b696ac7d55bdd95729c5 Mon Sep 17 00:00:00 2001 From: LSI-ZuagrastaWastl <253091510+LSI-ZuagrastaWastl@users.noreply.github.com> Date: Tue, 10 Mar 2026 13:46:13 +0100 Subject: [PATCH 10/15] Change php-timezone variable to use TZ directly --- core/files/entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/files/entrypoint.sh b/core/files/entrypoint.sh index ca597a8..1726dd2 100755 --- a/core/files/entrypoint.sh +++ b/core/files/entrypoint.sh @@ -89,7 +89,8 @@ export PHP_SESSION_CHECK_AGENT=${PHP_SESSION_CHECK_AGENT:-false} export PHP_SESSION_COOKIE_SECURE=${PHP_SESSION_COOKIE_SECURE:-true} export PHP_SESSION_COOKIE_DOMAIN=${PHP_SESSION_COOKIE_DOMAIN} export PHP_SESSION_COOKIE_SAMESITE=${PHP_SESSION_COOKIE_SAMESITE:-Lax} -export PHP_TIMEZONE=${TZ:-UTC} + +export TZ=${TZ:-UTC} export NGINX_X_FORWARDED_FOR=${NGINX_X_FORWARDED_FOR:-false} export NGINX_SET_REAL_IP_FROM=${NGINX_SET_REAL_IP_FROM} From 98b198430cf4ca8364988315fed661a7bad9f9e2 Mon Sep 17 00:00:00 2001 From: LSI-ZuagrastaWastl <253091510+LSI-ZuagrastaWastl@users.noreply.github.com> Date: Tue, 10 Mar 2026 13:47:29 +0100 Subject: [PATCH 11/15] Remove PHP_TIMEZONE environment variable PHP_timezone isn`t in use TZ exist --- docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index b1727ae..3ef2263 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -321,7 +321,6 @@ services: - "PHP_SESSION_COOKIE_SECURE=${PHP_SESSION_COOKIE_SECURE:-true}" - "PHP_SESSION_COOKIE_DOMAIN=${PHP_SESSION_COOKIE_DOMAIN}" - "PHP_SESSION_COOKIE_SAMESITE=${PHP_SESSION_COOKIE_SAMESITE:-Lax}" - - "PHP_TIMEZONE=${TZ:-UTC}" # security settings - "HSTS_MAX_AGE=${HSTS_MAX_AGE}" - "X_FRAME_OPTIONS=${X_FRAME_OPTIONS}" From ee22d135e72913fb22470ef23e5ac9ec1f18b205 Mon Sep 17 00:00:00 2001 From: LSI-ZuagrastaWastl <253091510+LSI-ZuagrastaWastl@users.noreply.github.com> Date: Tue, 10 Mar 2026 13:48:39 +0100 Subject: [PATCH 12/15] Update PHP timezone configuration to TZ in entrypoint_fpm.sh --- core/files/entrypoint_fpm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/files/entrypoint_fpm.sh b/core/files/entrypoint_fpm.sh index a734225..f7c4ccb 100755 --- a/core/files/entrypoint_fpm.sh +++ b/core/files/entrypoint_fpm.sh @@ -46,8 +46,8 @@ change_php_vars() { fi sed -i "s/session.sid_length = .*/session.sid_length = 64/" "$FILE" sed -i "s/session.use_strict_mode = .*/session.use_strict_mode = 1/" "$FILE" - echo "Configure PHP | Setting 'date.timezone = ${PHP_TIMEZONE}'" - sed -i "s/;date.timezone = .*/date.timezone = ${PHP_TIMEZONE}/" "$FILE" + echo "Configure PHP | Setting 'date.timezone = ${TZ}'" + sed -i "s/;date.timezone = .*/date.timezone = ${TZ}/" "$FILE" done for FILE in /etc/php/*/fpm/pool.d/www.conf From f611df2fe53d1e898ec7b827a0c5c5b606f30b59 Mon Sep 17 00:00:00 2001 From: LSI-ZuagrastaWastl <253091510+LSI-ZuagrastaWastl@users.noreply.github.com> Date: Tue, 10 Mar 2026 13:53:15 +0100 Subject: [PATCH 13/15] Update timezone comment in template.env CET or CEST not useable timezone in /usr/share/zoneinfo/ --- template.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template.env b/template.env index ee7ab11..9744a5f 100644 --- a/template.env +++ b/template.env @@ -78,7 +78,7 @@ ATTACHMENTS_DIR= # enable UI themes # ENABLE_THEMES=false -# Setting the timezone (UTC, CET, Europe/Berlin etc.). Default is UTC. +# Setting the timezone (UTC, Europe/Berlin etc.). Default is UTC. # TZ="UTC" # By default, a daily synchronization is performed, but you can modify this by changing the push and pull frequency (in seconds). From dbb403114e3d75cf4a4fe2a4d05419f60e61803d Mon Sep 17 00:00:00 2001 From: LSI-ZuagrastaWastl <253091510+LSI-ZuagrastaWastl@users.noreply.github.com> Date: Wed, 11 Mar 2026 09:57:58 +0100 Subject: [PATCH 14/15] Update timezone setting in entrypoint.sh Remove default value for TZ when setting timezone. --- core/files/entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/files/entrypoint.sh b/core/files/entrypoint.sh index 1726dd2..a5a9242 100755 --- a/core/files/entrypoint.sh +++ b/core/files/entrypoint.sh @@ -104,9 +104,9 @@ export SUPERVISOR_USERNAME=${SUPERVISOR_USERNAME:-supervisor} export SUPERVISOR_PASSWORD=${SUPERVISOR_PASSWORD:-supervisor} # Setting Timezone for supervisord -update-alternatives --install /etc/localtime localtime /usr/share/zoneinfo/${TZ:-UTC} 0 +update-alternatives --install /etc/localtime localtime /usr/share/zoneinfo/${TZ} 0 # Also set /etc/timezone for broader compatibility -echo "${TZ:-UTC}" > /etc/timezone +echo "${TZ}" > /etc/timezone # Hinders further execution when sourced from other scripts if [[ "${BASH_SOURCE[0]}" != "$0" ]]; then From e83392bd62d10556aee8586a51afb526d9d8c9f0 Mon Sep 17 00:00:00 2001 From: LSI-ZuagrastaWastl <253091510+LSI-ZuagrastaWastl@users.noreply.github.com> Date: Mon, 16 Mar 2026 18:07:09 +0100 Subject: [PATCH 15/15] Fix sed command for date.timezone configuration switch delimitter `/` to `|` --- core/files/entrypoint_fpm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/files/entrypoint_fpm.sh b/core/files/entrypoint_fpm.sh index f7c4ccb..741429c 100755 --- a/core/files/entrypoint_fpm.sh +++ b/core/files/entrypoint_fpm.sh @@ -47,7 +47,7 @@ change_php_vars() { sed -i "s/session.sid_length = .*/session.sid_length = 64/" "$FILE" sed -i "s/session.use_strict_mode = .*/session.use_strict_mode = 1/" "$FILE" echo "Configure PHP | Setting 'date.timezone = ${TZ}'" - sed -i "s/;date.timezone = .*/date.timezone = ${TZ}/" "$FILE" + sed -i "s|^;date.timezone = .*|date.timezone = ${TZ}|" "$FILE" done for FILE in /etc/php/*/fpm/pool.d/www.conf