31 lines
No EOL
1 KiB
Bash
31 lines
No EOL
1 KiB
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
# Applique la timezone système et PHP si définie
|
|
if [ -n "$TZ" ]; then
|
|
echo "Configuration du timezone système et PHP : $TZ"
|
|
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime
|
|
echo "$TZ" > /etc/timezone
|
|
|
|
# Met à jour la timezone PHP-FPM
|
|
if grep -q "^date.timezone" /etc/php.ini; then
|
|
sed -i "s|^date.timezone =.*|date.timezone = $TZ|" /etc/php.ini
|
|
else
|
|
echo "date.timezone = $TZ" >> /etc/php.ini
|
|
fi
|
|
fi
|
|
|
|
# Renforce les paramètres PHP de sécurité
|
|
if grep -q "^session.cookie_httponly" /etc/php.ini; then
|
|
sed -i 's/^session.cookie_httponly\s*=.*/session.cookie_httponly = On/' /etc/php.ini
|
|
else
|
|
echo "session.cookie_httponly = On" >> /etc/php.ini
|
|
fi
|
|
|
|
# Injecte GLPI_FQDN dans le vhost
|
|
GLPI_FQDN="${GLPI_FQDN:-localhost}"
|
|
envsubst '${GLPI_FQDN}' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
|
|
echo 'php_value[session.save_path] = /var/www/html/files/_sessions' >> /etc/php-fpm.d/www.conf
|
|
|
|
# Lancer supervisord (gère nginx + php-fpm)
|
|
exec /usr/bin/supervisord -c /etc/supervisord.conf |