Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to set timezone in PHP #148

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions server/files/entrypoint_fpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ 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
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
}

Expand Down