diff --git a/README.md b/README.md index a6f9da3..24243e0 100644 --- a/README.md +++ b/README.md @@ -4,21 +4,24 @@ Docker deployment of the [DBPTK User Interface](https://github.com/keeps/dbptk-ui) as a Web application. -### Deploy +## Deploy + We suggest you use docker on Linux. Docker on Windows will require you to edit the docker-compose.yaml and transform all config path to Windows path style. This deployment comes with CAS configured. For more information consult the [README](deploys/development/README.md). Pre-requisites: + 1. Install [docker](https://docs.docker.com/install/) 2. Install [docker compose](https://docs.docker.com/compose/install/) 3. Download and unzip this [project](https://github.com/keeps/dbptk-enterprise/archive/master.zip) -4. For more information about CAS configuration see [README](deploys/development/README.md) +4. For more information about CAS configuration see [README](deploys/development/README.md#cas) 5. Open a terminal within `deploys/development` folder 6. Run `docker-compose up` 7. Application should be available at [http://localhost:8080](http://localhost:8080) ### To add more databases to DBPTK Enterprise via REST API + 1. Update dbvtk-viewer.properties file and set *manage.upload.basePath* property with a path to the SIARD folder (reload the docker-compose to apply the changes) 2. Replace the `` with the name of the SIARD then run: ``curl -X POST "http://localhost:8080/api/v1/database" -H "accept: text/plain" -H "Content-Type: application/json" -d ""`` @@ -41,7 +44,6 @@ Run `docker-compose up -d` at deploys/development folder. Run `docker-compose down` at deploys/development folder. - ## More information Configuration options are detailed in the [DBPTK UI Wiki](https://github.com/keeps/dbptk-ui/wiki). diff --git a/deploys/development/README.md b/deploys/development/README.md index d71c7ea..512144a 100644 --- a/deploys/development/README.md +++ b/deploys/development/README.md @@ -1,13 +1,13 @@ # CAS -### Configure available users +## Configure available users On `cas/` directory there are two files: * users.txt - one user per line with the following syntax: `::` * attribute-repository.json - a JSON file with a set of attributes per user -#### Pratical example +## Practical example Let's add a new user to CAS that belongs to the administrators with username "test". To do so we need to edit the `users.txt` file and add the following line: @@ -38,4 +38,4 @@ $ docker-compose up -d # if not hit CTRL+C and start the service again $ docker-compose up -``` \ No newline at end of file +``` diff --git a/deploys/development/cas/cas.properties b/deploys/development/cas/cas.properties index fffa6ad..f085f3a 100644 --- a/deploys/development/cas/cas.properties +++ b/deploys/development/cas/cas.properties @@ -1,38 +1,25 @@ #### DO NOT CHANGE ANY PROPERTY, UNLESS YOU KNOW WHAT YOU ARE DOING #### - -server.servlet.context-path=/cas - -server.port=8443 - -cas.server.tomcat.http.port=8080 -cas.server.tomcat.http.protocol=org.apache.coyote.http11.Http11NioProtocol -cas.server.tomcat.http.enabled=true -cas.server.tomcat.http.attributes.attribute-name=attributeValue - -#logging.level.org.apereo.cas=DEBUG +cas.server.name=http://localhost:8080 +cas.server.prefix=http://localhost:8080/cas server.ssl.keyStore=file:/etc/cas/thekeystore server.ssl.keyStorePassword=changeit server.ssl.keyPassword=changeit -server.max-http-header-size=2097152 -#server.useForwardHeaders=true - -cas.server.name=http://localhost:8080 -cas.server.prefix=http://localhost:8080/cas +cas.service-registry.json.location=file:///etc/cas/services cas.authn.accept.users= -cas.authn.file.separator=:: -cas.authn.file.filename=file:///etc/cas/config/users.txt -cas.authn.file.name= -cas.authn.attribute-repository.json[0].location=file:/etc/cas/attribute-repository.json +cas.authn.attribute-repository.json[0].location=file:///etc/cas/attribute-repository.json cas.authn.attribute-repository.json[0].order=0 -cas.authn.attribute-repository.json[0].id=MyJson -cas.service-registry.json.location=file:/etc/cas/config/services +cas.authn.file.password-encoder.encoding-algorithm= +cas.authn.file.password-encoder.type=NONE +cas.authn.file.separator=:: +cas.authn.file.filename=file:///etc/cas/users.txt + +cas.server.tomcat.http[0].port=8080 +cas.server.tomcat.http[0].protocol=org.apache.coyote.http11.Http11NioProtocol +cas.server.tomcat.http[0].enabled=true -cas.logout.followServiceRedirects=true -cas.logout.redirectParameter=service -cas.logout.confirmLogout=true -cas.slo.disabled=false +cas.logout.follow-service-redirects=true diff --git a/deploys/development/docker-compose.yml b/deploys/development/docker-compose.yml index 0dd93d0..6bf9a03 100644 --- a/deploys/development/docker-compose.yml +++ b/deploys/development/docker-compose.yml @@ -2,6 +2,7 @@ version: "3.2" services: dbptke: image: keeps/dbvtk:latest + container_name: dbptk-enterprise networks: - zoonet ports: @@ -23,15 +24,17 @@ services: - solr entrypoint: java -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar /app.war solr: - image: solr:8.4 + image: solr:8 + container_name: solr networks: - zoonet ports: - 8983:8983 command: -c # Use cloud mode cas: - image: cas:latest - build: + image: docker.io/library/cas:latest + container_name: cas + build: context: ./image/cas networks: - zoonet @@ -40,8 +43,8 @@ services: volumes: - ./thekeystore:/etc/cas/thekeystore - ./cas/attribute-repository.json:/etc/cas/attribute-repository.json - - ./cas/users.txt:/etc/cas/config/users.txt - - ./cas/services:/etc/cas/config/services + - ./cas/users.txt:/etc/cas/users.txt + - ./cas/services:/etc/cas/services - ./cas/cas.properties:/etc/cas/config/cas.properties networks: diff --git a/deploys/development/image/cas/.gradle/4.4.1/fileChanges/last-build.bin b/deploys/development/image/cas/.gradle/4.4.1/fileChanges/last-build.bin deleted file mode 100644 index f76dd23..0000000 Binary files a/deploys/development/image/cas/.gradle/4.4.1/fileChanges/last-build.bin and /dev/null differ diff --git a/deploys/development/image/cas/.gradle/4.4.1/fileHashes/fileHashes.lock b/deploys/development/image/cas/.gradle/4.4.1/fileHashes/fileHashes.lock deleted file mode 100644 index a3aaa9e..0000000 Binary files a/deploys/development/image/cas/.gradle/4.4.1/fileHashes/fileHashes.lock and /dev/null differ diff --git a/deploys/development/image/cas/.gradle/4.4.1/taskHistory/taskHistory.lock b/deploys/development/image/cas/.gradle/4.4.1/taskHistory/taskHistory.lock deleted file mode 100644 index 5ba1580..0000000 Binary files a/deploys/development/image/cas/.gradle/4.4.1/taskHistory/taskHistory.lock and /dev/null differ diff --git a/deploys/development/image/cas/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/deploys/development/image/cas/.gradle/buildOutputCleanup/buildOutputCleanup.lock deleted file mode 100644 index 70eaa53..0000000 Binary files a/deploys/development/image/cas/.gradle/buildOutputCleanup/buildOutputCleanup.lock and /dev/null differ diff --git a/deploys/development/image/cas/.gradle/buildOutputCleanup/cache.properties b/deploys/development/image/cas/.gradle/buildOutputCleanup/cache.properties deleted file mode 100644 index 2af679c..0000000 --- a/deploys/development/image/cas/.gradle/buildOutputCleanup/cache.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Wed May 04 09:33:20 WEST 2022 -gradle.version=4.4.1 diff --git a/deploys/development/image/cas/Dockerfile b/deploys/development/image/cas/Dockerfile index 3e8665a..8cb4a7b 100644 --- a/deploys/development/image/cas/Dockerfile +++ b/deploys/development/image/cas/Dockerfile @@ -1,14 +1,22 @@ -FROM adoptopenjdk/openjdk11:alpine-slim AS overlay +ARG BASE_IMAGE="eclipse-temurin:11-jdk" +ARG EXT_BUILD_COMMANDS="" +ARG EXT_BUILD_OPTIONS="" + +FROM eclipse-temurin:11-jdk-alpine AS overlay RUN apk add --no-cache git \ - && mkdir -p /tmp/cas-overlay \ - && git clone -b 6.5 --single-branch https://github.com/apereo/cas-overlay-template.git /tmp/cas-overlay + && mkdir -p /tmp/cas-overlay \ + && git clone -b 6.6 --single-branch https://github.com/apereo/cas-overlay-template.git /tmp/cas-overlay RUN mkdir -p cas-overlay +RUN cp -r /tmp/cas-overlay/src cas-overlay/src/ +RUN cp -r /tmp/cas-overlay/gradle/ cas-overlay/gradle/ -RUN cp -r /tmp/cas-overlay/src/ /cas-overlay/src/ \ - && cp -r /tmp/cas-overlay/gradle/ /cas-overlay/gradle/ \ - && cp -r /tmp/cas-overlay/gradlew /tmp/cas-overlay/settings.gradle /tmp/cas-overlay/build.gradle /tmp/cas-overlay/gradle.properties /cas-overlay/ +RUN cp -r /tmp/cas-overlay/gradlew /cas-overlay/ +RUN cp -r /tmp/cas-overlay/settings.gradle /cas-overlay/ +RUN cp -r /tmp/cas-overlay/build.gradle /cas-overlay/ +RUN cp -r /tmp/cas-overlay/gradle.properties /cas-overlay/ +RUN cp -r /tmp/cas-overlay/lombok.config /cas-overlay/ RUN rm -rf /tmp/cas-overlay @@ -19,29 +27,27 @@ RUN mkdir -p ~/.gradle \ && chmod 750 ./gradlew \ && ./gradlew --version; -COPY ./build/build.gradle /cas-overlay/ +COPY ./build.gradle /cas-overlay/ RUN cd cas-overlay \ - && ./gradlew clean build --parallel --no-daemon \ - && ./gradlew createKeystore - + && ./gradlew clean build $EXT_BUILD_COMMANDS --parallel --no-daemon $EXT_BUILD_OPTIONS; -FROM adoptopenjdk/openjdk11:alpine-jre AS cas +FROM $BASE_IMAGE AS cas LABEL "Organization"="Apereo" LABEL "Description"="Apereo CAS" RUN cd / \ && mkdir -p /etc/cas/config \ + && mkdir -p /etc/cas/services \ + && mkdir -p /etc/cas/saml \ && mkdir -p cas-overlay; COPY --from=overlay cas-overlay/build/libs/cas.war cas-overlay/ -COPY --from=overlay etc/cas/thekeystore /etc/cas/thekeystore -COPY ./etc/cas/ /etc/cas/ EXPOSE 8080 8443 ENV PATH $PATH:$JAVA_HOME/bin:. -WORKDIR /cas-overlay -ENTRYPOINT ["java", "-server", "-noverify", "-Xmx2048M", "-jar", "cas.war"] \ No newline at end of file +WORKDIR cas-overlay +ENTRYPOINT ["java", "-server", "-noverify", "-Xmx2048M", "-jar", "cas.war"] diff --git a/deploys/development/image/cas/build.gradle b/deploys/development/image/cas/build.gradle new file mode 100644 index 0000000..c890a48 --- /dev/null +++ b/deploys/development/image/cas/build.gradle @@ -0,0 +1,286 @@ +import org.apache.tools.ant.taskdefs.condition.* +import org.gradle.internal.logging.text.* +import org.apereo.cas.metadata.* +import java.nio.file.* +import org.gradle.internal.logging.text.* +import static org.gradle.internal.logging.text.StyledTextOutput.Style + +buildscript { + repositories { + if (project.privateRepoUrl) { + maven { + url project.privateRepoUrl + credentials { + username = project.privateRepoUsername + password = System.env.PRIVATE_REPO_TOKEN + } + } + } + mavenLocal() + mavenCentral() + gradlePluginPortal() + maven { + url 'https://oss.sonatype.org/content/repositories/snapshots' + mavenContent { snapshotsOnly() } + } + maven { + url "https://repo.spring.io/milestone" + mavenContent { releasesOnly() } + } + } + dependencies { + classpath "org.springframework.boot:spring-boot-gradle-plugin:${project.springBootVersion}" + classpath "io.freefair.gradle:maven-plugin:${project.gradleFreeFairPluginVersion}" + classpath "io.freefair.gradle:lombok-plugin:${project.gradleFreeFairPluginVersion}" + classpath "io.spring.gradle:dependency-management-plugin:${project.gradleDependencyManagementPluginVersion}" + classpath "com.google.cloud.tools:jib-gradle-plugin:${project.jibVersion}" + classpath "com.bmuschko:gradle-docker-plugin:${project.gradleDockerPluginVersion}" + + classpath "de.undercouch:gradle-download-task:${project.gradleDownloadTaskVersion}" + classpath "org.apereo.cas:cas-server-core-api-configuration-model:${project.'cas.version'}" + classpath "org.apereo.cas:cas-server-core-configuration-metadata-repository:${project.'cas.version'}" + } +} + +repositories { + if (project.privateRepoUrl) { + maven { + url project.privateRepoUrl + credentials { + username = project.privateRepoUsername + password = System.env.PRIVATE_REPO_TOKEN + } + } + } + mavenLocal() + mavenCentral() + maven { url 'https://oss.sonatype.org/content/repositories/releases' } + maven { + url 'https://oss.sonatype.org/content/repositories/snapshots' + mavenContent { snapshotsOnly() } + } + maven { + url "https://repository.apache.org/content/repositories/snapshots" + mavenContent { snapshotsOnly() } + } + maven { + url 'https://build.shibboleth.net/nexus/content/repositories/releases/' + mavenContent { releasesOnly() } + } + maven { + url "https://build.shibboleth.net/nexus/content/repositories/snapshots" + mavenContent { snapshotsOnly() } + } + maven { + url "https://repo.spring.io/milestone" + mavenContent { releasesOnly() } + } + maven { + url "https://jitpack.io" + content { + includeGroupByRegex ".*wss4j.*" + } + mavenContent { releasesOnly() } + } +} + + +apply plugin: "io.freefair.war-overlay" +apply plugin: "war" + +apply plugin: "org.springframework.boot" +apply plugin: "io.freefair.lombok" + + +apply from: rootProject.file("gradle/springboot.gradle") +apply plugin: "com.google.cloud.tools.jib" +apply plugin: "com.bmuschko.docker-remote-api" +apply from: rootProject.file("gradle/tasks.gradle") + + +configurations { + all { + resolutionStrategy { + cacheChangingModulesFor 0, "seconds" + cacheDynamicVersionsFor 0, "seconds" + preferProjectModules() + def failIfConflict = project.hasProperty("failOnVersionConflict") && Boolean.valueOf(project.getProperty("failOnVersionConflict")) + if (failIfConflict) { + failOnVersionConflict() + } + } + exclude(group: "cglib", module: "cglib") + exclude(group: "cglib", module: "cglib-full") + exclude(group: "org.slf4j", module: "slf4j-log4j12") + exclude(group: "org.slf4j", module: "slf4j-simple") + exclude(group: "org.slf4j", module: "jcl-over-slf4j") + exclude(group: "org.apache.logging.log4j", module: "log4j-to-slf4j") + } +} + +war { + entryCompression = ZipEntryCompression.STORED + enabled = false +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(project.targetCompatibility) + } +} + +bootBuildImage { + imageName = "${project.'containerImageOrg'}/${project.'containerImageName'}:${project.version}" +} + + +['jibDockerBuild', 'jibBuildTar', 'jib'].each { taskName -> + if (gradle.gradleVersion >= "8.0") { + getTasksByName(taskName, true).each(it -> { + it.notCompatibleWithConfigurationCache("Jib is not compatible with configuration cache"); + it.enabled = !gradle.startParameter.isConfigurationCacheRequested() + }) + } +} + +def imagePlatforms = project.dockerImagePlatform.split(",") +def dockerUsername = providers.systemProperty("dockerUsername").getOrNull() +def dockerPassword = providers.systemProperty("dockerPassword").getOrNull() +def imageTagPostFix = providers.systemProperty("dockerImageTagPostfix").getOrElse("") + +jib { + if (gradle.gradleVersion >= "8.0" && gradle.startParameter.isConfigurationCacheRequested()) { + def out = services.get(StyledTextOutputFactory).create("cas") + out.withStyle(Style.Info).println("You are seeing this message because the Gradle configuration cache is turned on") + out.withStyle(Style.Info).println("Running Jib tasks to produce Docker images will require the command-line option: --no-configuration-cache") + out.withStyle(Style.Info).println("Jib does not support the Gradle configuration cache; Please see https://github.com/GoogleContainerTools/jib/issues/3132") + out.withStyle(Style.Info).println("Jib tasks are disabled.") + } + from { + image = project.baseDockerImage + platforms { + imagePlatforms.each { + def given = it.split(":") + platform { + architecture = given[0] + os = given[1] + } + } + } + } + to { + image = "${project.'containerImageOrg'}/${project.'containerImageName'}:${project.version}" + /** + ecr-login: Amazon Elastic Container Registry (ECR) + gcr: Google Container Registry (GCR) + osxkeychain: Docker Hub + */ + credHelper = "osxkeychain" + if (dockerUsername != null && dockerPassword != null) { + auth { + username = "${dockerUsername}" + password = "${dockerPassword}" + } + } + tags = [project.version] + } + container { + creationTime = "USE_CURRENT_TIMESTAMP" + entrypoint = ['/docker/entrypoint.sh'] + ports = ['80', '443', '8080', '8443', '8444', '8761', '8888', '5000'] + labels = [version:project.version, name:project.name, group:project.group, org:project.containerImageOrg] + workingDirectory = '/docker/cas/war' + } + extraDirectories { + paths { + path { + from = file('src/main/jib') + } + path { + from = file('etc/cas') + into = '/etc/cas' + } + path { + from = file("build/libs") + into = "/docker/cas/war" + } + } + permissions = [ + '/docker/entrypoint.sh': '755' + ] + } + allowInsecureRegistries = project.allowInsecureRegistries +} + +import com.bmuschko.gradle.docker.tasks.image.* +tasks.register("casBuildDockerImage", DockerBuildImage) { + dependsOn("build") + + def imageTag = "${project.'cas.version'}" + inputDir = project.projectDir + images.add("apereo/cas:${imageTag}${imageTagPostFix}") + images.add("apereo/cas:latest${imageTagPostFix}") + if (dockerUsername != null && dockerPassword != null) { + username = dockerUsername + password = dockerPassword + } + doLast { + def out = services.get(StyledTextOutputFactory).create("cas") + out.withStyle(Style.Success).println("Built CAS images successfully.") + } +} + +tasks.register("casPushDockerImage", DockerPushImage) { + dependsOn("casBuildDockerImage") + + def imageTag = "${project.'cas.version'}" + images.add("apereo/cas:${imageTag}${imageTagPostFix}") + images.add("apereo/cas:latest${imageTagPostFix}") + + if (dockerUsername != null && dockerPassword != null) { + username = dockerUsername + password = dockerPassword + } + doLast { + def out = services.get(StyledTextOutputFactory).create("cas") + out.withStyle(Style.Success).println("Pushed CAS images successfully.") + } +} + +dependencies { + /** + * Do NOT modify the lines below or else you will risk breaking dependency management. + */ + implementation enforcedPlatform("org.apereo.cas:cas-server-support-bom:${project.'cas.version'}") + implementation platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES) + + /** + * Do NOT modify the lines below or else you will risk breaking the build. + */ + implementation "org.apereo.cas:cas-server-core-api-configuration-model" + implementation "org.apereo.cas:cas-server-webapp-init" + + developmentOnly "org.springframework.boot:spring-boot-devtools:${project.springBootVersion}" + + /** + * CAS dependencies and modules may be listed here. + * + * There is no need to specify the version number for each dependency + * since versions are all resolved and controlled by the dependency management + * plugin via the CAS bom. + **/ + implementation "org.apereo.cas:cas-server-support-generic" + implementation "org.apereo.cas:cas-server-support-json-service-registry" + + if (project.hasProperty("casModules")) { + def dependencies = project.getProperty("casModules").split(",") + dependencies.each { + def projectsToAdd = rootProject.subprojects.findAll {project -> + project.name == "cas-server-core-${it}" || project.name == "cas-server-support-${it}" + } + projectsToAdd.each {implementation it} + } + } + + testImplementation "org.springframework.boot:spring-boot-starter-test" +} diff --git a/deploys/development/image/cas/build/.gradle/4.4.1/fileChanges/last-build.bin b/deploys/development/image/cas/build/.gradle/4.4.1/fileChanges/last-build.bin deleted file mode 100644 index f76dd23..0000000 Binary files a/deploys/development/image/cas/build/.gradle/4.4.1/fileChanges/last-build.bin and /dev/null differ diff --git a/deploys/development/image/cas/build/.gradle/4.4.1/fileHashes/fileHashes.bin b/deploys/development/image/cas/build/.gradle/4.4.1/fileHashes/fileHashes.bin deleted file mode 100644 index 2098d0f..0000000 Binary files a/deploys/development/image/cas/build/.gradle/4.4.1/fileHashes/fileHashes.bin and /dev/null differ diff --git a/deploys/development/image/cas/build/.gradle/4.4.1/fileHashes/fileHashes.lock b/deploys/development/image/cas/build/.gradle/4.4.1/fileHashes/fileHashes.lock deleted file mode 100644 index 2f87ed6..0000000 Binary files a/deploys/development/image/cas/build/.gradle/4.4.1/fileHashes/fileHashes.lock and /dev/null differ diff --git a/deploys/development/image/cas/build/build.gradle b/deploys/development/image/cas/build/build.gradle deleted file mode 100644 index 0ac673a..0000000 --- a/deploys/development/image/cas/build/build.gradle +++ /dev/null @@ -1,143 +0,0 @@ -import org.apache.tools.ant.taskdefs.condition.* -import org.gradle.internal.logging.text.* -import org.apereo.cas.metadata.* -import java.nio.file.* -import static org.gradle.internal.logging.text.StyledTextOutput.Style - -buildscript { - repositories { - if (project.privateRepoUrl) { - maven { - url project.privateRepoUrl - credentials { - username = project.privateRepoUsername - password = System.env.PRIVATE_REPO_TOKEN - } - } - } - mavenLocal() - mavenCentral() - gradlePluginPortal() - maven { - url 'https://oss.sonatype.org/content/repositories/snapshots' - mavenContent { snapshotsOnly() } - } - maven { - url "https://repo.spring.io/milestone" - mavenContent { releasesOnly() } - } - } - dependencies { - classpath "org.springframework.boot:spring-boot-gradle-plugin:${project.springBootVersion}" - classpath "io.freefair.gradle:maven-plugin:${project.gradleFreeFairPluginVersion}" - classpath "io.freefair.gradle:lombok-plugin:${project.gradleFreeFairPluginVersion}" - classpath "io.spring.gradle:dependency-management-plugin:${project.gradleDependencyManagementPluginVersion}" - classpath "gradle.plugin.com.google.cloud.tools:jib-gradle-plugin:${project.jibVersion}" - - classpath "de.undercouch:gradle-download-task:${project.gradleDownloadTaskVersion}" - classpath "org.apereo.cas:cas-server-core-api-configuration-model:${project.'cas.version'}" - classpath "org.apereo.cas:cas-server-core-configuration-metadata-repository:${project.'cas.version'}" - } -} - -repositories { - if (project.privateRepoUrl) { - maven { - url project.privateRepoUrl - credentials { - username = project.privateRepoUsername - password = System.env.PRIVATE_REPO_TOKEN - } - } - } - mavenLocal() - mavenCentral() - maven { url 'https://oss.sonatype.org/content/repositories/releases' } - maven { - url 'https://oss.sonatype.org/content/repositories/snapshots' - mavenContent { snapshotsOnly() } - } - maven { url 'https://build.shibboleth.net/nexus/content/repositories/releases/' } - maven { - url "https://repo.spring.io/milestone" - mavenContent { releasesOnly() } - } -} - -apply plugin: "io.freefair.war-overlay" -apply plugin: "war" -apply plugin: "org.springframework.boot" -apply plugin: "io.freefair.lombok" - -apply from: rootProject.file("gradle/springboot.gradle") -apply from: rootProject.file("gradle/jib.gradle") -apply from: rootProject.file("gradle/tasks.gradle") - - -configurations.all { - resolutionStrategy { - cacheChangingModulesFor 0, "seconds" - cacheDynamicVersionsFor 0, "seconds" - preferProjectModules() - def failIfConflict = project.hasProperty("failOnVersionConflict") && Boolean.valueOf(project.getProperty("failOnVersionConflict")) - if (failIfConflict) { - failOnVersionConflict() - } - } -} - -war { - entryCompression = ZipEntryCompression.STORED - enabled = false -} - -sourceSets { - bootRunSources { - resources { - srcDirs new File("//etc/cas/templates/"), new File("${project.getProjectDir()}/src/main/resources/") - } - } -} - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(project.targetCompatibility) - } -} - -bootBuildImage { - imageName = "${project.'containerImageOrg'}/${project.'containerImageName'}:${project.version}" -} - -dependencies { - /** - * Do NOT modify the lines below or else you will risk breaking dependency management. - */ - implementation enforcedPlatform("org.apereo.cas:cas-server-support-bom:${project.'cas.version'}") - implementation platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES) - - /** - * CAS dependencies and modules may be listed here. - * - * There is no need to specify the version number for each dependency - * since versions are all resolved and controlled by the dependency management - * plugin via the CAS bom. - **/ - - implementation "org.apereo.cas:cas-server-core-api-configuration-model" - implementation "org.apereo.cas:cas-server-webapp-init" - implementation "org.apereo.cas:cas-server-support-generic" - implementation "org.apereo.cas:cas-server-support-json-service-registry" - - if (project.hasProperty("casModules")) { - def dependencies = project.getProperty("casModules").split(",") - dependencies.each { - def projectsToAdd = rootProject.subprojects.findAll {project -> - project.name == "cas-server-core-${it}" || project.name == "cas-server-support-${it}" - } - projectsToAdd.each {implementation it} - } - } - - developmentOnly "org.springframework.boot:spring-boot-devtools:${project.springBootVersion}" -} diff --git a/deploys/development/image/cas/etc/cas/attribute-repository.json b/deploys/development/image/cas/etc/cas/attribute-repository.json deleted file mode 100644 index 14c623a..0000000 --- a/deploys/development/image/cas/etc/cas/attribute-repository.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "admin": { - "fullname": ["Administrator"], - "email": ["admin@test.org"], - "memberOf": ["administrators", "users"] - }, - "user": { - "fullname": ["user"], - "email": ["user@test.org"], - "memberOf": ["users"] - } -} diff --git a/deploys/development/image/cas/etc/cas/config/application.yml b/deploys/development/image/cas/etc/cas/config/application.yml deleted file mode 100644 index be1f7c3..0000000 --- a/deploys/development/image/cas/etc/cas/config/application.yml +++ /dev/null @@ -1,2 +0,0 @@ -info: - description: CAS Configuration \ No newline at end of file diff --git a/deploys/development/image/cas/etc/cas/config/cas.properties b/deploys/development/image/cas/etc/cas/config/cas.properties deleted file mode 100644 index a6da430..0000000 --- a/deploys/development/image/cas/etc/cas/config/cas.properties +++ /dev/null @@ -1,39 +0,0 @@ -#### DO NOT CHANGE ANY PROPERTY, UNLESS YOU KNOW WHAT YOU ARE DOING #### - -#server.servlet.context-path=/cas - -server.port=8443 - -cas.server.tomcat.http.port=8080 -cas.server.tomcat.http.protocol=org.apache.coyote.http11.Http11NioProtocol -cas.server.tomcat.http.enabled=true -cas.server.tomcat.http.attributes.attribute-name=attributeValue - -logging.level.org.apereo.cas=DEBUG - -server.ssl.keyStore=file:/etc/cas/thekeystore -server.ssl.keyStorePassword=changeit -server.ssl.keyPassword=changeit - -server.max-http-header-size=2097152 -#server.useForwardHeaders=true - -cas.server.name=http://localhost:8080 -cas.server.prefix=http://localhost:8080/cas - -cas.authn.accept.users= -cas.authn.file.separator=:: -cas.authn.file.filename=file:///etc/cas/config/users.txt -cas.authn.file.name= - -cas.authn.attribute-repository.json[0].location=file:/etc/cas/attribute-repository.json -cas.authn.attribute-repository.json[0].order=0 -cas.authn.attribute-repository.json[0].id=MyJson - -cas.service-registry.init-from-json=true -cas.service-registry.json.location=file:/etc/cas/config/services - -cas.logout.followServiceRedirects=true -cas.logout.redirectParameter=service -cas.logout.confirmLogout=true -cas.slo.disabled=false diff --git a/deploys/development/image/cas/etc/cas/config/log4j2.xml b/deploys/development/image/cas/etc/cas/config/log4j2.xml deleted file mode 100644 index 53b30b4..0000000 --- a/deploys/development/image/cas/etc/cas/config/log4j2.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - . - - warn - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/deploys/development/image/cas/etc/cas/config/services/service-1.json b/deploys/development/image/cas/etc/cas/config/services/service-1.json deleted file mode 100644 index d7cb713..0000000 --- a/deploys/development/image/cas/etc/cas/config/services/service-1.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "@class": "org.apereo.cas.services.RegexRegisteredService", - "serviceId": "^https?://.*", - "name": "DBPTK Enterprise", - "description": "Web application to browse and search the content of multiple large archived databases.", - "id": 1001, - "evaluationOrder": 1, - "logoutType": "BACK_CHANNEL", - "attributeReleasePolicy": { - "@class": "org.apereo.cas.services.ReturnAllAttributeReleasePolicy" - }, - "proxyPolicy": { - "@class": "org.apereo.cas.services.RegexMatchingRegisteredServiceProxyPolicy", - "pattern": "^https?://.*" - } -} diff --git a/deploys/development/image/cas/etc/cas/config/users.txt b/deploys/development/image/cas/etc/cas/config/users.txt deleted file mode 100644 index 1d2f79d..0000000 --- a/deploys/development/image/cas/etc/cas/config/users.txt +++ /dev/null @@ -1,2 +0,0 @@ -admin::admin -user::user \ No newline at end of file