/cas-gradle-overlay-template

CAS Gradle Overlay: Generic CAS gradle war overlay to exercise the latest versions of CAS

Primary LanguageJavaScriptApache License 2.0Apache-2.0

CAS Gradle Overlay

Generic CAS gradle war overlay to exercise the latest versions of CAS. This overlay could be freely used as a starting template for local CAS gradle war overlays.

Dependency

  • Mental Login - Login servisineihtiyaç duymaktadır.
  • Mental Authentication - Authentication Dbsine ihtiyaç duymaktadır.
  • Mental User - Kullanıcı adından kullanıcı idsini getirmelidir.
  • Postgresql - Authentication Dbsi

Run postgresql before cas

docker run --name cont_postgresql -itd -p 5432:5432 --restart always -e DB_NAME=authentication-dev,authentication-qa -e DB_USER=dbuser -e DB_PASS=12345 sameersbn/postgresql

Run authentication before cas

docker run -it --name cont_authentication -p 10020:10020 --link cont_postgresql mental/authentication

Run login before cas

docker run -it --name cont_login -p 10000:10000 --link cont_postgresql mental/login

Versions

  • CAS 5.1.x

Requirements

  • JDK 1.8+

Configuration

The etc directory contains the configuration files that are copied to /etc/cas/config automatically.

Adding Modules

CAS modules may be specified under the dependencies block of the CAS subproject:

dependencies {
    compile "org.apereo.cas:cas-server-webapp-tomcat:${project.'cas.version'}@war"
    compile "org.apereo.cas:cas-server-some-module:${project.'cas.version'}"
    ...
}

Build

gradlew clean build

Deployment

  • If you use gradlew build, gradle will copy etc folder to host machine.
  • or
  • Create a keystore file cas under /etc/keystore on Linux. Use C:/etc/keystore on Windows.
  • Use the password changeit for both the keystore and the key/certificate entries.
  • Ensure the keystore is loaded up with keys and certificates of the server.

On a successful deployment via the following methods, CAS will be available at:

  • https://server.name:10010/cas
Example

Local server https://localhost:10010/cas

Https Error

If you see this error on google chrome:

Your connection is not private

Attackers might be trying to steal your information from localhost (for example, passwords, messages, or credit cards). NET::ERR_CERT_COMMON_NAME_INVALID

  • Browse this option chrome://flags/#allow-insecure-localhost

and enable.

Executable WAR

Run the CAS web application as an executable WAR.

java -jar cas/build/libs/cas.war
Environment

native environment must be absolutely in spring.profiles.active variable.

If you use other environment, you must pass this variable to command --spring.profiles.active=native,qa

Example

java -jar  cas/build/libs/cas.war --spring.profiles.active=native,qa

Or via Gradle:

# You need to check your project path into cas/build.gradle for this command
./gradlew[.bat] run

Spring Boot

Run the CAS web application as an executable WAR via Spring Boot. This is most useful during development and testing.

./gradlew[.bat] bootrun

External

Deploy resultant cas/build/libs/ to a servlet container of choice.

Docker

Build

You can build from docker-compose file.


docker-compose build

or


docker build -t mental/cas .

Run with compose


docker-compose up
Environment for compose

If you use other environment, you must change docker-compose.yml

Example

    .
    .
    environment:
      SPRING_PROFILES_ACTIVE: native,qa
    .
    .

Run with command


docker run -d -p 10010:10010 mental/cas
Environment for docker run

If you use other environment, you must pass this variable to command. -e SPRING_PROFILES_ACTIVE=native,qa

Example

docker run -e SPRING_PROFILES_ACTIVE=native,qa -p 10010:10010 mental/cas