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 1/7] 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 2/7] 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 3/7] 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 4/7] 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 5/7] 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 6/7] 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 7/7] 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: