montée version phpcas et image nineapache
Cadoles/nineskeletor/pipeline/head There was a failure building this commit Details

This commit is contained in:
afornerot 2024-09-28 10:06:59 +02:00
parent 45c01d62db
commit 37bfdb3338
7 changed files with 80 additions and 23 deletions

View File

@ -99,11 +99,9 @@
},
"scripts": {
"auto-scripts": {
"npm ci": "script",
"npm run encore -- dev": "script",
"npm run encore -- prod": "script",
"cache:clear --env=dev": "symfony-cmd",
"cache:clear --env=prod": "symfony-cmd",
"yarn install": "script",
"yarn encore prod": "script",
"cache:clear --env=PROD": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [

View File

@ -60,6 +60,7 @@ services:
context: .
dockerfile: ./misc/images/app/app-docker/Dockerfile
container_name: nineskeletor-app
image: reg.cadoles.com/envole/nineskeletor
ports:
- ${APP_HTTP_PORT:-8080}:8080
links:

View File

@ -1,12 +1,18 @@
ARG PHP_PKG_VERSION="8.1.22-r0"
ARG ADDITIONAL_PACKAGES="tree \
php81-gd=${PHP_PKG_VERSION} \
php81-sodium=${PHP_PKG_VERSION} \
php81-fileinfo=${PHP_PKG_VERSION} \
php81-pdo=${PHP_PKG_VERSION} \
php81-pdo_pgsql=${PHP_PKG_VERSION} \
php81-intl=${PHP_PKG_VERSION} \
php81-ldap=${PHP_PKG_VERSION} \
php81-pecl-redis=5.3.7-r0"
FROM reg.cadoles.com/envole/nineapache:8.1
FROM reg.cadoles.com/cadoles/symfony:alpine-php-8.1-standalone
COPY ./misc/images/app/app-docker/apache.conf /etc/apache2/conf.d/nine/site.conf
RUN echo "* * * * * /app/bin/console app:Cron --env=prod" >> /var/spool/cron/crontabs/root
WORKDIR /app
COPY . .
# Installation des dépendances composer
RUN composer install --no-interaction
RUN mkdir -p /app/var
RUN chown apache /app/var -R
RUN chmod u+w /app/var -R
RUN chmod g+w /app/var -R
CMD /app/misc/script/reconfigure.sh && /etc/apache2/apache2.sh

View File

@ -0,0 +1,19 @@
LoadModule rewrite_module modules/mod_rewrite.so
ServerName nineapache.local
DocumentRoot "/app/public"
Alias /nineskeletor /app/public
<Directory "/app/public">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
RewriteEngine On
RewriteCond %{REQUEST_URI}::$0 ^(/.+)/(.*)::\2$
RewriteRule .* - [E=BASE:%1]
RewriteCond %{HTTP:Authorization} .+
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0]
RewriteCond %{ENV:REDIRECT_STATUS} =""
RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ %{ENV:BASE}/index.php [L]
</Directory>

View File

@ -0,0 +1,12 @@
ARG PHP_PKG_VERSION="8.1.22-r0"
ARG ADDITIONAL_PACKAGES="tree \
php81-gd=${PHP_PKG_VERSION} \
php81-sodium=${PHP_PKG_VERSION} \
php81-fileinfo=${PHP_PKG_VERSION} \
php81-pdo=${PHP_PKG_VERSION} \
php81-pdo_pgsql=${PHP_PKG_VERSION} \
php81-intl=${PHP_PKG_VERSION} \
php81-ldap=${PHP_PKG_VERSION} \
php81-pecl-redis=5.3.7-r0"
FROM reg.cadoles.com/cadoles/symfony:alpine-php-8.1-standalone

17
misc/script/reconfigure.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
set -eo pipefail
# Se positionner sur la racine du projet
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd ${DIR}
cd ../..
DIR=$(pwd)
bin/console d:s:u --force --complete
yarn encore prod
bin/console app:Init
bin/console app:Cron
exec $@

View File

@ -81,9 +81,10 @@ class SecurityController extends AbstractController
$appMasteridentity = $this->getParameter('appMasteridentity');
// Init Client CAS
$alias = $this->getParameter('appAlias');
\phpCAS::setDebug($this->appKernel->getProjectDir().'/var/log/cas.log');
\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('casHost'), intval($this->getParameter('casPort')), is_null($this->getParameter('casPath')) ? '' : $this->getParameter('casPath'), false);
$url=$this->getHost($request);
$url=str_replace("http://",$this->getParameter("protocole")."://",$url);
$url=str_replace("https://",$this->getParameter("protocole")."://",$url);
\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('casHost'), intval($this->getParameter('casPort')), is_null($this->getParameter('casPath')) ? '' : $this->getParameter('casPath'), $url, false);
\phpCAS::setNoCasServerValidation();
// Authentification
@ -352,13 +353,16 @@ class SecurityController extends AbstractController
$request->getSession()->invalidate();
// Init Client CAS
$alias = $this->getParameter('appAlias');
\phpCAS::setDebug($this->appKernel->getProjectDir().'/var/log/cas.log');
\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('casHost'), intval($this->getParameter('casPort')), is_null($this->getParameter('casPath')) ? '' : $this->getParameter('casPath'), false);
$url=$this->getHost($request);
$url=str_replace("http://",$this->getParameter("protocole")."://",$url);
$url=str_replace("https://",$this->getParameter("protocole")."://",$url);
\phpCAS::client(CAS_VERSION_2_0, $this->getParameter('casHost'), intval($this->getParameter('casPort')), is_null($this->getParameter('casPath')) ? '' : $this->getParameter('casPath'), $url, false);
\phpCAS::setNoCasServerValidation();
// Logout
$url = $this->generateUrl('app_home', [], UrlGeneratorInterface::ABSOLUTE_URL);
$url=$this->generateUrl('app_home', array(), UrlGeneratorInterface::ABSOLUTE_URL);
$url=str_replace("http://",$this->getParameter("protocole")."://",$url);
$url=str_replace("https://",$this->getParameter("protocole")."://",$url);
\phpCAS::logout(['service' => $url]);
return true;