Skip to content

Fix Timezone Handling for Containers#375

Open
LSI-ZuagrastaWastl wants to merge 3 commits intoMISP:masterfrom
LSI-Bayern:master
Open

Fix Timezone Handling for Containers#375
LSI-ZuagrastaWastl wants to merge 3 commits intoMISP:masterfrom
LSI-Bayern:master

Conversation

@LSI-ZuagrastaWastl
Copy link

This PR standardizes timezone handling across all MISP Docker containers.

The timezone can now be set optionally via the TZ environment variable.
If defined, it is applied globally and consistently across all containers and all processes, including system services, supervisord, background jobs, logs, and the MISP web interface.

If TZ is not set, the default remains UTC.

Changes

  • Added TZ as environment variable with default UTC
  • Mounted /usr/share/zoneinfo/${TZ:-UTC} to /etc/localtime
  • Configured PHP (tzone.ini) to use date.timezone from TZ

Benefits

  • Consistent timezone across system, logs, workers, and web interface
  • Optional but globally enforced configuration
  • More portable Docker setup
  • Non-breaking change

Best Regards from Bayern-CERT

Add timezone setting option to template.env
- Add timezone environment variable to all services
- Setting Default to "UTC"
- 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.
retries: 3
start_period: 10s

configs:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move this to a separate file and edit Dockerfile to COPY it at build time and run sed in there (like we do with the PHP files?

Your solution is much cleaner, but not everybody is using docker-compose.yml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants