correction ninedocker
Cadoles/nineskeletor/pipeline/head There was a failure building this commit Details

This commit is contained in:
afornerot 2024-09-28 17:22:48 +02:00
parent 6a5e14a25e
commit 0cdb425ad7
8 changed files with 38 additions and 34 deletions

1
.env
View File

@ -2,6 +2,7 @@
APP_ENV=dev APP_ENV=dev
APP_SECRET=changeme APP_SECRET=changeme
APP_SESSIONTIME=1440 APP_SESSIONTIME=1440
PROTOCOLE=https
# Webpack # Webpack
APP_PUBLIC_PATH=/nineskeletor/build APP_PUBLIC_PATH=/nineskeletor/build

View File

@ -15,7 +15,7 @@
"friendsofsymfony/ckeditor-bundle": "^2.4", "friendsofsymfony/ckeditor-bundle": "^2.4",
"friendsofsymfony/rest-bundle": "^3.3", "friendsofsymfony/rest-bundle": "^3.3",
"gregwar/captcha-bundle": "^2.2", "gregwar/captcha-bundle": "^2.2",
"jasig/phpcas": "^1.5", "jasig/phpcas": "^1.6",
"mashape/unirest-php": "^3.0", "mashape/unirest-php": "^3.0",
"nelmio/api-doc-bundle": "^4.9", "nelmio/api-doc-bundle": "^4.9",
"oneup/uploader-bundle": "^3.2", "oneup/uploader-bundle": "^3.2",

20
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "dc1aeeadbcecb4aa48c52c26ec8b74bf", "content-hash": "60bf16e083bd33ab708cf0568e170d7b",
"packages": [ "packages": [
{ {
"name": "aws/aws-crt-php", "name": "aws/aws-crt-php",
@ -2492,16 +2492,16 @@
}, },
{ {
"name": "jasig/phpcas", "name": "jasig/phpcas",
"version": "1.5.0", "version": "1.6.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/apereo/phpCAS.git", "url": "https://github.com/apereo/phpCAS.git",
"reference": "d6f5797fb568726f34c8e48741776d81e4a2646b" "reference": "c129708154852656aabb13d8606cd5b12dbbabac"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/apereo/phpCAS/zipball/d6f5797fb568726f34c8e48741776d81e4a2646b", "url": "https://api.github.com/repos/apereo/phpCAS/zipball/c129708154852656aabb13d8606cd5b12dbbabac",
"reference": "d6f5797fb568726f34c8e48741776d81e4a2646b", "reference": "c129708154852656aabb13d8606cd5b12dbbabac",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2522,6 +2522,9 @@
} }
}, },
"autoload": { "autoload": {
"files": [
"source/CAS.php"
],
"classmap": [ "classmap": [
"source/" "source/"
] ]
@ -2554,9 +2557,10 @@
], ],
"support": { "support": {
"issues": "https://github.com/apereo/phpCAS/issues", "issues": "https://github.com/apereo/phpCAS/issues",
"source": "https://github.com/apereo/phpCAS/tree/1.5.0" "source": "https://github.com/apereo/phpCAS/tree/1.6.1"
}, },
"time": "2022-05-03T21:12:54+00:00" "abandoned": "apereo/phpcas",
"time": "2023-02-19T19:52:35+00:00"
}, },
{ {
"name": "jean85/pretty-package-versions", "name": "jean85/pretty-package-versions",
@ -13654,5 +13658,5 @@
"ext-iconv": "*" "ext-iconv": "*"
}, },
"platform-dev": [], "platform-dev": [],
"plugin-api-version": "2.2.0" "plugin-api-version": "2.3.0"
} }

View File

@ -2,6 +2,7 @@ parameters:
appEnv: "%env(resolve:APP_ENV)%" appEnv: "%env(resolve:APP_ENV)%"
appSecret: "%env(resolve:APP_SECRET)%" appSecret: "%env(resolve:APP_SECRET)%"
appSessiontime: "%env(resolve:APP_SESSIONTIME)%" appSessiontime: "%env(resolve:APP_SESSIONTIME)%"
protocole: '%env(resolve:PROTOCOLE)%'
appWeburl: "%env(resolve:APP_WEBURL)%" appWeburl: "%env(resolve:APP_WEBURL)%"
appAuth: "%env(resolve:APP_AUTH)%" appAuth: "%env(resolve:APP_AUTH)%"

View File

@ -10,10 +10,6 @@ COPY . .
# Installation des dépendances composer # Installation des dépendances composer
RUN composer install --no-interaction RUN composer install --no-interaction
RUN mkdir -p /app/public/uploads
RUN chown apache /app/public/uploads -R
RUN chmod u+w /app/public/uploads -R
RUN mkdir -p /app/var RUN mkdir -p /app/var
RUN chown apache /app/var -R RUN chown apache /app/var -R
RUN chmod u+w /app/var -R RUN chmod u+w /app/var -R

View File

@ -9,19 +9,9 @@ DIR=$(pwd)
bin/console d:s:u --force --complete bin/console d:s:u --force --complete
# Si l'alias courrant est différent que celui généré = on compile encore yarn encore prod
last_alias=""
if [ -f .alias ]; then
last_alias=$(cat .alias)
fi
if [ "$APP_MANIFEST_KEY_PREFIX" != "$last_alias" ]; then
echo "Alias a changé. Recompilation nécessaire."
echo "$APP_MANIFEST_KEY_PREFIX" > .alias
yarn encore dev
yarn encore prod
fi
bin/console app:Init bin/console app:Init
bin/console app:Cron
exec $@ exec $@

View File

@ -108,7 +108,7 @@ class InitCommand extends Command
if (!$niveau01) { if (!$niveau01) {
$niveau01 = new Niveau01(); $niveau01 = new Niveau01();
$niveau01->setId(-1); $niveau01->setId(-1);
$niveau01->setLabel($this->appname); $niveau01->setLabel("Nineskeletor");
$niveau01->setApikey(Uuid::uuid4()); $niveau01->setApikey(Uuid::uuid4());
$this->em->persist($niveau01); $this->em->persist($niveau01);
$this->em->flush(); $this->em->flush();

View File

@ -81,9 +81,10 @@ class SecurityController extends AbstractController
$appMasteridentity = $this->getParameter('appMasteridentity'); $appMasteridentity = $this->getParameter('appMasteridentity');
// Init Client CAS // Init Client CAS
$alias = $this->getParameter('appAlias'); $url=$this->getHost($request);
\phpCAS::setDebug($this->appKernel->getProjectDir().'/var/log/cas.log'); $url=str_replace("http://",$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'), false); $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(); \phpCAS::setNoCasServerValidation();
// Authentification // Authentification
@ -352,14 +353,17 @@ class SecurityController extends AbstractController
$request->getSession()->invalidate(); $request->getSession()->invalidate();
// Init Client CAS // Init Client CAS
$alias = $this->getParameter('appAlias'); $url=$this->getHost($request);
\phpCAS::setDebug($this->appKernel->getProjectDir().'/var/log/cas.log'); $url=str_replace("http://",$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'), false); $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(); \phpCAS::setNoCasServerValidation();
// Logout // Logout
$url = $this->generateUrl('app_home', [], UrlGeneratorInterface::ABSOLUTE_URL); $url=$this->generateUrl('app_home', array(), UrlGeneratorInterface::ABSOLUTE_URL);
\phpCAS::logout(['service' => $url]); $url=str_replace("http://",$this->getParameter("protocole")."://",$url);
$url=str_replace("https://",$this->getParameter("protocole")."://",$url);
\phpCAS::logout(array("service"=>$url));
return true; return true;
} }
@ -576,4 +580,12 @@ class SecurityController extends AbstractController
return $this->redirect($this->generateUrl('app_home')); return $this->redirect($this->generateUrl('app_home'));
} }
} }
private function getHost($request) {
$host = $request->getHost();
$protocol = $request->getScheme();
$port = $request->getPort();
return $protocol."://".$host.($port!=80&&$port!=443?":".$port:"");
}
} }