From 75e9e082e47541c032c279cd100370f21b18dd8a Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 2 Nov 2023 18:44:28 +0100 Subject: [PATCH] fix #6447 @0.5 --- .docker/dev/docker-compose.yml | 2 ++ .docker/docker-compose.yml | 2 ++ app/Fluidbook/Compiler/Compiler.php | 7 ++-- .../template/images/php-5.6-fpm/Dockerfile | 7 ++-- .../images/php-5.6-fpm/php-fpm-startup | 33 ++++++++++++++++++- .../template/images/php-fpm/Dockerfile | 4 +-- 6 files changed, 46 insertions(+), 9 deletions(-) diff --git a/.docker/dev/docker-compose.yml b/.docker/dev/docker-compose.yml index b9571cfc0..e67f35c35 100644 --- a/.docker/dev/docker-compose.yml +++ b/.docker/dev/docker-compose.yml @@ -24,6 +24,7 @@ services: - '/data/extranet/www/fluidbook/books/links/:/application/protected/fluidbookpublication/links/' - '/home/extranet/www/fluidbook/cache/unzip/:/application/storage/fluidbook/cache/unzip/' - '/data/toolbox/protected/fluidbookpublication/cache/:/application/protected/fluidbookpublication/cache/' + - '/data/toolbox/protected/fluidbookpublication/pdf/:/application/protected/fluidbookpublication/pdf/' # DEV - '/home/toolbox/www/resources/fluidbookpublication/player/:/application/resources/fluidbookpublication/player/' # Startup @@ -93,6 +94,7 @@ services: - '/data/extranet/www/fluidbook/books/links/:/application/protected/fluidbookpublication/links/' - '/home/extranet/www/fluidbook/cache/unzip/:/application/storage/fluidbook/cache/unzip/' - '/data/toolbox/protected/fluidbookpublication/cache/:/application/protected/fluidbookpublication/cache/' + - '/data/toolbox/protected/fluidbookpublication/pdf/:/application/protected/fluidbookpublication/pdf/' # Config - '/home/toolbox/dev/.docker/config/httpd/httpd-dev.conf:/usr/local/apache2/conf/httpd.conf' ports: diff --git a/.docker/docker-compose.yml b/.docker/docker-compose.yml index 1e5ac4dd1..8f7e1dbf9 100644 --- a/.docker/docker-compose.yml +++ b/.docker/docker-compose.yml @@ -24,6 +24,7 @@ services: - '/data/extranet/www/fluidbook/books/links/:/application/protected/fluidbookpublication/links/' - '/home/extranet/www/fluidbook/cache/unzip/:/application/storage/fluidbook/cache/unzip/' - '/data/toolbox/protected/fluidbookpublication/cache/:/application/protected/fluidbookpublication/cache/' + - '/data/toolbox/protected/fluidbookpublication/pdf/:/application/protected/fluidbookpublication/pdf/' # Startup - '/home/toolbox/www/bin/startup.sh:/usr/bin/startup.sh' # SSH @@ -91,6 +92,7 @@ services: - '/data/extranet/www/fluidbook/books/links/:/application/protected/fluidbookpublication/links/' - '/home/extranet/www/fluidbook/cache/unzip/:/application/storage/fluidbook/cache/unzip/' - '/data/toolbox/protected/fluidbookpublication/cache/:/application/protected/fluidbookpublication/cache/' + - '/data/toolbox/protected/fluidbookpublication/pdf/:/application/protected/fluidbookpublication/pdf/' # Config - '/home/toolbox/www/.docker/config/httpd/httpd.conf:/usr/local/apache2/conf/httpd.conf' ports: diff --git a/app/Fluidbook/Compiler/Compiler.php b/app/Fluidbook/Compiler/Compiler.php index 0ae211e0c..5c590ae84 100644 --- a/app/Fluidbook/Compiler/Compiler.php +++ b/app/Fluidbook/Compiler/Compiler.php @@ -1906,11 +1906,12 @@ class Compiler extends Base implements CompilerInterface $this->lessVariables['thumb-height'] = $thumbh . 'px'; # Aftersearch - $this->lessVariables['aftersearch-width']=$this->lessVariables['aftersearch-height']='0'; + $this->lessVariables['aftersearch-width'] = 'auto'; + $this->lessVariables['aftersearch-height'] = 'auto'; if ($afterSearch = $this->themeAsset('afterSearch')) { $dim = Image::getimagesize($afterSearch); - $this->lessVariables['aftersearch-width'] = $dim[0].'px'; - $this->lessVariables['aftersearch-height'] = $dim[1].'px'; + $this->lessVariables['aftersearch-width'] = $dim[0] . 'px'; + $this->lessVariables['aftersearch-height'] = $dim[1] . 'px'; } #tooltip diff --git a/resources/tools/dockerwebcontainer/template/images/php-5.6-fpm/Dockerfile b/resources/tools/dockerwebcontainer/template/images/php-5.6-fpm/Dockerfile index 94587999a..67be0835a 100644 --- a/resources/tools/dockerwebcontainer/template/images/php-5.6-fpm/Dockerfile +++ b/resources/tools/dockerwebcontainer/template/images/php-5.6-fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:bionic AS cli +FROM ubuntu:jammy AS cli WORKDIR "/application" @@ -9,7 +9,7 @@ ENV TERM=linux # the distro's packages RUN apt-get update \ && apt-get install -y --no-install-recommends gnupg \ - && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main" > /etc/apt/sources.list.d/ondrej-php.list \ + && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ondrej-php.list \ && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \ && apt-get update \ && apt-get update \ @@ -76,6 +76,7 @@ RUN apt-get update; \ php5.6-curl \ php5.6-json \ php5.6-mcrypt \ - less nano wget curl; \ + less nano wget curl \ + sudo openssh-server rsyslog cron mariadb-client; \ apt-get clean; \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*; diff --git a/resources/tools/dockerwebcontainer/template/images/php-5.6-fpm/php-fpm-startup b/resources/tools/dockerwebcontainer/template/images/php-5.6-fpm/php-fpm-startup index c7e3f5c5f..26860a1c0 100644 --- a/resources/tools/dockerwebcontainer/template/images/php-5.6-fpm/php-fpm-startup +++ b/resources/tools/dockerwebcontainer/template/images/php-5.6-fpm/php-fpm-startup @@ -1,2 +1,33 @@ -#!/usr/bin/env bash +#!/bin/sh + +# Set file rights +umask 0000 +chmod -R 777 /tmp + +chown -R root:root /etc/sudoers.d +chown -R $name:www-data /application + +# Rsyslog +start-stop-daemon --start -b -x /usr/sbin/rsyslogd -- -n + +# SSH Server +ssh-keygen -A +chmod 755 /etc/ssh/*.d +chmod 600 /etc/ssh/*_key +chmod 750 /application +#chmod 600 /application/.ssh/id_rsa +chmod 700 /application/.ssh/ +chmod 600 /application/.ssh/authorized_keys2 +#chmod 600 /root/.ssh/id_rsa +chmod 700 /root/.ssh/ +chmod 600 /root/.ssh/authorized_keys2 +/usr/sbin/service ssh start + +# Cron +chmod 0644 /etc/crontab && crontab -u root /etc/crontab && /usr/sbin/service cron start + +# Set user password +chpasswd < /root/passwords + +# Launch PHP /usr/sbin/php-fpm5.6 -F -O 2>&1 | sed -u 's,.*: \"\(.*\)$,\1,'| sed -u 's,"$,,' 1>&1 diff --git a/resources/tools/dockerwebcontainer/template/images/php-fpm/Dockerfile b/resources/tools/dockerwebcontainer/template/images/php-fpm/Dockerfile index 36cc86301..498565a74 100644 --- a/resources/tools/dockerwebcontainer/template/images/php-fpm/Dockerfile +++ b/resources/tools/dockerwebcontainer/template/images/php-fpm/Dockerfile @@ -19,8 +19,8 @@ RUN apt update \ && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C # Add Nodejs Repository -RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg -RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list +RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list RUN apt update -- 2.39.5