From 08717e42d9f6eee01df79346f8694bfed28a3109 Mon Sep 17 00:00:00 2001 From: rudy Date: Thu, 7 Apr 2022 14:35:36 +0200 Subject: [PATCH] =?UTF-8?q?mont=C3=A9e=20php8.1,=20ubuntu=2022.04?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + config/routes.yaml | 6 +- containers/loginapp/000-default.conf | 2 +- containers/loginapp/Dockerfile | 16 +- containers/loginapp/supervisor.ini | 2 +- containers/loginapp/www.conf | 2 +- src/Controller/MainController.php | 8 +- supervisord.log | 20 +++ supervisord.pid | 2 +- vendor/psr/log/src/AbstractLogger.php | 15 ++ .../psr/log/src/InvalidArgumentException.php | 7 + vendor/psr/log/src/LogLevel.php | 18 +++ vendor/psr/log/src/LoggerAwareInterface.php | 18 +++ vendor/psr/log/src/LoggerAwareTrait.php | 26 ++++ vendor/psr/log/src/LoggerInterface.php | 125 +++++++++++++++ vendor/psr/log/src/LoggerTrait.php | 142 ++++++++++++++++++ vendor/psr/log/src/NullLogger.php | 30 ++++ 17 files changed, 419 insertions(+), 22 deletions(-) create mode 100644 vendor/psr/log/src/AbstractLogger.php create mode 100644 vendor/psr/log/src/InvalidArgumentException.php create mode 100644 vendor/psr/log/src/LogLevel.php create mode 100644 vendor/psr/log/src/LoggerAwareInterface.php create mode 100644 vendor/psr/log/src/LoggerAwareTrait.php create mode 100644 vendor/psr/log/src/LoggerInterface.php create mode 100644 vendor/psr/log/src/LoggerTrait.php create mode 100644 vendor/psr/log/src/NullLogger.php diff --git a/.gitignore b/.gitignore index f9fbc51..15a343b 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ /public/bundles/ /var/ ###< symfony/framework-bundle ### +/supervisord.log +/supervisord.pid \ No newline at end of file diff --git a/config/routes.yaml b/config/routes.yaml index 4cd716a..a4d5470 100644 --- a/config/routes.yaml +++ b/config/routes.yaml @@ -1,3 +1,3 @@ -index: - path: /loginAppSaml - controller: App\Controller\MainController::loginAppSaml +# index: +# path: / +# controller: App\Controller\MainController:: diff --git a/containers/loginapp/000-default.conf b/containers/loginapp/000-default.conf index feba8df..1b2b300 100644 --- a/containers/loginapp/000-default.conf +++ b/containers/loginapp/000-default.conf @@ -8,7 +8,7 @@ # Using SetHandler avoids issues with using ProxyPassMatch in combination # with mod_rewrite or mod_autoindex - SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://127.0.0.1:9000" + SetHandler "proxy:unix:/run/php/php8.1-fpm.sock|fcgi://127.0.0.1:9000" # for Unix sockets, Apache 2.4.10 or higher # SetHandler proxy:unix:/path/to/fpm.sock|fcgi://dummy diff --git a/containers/loginapp/Dockerfile b/containers/loginapp/Dockerfile index dd00d14..6efbb72 100644 --- a/containers/loginapp/Dockerfile +++ b/containers/loginapp/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG HTTP_PROXY= ARG HTTPS_PROXY= @@ -7,7 +7,7 @@ ARG https_proxy= ENV WAITFORIT_VERSION="v2.4.1" -ARG PHP_VERSION="7.4" +ARG PHP_VERSION="8.1" ENV PHP_VERSION $PHP_VERSION RUN export DEBIAN_FRONTEND=noninteractive && \ @@ -17,7 +17,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get update -y && \ apt-get install -y --no-install-recommends \ git bash wget ca-certificates supervisor cron rsyslog mysql-client jq \ - mutt tree vim python python3 python3-setuptools python3-pip make \ + mutt tree vim python3-setuptools python3-pip make \ php${PHP_VERSION}-cli php${PHP_VERSION}-ldap php${PHP_VERSION}-soap \ php${PHP_VERSION}-intl php${PHP_VERSION}-curl php${PHP_VERSION}-gd \ php${PHP_VERSION}-xml php${PHP_VERSION}-bcmath \ @@ -58,14 +58,14 @@ RUN chmod +x /loginapp/install-composer.sh &&\ # On active les mods d'apache nécessaires RUN a2enmod rewrite RUN a2enmod proxy_fcgi setenvif -RUN a2enconf php7.4-fpm +RUN a2enconf php8.1-fpm RUN a2enmod proxy RUN a2enmod expires RUN a2enmod headers # On injecte les bonnes configs apache et php-fpm COPY 000-default.conf /etc/apache2/sites-available/000-default.conf -COPY www.conf /etc/php/7.4/fpm/pool.d/www.conf +COPY www.conf /etc/php/8.1/fpm/pool.d/www.conf EXPOSE 5000 EXPOSE 80 @@ -73,8 +73,8 @@ EXPOSE 80 WORKDIR /loginapp # On démarre php-fpm une fois pour créer les sockets -RUN service php7.4-fpm start -RUN service php7.4-fpm stop +RUN service php8.1-fpm start +RUN service php8.1-fpm stop COPY docker-entrypoint.sh /docker-entrypoint.sh @@ -89,7 +89,7 @@ RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf COPY rsyslog.conf /etc/rsyslog.d/loginapp.conf COPY supervisor.ini /etc/supervisor/supervisor.ini -COPY php.ini /etc/php/7.4/fpm/php.ini +COPY php.ini /etc/php/8.1/fpm/php.ini VOLUME /container-lifecycle diff --git a/containers/loginapp/supervisor.ini b/containers/loginapp/supervisor.ini index 110beea..4da9bc5 100644 --- a/containers/loginapp/supervisor.ini +++ b/containers/loginapp/supervisor.ini @@ -26,7 +26,7 @@ stderr_logfile_maxbytes=0 [program:php-fpm] environment=HOSTNAME="%(ENV_HOSTNAME)s" -command = /usr/sbin/php-fpm7.4 -F +command = /usr/sbin/php-fpm8.1 -F autostart = true autorestart = true directory = /loginapp diff --git a/containers/loginapp/www.conf b/containers/loginapp/www.conf index 037f53f..c496690 100644 --- a/containers/loginapp/www.conf +++ b/containers/loginapp/www.conf @@ -6,7 +6,7 @@ error_log=/dev/stderr user = www-data group = www-data -listen = /run/php/php7.4-fpm.sock +listen = /run/php/php8.1-fpm.sock listen.owner = www-data listen.group = www-data diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index 817b8cd..e4fc5ba 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -9,11 +9,5 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; class MainController extends AbstractController { - /** - * @Route("/loginAppSaml", name="login_app_saml") - */ - public function loginAppSaml(Request $request) - { - return new Response("saml"); - } + } \ No newline at end of file diff --git a/supervisord.log b/supervisord.log index 2419934..24ae795 100644 --- a/supervisord.log +++ b/supervisord.log @@ -4012,3 +4012,23 @@ 2022-04-07 12:57:41,576 INFO success: apache2 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2022-04-07 12:57:41,576 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2022-04-07 12:57:41,576 INFO success: rsyslog entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) +2022-04-07 13:28:49,188 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message. +2022-04-07 13:28:49,190 INFO RPC interface 'supervisor' initialized +2022-04-07 13:28:49,190 CRIT Server 'unix_http_server' running without any HTTP authentication checking +2022-04-07 13:28:49,191 INFO supervisord started with pid 26 +2022-04-07 13:28:50,194 INFO spawned: 'apache2' with pid 28 +2022-04-07 13:28:50,197 INFO spawned: 'php-fpm' with pid 29 +2022-04-07 13:28:50,199 INFO spawned: 'rsyslog' with pid 30 +2022-04-07 13:28:51,229 INFO success: apache2 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) +2022-04-07 13:28:51,229 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) +2022-04-07 13:28:51,229 INFO success: rsyslog entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) +2022-04-07 14:27:06,256 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message. +2022-04-07 14:27:06,258 INFO RPC interface 'supervisor' initialized +2022-04-07 14:27:06,258 CRIT Server 'unix_http_server' running without any HTTP authentication checking +2022-04-07 14:27:06,258 INFO supervisord started with pid 26 +2022-04-07 14:27:07,261 INFO spawned: 'apache2' with pid 27 +2022-04-07 14:27:07,264 INFO spawned: 'php-fpm' with pid 28 +2022-04-07 14:27:07,265 INFO spawned: 'rsyslog' with pid 29 +2022-04-07 14:27:08,292 INFO success: apache2 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) +2022-04-07 14:27:08,292 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) +2022-04-07 14:27:08,292 INFO success: rsyslog entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) diff --git a/supervisord.pid b/supervisord.pid index 48082f7..6f4247a 100644 --- a/supervisord.pid +++ b/supervisord.pid @@ -1 +1 @@ -12 +26 diff --git a/vendor/psr/log/src/AbstractLogger.php b/vendor/psr/log/src/AbstractLogger.php new file mode 100644 index 0000000..d60a091 --- /dev/null +++ b/vendor/psr/log/src/AbstractLogger.php @@ -0,0 +1,15 @@ +logger = $logger; + } +} diff --git a/vendor/psr/log/src/LoggerInterface.php b/vendor/psr/log/src/LoggerInterface.php new file mode 100644 index 0000000..b4d062b --- /dev/null +++ b/vendor/psr/log/src/LoggerInterface.php @@ -0,0 +1,125 @@ +log(LogLevel::EMERGENCY, $message, $context); + } + + /** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + * + * @param string|\Stringable $message + * @param array $context + * + * @return void + */ + public function alert(string|\Stringable $message, array $context = []) + { + $this->log(LogLevel::ALERT, $message, $context); + } + + /** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + * + * @param string|\Stringable $message + * @param array $context + * + * @return void + */ + public function critical(string|\Stringable $message, array $context = []) + { + $this->log(LogLevel::CRITICAL, $message, $context); + } + + /** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + * + * @param string|\Stringable $message + * @param array $context + * + * @return void + */ + public function error(string|\Stringable $message, array $context = []) + { + $this->log(LogLevel::ERROR, $message, $context); + } + + /** + * Exceptional occurrences that are not errors. + * + * Example: Use of deprecated APIs, poor use of an API, undesirable things + * that are not necessarily wrong. + * + * @param string|\Stringable $message + * @param array $context + * + * @return void + */ + public function warning(string|\Stringable $message, array $context = []) + { + $this->log(LogLevel::WARNING, $message, $context); + } + + /** + * Normal but significant events. + * + * @param string|\Stringable $message + * @param array $context + * + * @return void + */ + public function notice(string|\Stringable $message, array $context = []) + { + $this->log(LogLevel::NOTICE, $message, $context); + } + + /** + * Interesting events. + * + * Example: User logs in, SQL logs. + * + * @param string|\Stringable $message + * @param array $context + * + * @return void + */ + public function info(string|\Stringable $message, array $context = []) + { + $this->log(LogLevel::INFO, $message, $context); + } + + /** + * Detailed debug information. + * + * @param string|\Stringable $message + * @param array $context + * + * @return void + */ + public function debug(string|\Stringable $message, array $context = []) + { + $this->log(LogLevel::DEBUG, $message, $context); + } + + /** + * Logs with an arbitrary level. + * + * @param mixed $level + * @param string|\Stringable $message + * @param array $context + * + * @return void + * + * @throws \Psr\Log\InvalidArgumentException + */ + abstract public function log($level, string|\Stringable $message, array $context = []); +} diff --git a/vendor/psr/log/src/NullLogger.php b/vendor/psr/log/src/NullLogger.php new file mode 100644 index 0000000..5607705 --- /dev/null +++ b/vendor/psr/log/src/NullLogger.php @@ -0,0 +1,30 @@ +logger) { }` + * blocks. + */ +class NullLogger extends AbstractLogger +{ + /** + * Logs with an arbitrary level. + * + * @param mixed $level + * @param string|\Stringable $message + * @param array $context + * + * @return void + * + * @throws \Psr\Log\InvalidArgumentException + */ + public function log($level, string|\Stringable $message, array $context = []) + { + // noop + } +}