Skip to content

Remove space from php-timezone sed pattern#399

Merged
ostefano merged 19 commits intoMISP:masterfrom
LSI-Bayern:master
Mar 20, 2026
Merged

Remove space from php-timezone sed pattern#399
ostefano merged 19 commits intoMISP:masterfrom
LSI-Bayern:master

Conversation

@LSI-ZuagrastaWastl
Copy link
Copy Markdown
Contributor

Remove the space from the pattern (= .*=.*) to make it more flexible.

Solution for #398

sorry for my mistake :/

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.
Updated PHP timezone configuration 
and added symlink for timezone for supervisord.
sed dosen´t use "?"  so PHP_TIMEZONE was setting in php.ini
PHP_TIMEZONE wasn`t in template.env and so most not in use.
TZ Variable the global Timezone variable in this Project
Removed timezone configuration from docker-compose.
With the "sed fix" in the entrypoint_fpm.sh, No need to mount a separate file now
Updated timezone setting method for supervisord compatibility with debian standard methode
add `-` so default (UTC) is in use, if TZ is not in use
PHP_timezone isn`t in use
TZ exist
CET or CEST not useable timezone in /usr/share/zoneinfo/
Remove default value for TZ when setting timezone.
Remove the space from the pattern (`= .*` → `=.*`) to make it more flexible.
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"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do we need to fix it?

My understanding is that, if this is never modified manually, it should work consistently?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The problem is that, by default, the php.ini file does not appear to have a space after ;date.timezone =. As a result, the pattern does not recognize this line and does not set the value.

Without the space in the pattern, it is therefore more robust.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Oh, that is indeed annoying...

@ostefano ostefano linked an issue Mar 20, 2026 that may be closed by this pull request
@ostefano ostefano merged commit a4e7a00 into MISP:master Mar 20, 2026
5 checks passed
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.

Bug when setting TZ to Europe/Amsterdam

2 participants