Skip to content

Commit

Permalink
ready for QA
Browse files Browse the repository at this point in the history
  • Loading branch information
nmaillat committed Oct 2, 2024
1 parent 6397db7 commit 2b13761
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ PHP_CLI_MEMORY_LIMIT=2048M
# specified).
# http://php.net/upload-tmp-dir
# @run
PHP_UPLOAD_TMP_DIR=/tmp
PHP_UPLOAD_TMP_DIR=/var/alchemy/phraseanet/tmp/php_upload_tmp

# Php Opcache status. See [opcache Php documentation|
# https://www.php.net/manual/en/intro.opcache.php].
Expand Down
1 change: 1 addition & 0 deletions docker/phraseanet/fpm/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -e
envsubst < "docker/phraseanet/php.ini.sample" > /usr/local/etc/php/php.ini
envsubst < "docker/phraseanet/php-fpm.conf.sample" > /usr/local/etc/php-fpm.conf
envsubst < "docker/phraseanet/root/usr/local/etc/php-fpm.d/zz-docker.conf" > /usr/local/etc/php-fpm.d/zz-docker.conf

# cat docker/phraseanet/root/usr/local/etc/php-fpm.d/zz-docker.conf | sed "s/\$REQUEST_TERMINATE_TIMEOUT/$REQUEST_TERMINATE_TIMEOUT/g" > /usr/local/etc/php-fpm.d/zz-docker.conf

if [ ${XDEBUG_ENABLED} == "1" ]; then
Expand Down
2 changes: 1 addition & 1 deletion docker/phraseanet/php.ini.sample
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ file_uploads = On
; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
; http://php.net/upload-tmp-dir
;upload_tmp_dir =
upload_tmp_dir = $PHP_UPLOAD_TMP_DIR

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
Expand Down
2 changes: 1 addition & 1 deletion docker/phraseanet/php.ini.worker.sample
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ file_uploads = On
; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
; http://php.net/upload-tmp-dir
;upload_tmp_dir =
upload_tmp_dir = $PHP_UPLOAD_TMP_DIR

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
Expand Down
21 changes: 20 additions & 1 deletion docker/phraseanet/setup/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ set -e
envsubst < "docker/phraseanet/php.ini.worker.sample" > /usr/local/etc/php/php.ini
cat docker/phraseanet/root/usr/local/etc/php-fpm.d/zz-docker.conf | sed "s/\$REQUEST_TERMINATE_TIMEOUT/$REQUEST_TERMINATE_TIMEOUT/g" > /usr/local/etc/php-fpm.d/zz-docker.conf

if [ -d "$PHP_UPLOAD_TMP_DIR" ]; then
echo `date +"%Y-%m-%d %H:%M:%S"` " - The directory: $PHP_UPLOAD_TMP_DIR already exists."
else
echo `date +"%Y-%m-%d %H:%M:%S"` " - The directory: $PHP_UPLOAD_TMP_DIR does not exist. Creating the directory..."
mkdir -p "$PHP_UPLOAD_TMP_DIR"

if [ $? -eq 0 ]; then
echo `date +"%Y-%m-%d %H:%M:%S"` " - The directory: $PHP_UPLOAD_TMP_DIR was successfully created."
else
echo `date +"%Y-%m-%d %H:%M:%S"` " - Failed to create directory: $PHP_UPLOAD_TMP_DIR."
exit 1
fi
fi

if [[ -z "$PHRASEANET_APP_PORT" || $PHRASEANET_APP_PORT = "80" || $PHRASEANET_APP_PORT = "443" ]];then
export PHRASEANET_BASE_URL="$PHRASEANET_SCHEME://$PHRASEANET_HOSTNAME"
echo `date +"%Y-%m-%d %H:%M:%S"` " - Phraseanet BASE URL IS : " $PHRASEANET_BASE_URL
Expand Down Expand Up @@ -293,9 +307,14 @@ chown -R app:app backup
echo `date +"%Y-%m-%d %H:%M:%S"` " - chown APP:APP on www/repository excluding www/thumbnails"
cd www
chown -R app:app $(ls -I thumbnails)

echo `date +"%Y-%m-%d %H:%M:%S"` " - End of chown!"

if [ -d "$PHP_UPLOAD_TMP_DIR" ]; then
echo `date +"%Y-%m-%d %H:%M:%S"` " - Cleaning files older than 2 days in $PHP_UPLOAD_TMP_DIR "
find "$PHP_UPLOAD_TMP_DIR" -type f -mtime +2 -exec rm -f {} \;
fi

echo `date +"%Y-%m-%d %H:%M:%S"` " - End of Phraseanet setup entrypoint.sh"


Expand Down

0 comments on commit 2b13761

Please sign in to comment.