...
| Bloc de code |
|---|
|
apt install openjdk-11-jdk-headless tomcat9 curl unzip |
CAS Initializr
Pour construire notre CAS, on ajoute dans le .bashrc de l'utilisateur cas :
...
| Bloc de code |
|---|
|
cas@cas:/opt/overlay$ git diff
warning: LF will be replaced by CRLF in build.gradle.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in gradle.properties.
The file will have its original line endings in your working directory
diff --git a/build.gradle b/build.gradle
index bb8758e..6cffd74 100644
--- a/build.gradle
+++ b/build.gradle
@@ -82,6 +82,9 @@ repositories {
}
mavenContent { releasesOnly() }
}
+ maven {
+ url "https://jitpack.io"
+ }
}
@@ -273,11 +276,15 @@ dependencies {
implementation "org.apereo.cas:cas-server-support-json-service-registry"
implementation "org.apereo.cas:cas-server-support-redis-ticket-registry"
implementation "org.apereo.cas:cas-server-support-spnego-webflow"
+ implementation files("${projectDir}/lib/jcifs-ext.jar")
implementation "org.apereo.cas:cas-server-support-trusted-mfa-mongo"
implementation "org.apereo.cas:cas-server-support-throttle"
implementation "org.apereo.cas:cas-server-support-reports"
implementation "org.apereo.cas:cas-server-support-interrupt-webflow"
implementation "org.apereo.cas:cas-server-support-oidc"
+ implementation "com.github.vbonamy:cas-server-support-agimus-cookie:cas-6.4.x-SNAPSHOT"
+ implementation "com.github.vbonamy:cas-server-support-agimus-logs:cas-6.4.x-SNAPSHOT"
+ implementation "com.github.EsupPortail:esup-otp-cas:6.6.x-SNAPSHOT"
if (project.hasProperty("casModules")) {
diff --git a/gradle.properties b/gradle.properties
index e33296a..d875561 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -29,7 +29,7 @@ dockerImagePlatform=amd64:linux
# Include launch script for executable WAR artifact
# Setting this to true allows the final web application
# to be fully executable on its own
-executable=true
+executable=false
@@ -37,7 +37,7 @@ executable=true
# if the overlay application supports or provides the chosen type.
# You should set this to blank if you want to deploy to an external container.
# and want to set up, download and manage the container (i.e. Apache Tomcat) yourself.
-appServer=-tomcat
+appServer=
# Settings to generate keystore
# used by the build to assist with creating
cas@cas:/opt/overlay$ git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: build.gradle
modified: gradle.properties
Untracked files:
(use "git add <file>..." to include in what will be committed)
lib/
src/main/resources/static/
src/main/resources/templates/
no changes added to commit (use "git add" and/or "git commit -a")
cas@cas:/opt/overlay$ tree src/main/resources/static/ src/main/resources/templates/ lib/
src/main/resources/static/
??? images
??? cas-logo.png
??? logo_universite_rouen.svg
src/main/resources/templates/
??? fragments
? ??? footer.html
? ??? pmlinks.html
??? layout.html
lib/
??? jcifs-ext.jar
2 directories, 6 files
|
Puis on commit.
Packaging
Depuis /opt/overlay on lance le packaging via gradle :
| Bloc de code |
|---|
|
./gradlew clean build |
Configuration du tomcat
On a choisi ici l'utilisation du tomcat9 founi par debian, on modifie /var/lib/tomcat9/conf/server.xml pour ne pas loguer les accès (qui seront logués par le apache en frontal), désactiver le connecteur http et activer le connecteur ajp.
Déploiement
| Bloc de code |
|---|
|
rm -rf /var/lib/tomcat9/webapps/ROOT && unzip /opt/overlay/build/libs/cas.war -d /var/lib/tomcat9/webapps/ROOT |
Configuration du démarrage et démarrage
| Bloc de code |
|---|
|
systemctl enable tomcat9
systemctl restart tomcat9 |