Code Monkey home page Code Monkey logo

cas's Introduction

Apereo CAS WAR Overlay 模板

WAR Overlay 类型: cas-overlay

版本

  • CAS Server 6.6.0-SNAPSHOT
  • JDK 11

构建

要构建项目,请使用:

# Use --refresh-dependencies to force-update SNAPSHOT versions
./gradlew[.bat] clean build

要查看哪些命令/任务可用于构建脚本,请运行:

./gradlew[.bat] tasks

如果你需要,在Linux/Unix系统上,你可以删除Gradle已经下载的所有工件(artifacts和metadata):

# Only do this when absolutely necessary
rm -rf $HOME/.gradle/caches/

同样的策略也适用于Windows,只要您在上面的命令中将$HOME切换到它的等效值。

Keystore

要使服务器成功运行,您可能需要创建一个keystore文件。这可以通过使用JDK的keytool工具或通过以下命令来完成:

./gradlew[.bat] createKeystore

使用密钥存储库和密钥/证书条目的密码changeit。确保密钥存储库装载了服务器的密钥和证书。

扩展模块

扩展模块可以在Gradle构建脚本dependencies块中指定

dependencies {
    implementation "org.apereo.cas:cas-server-some-module"
    ...
}

收集覆盖中所有项目模块和依赖项的列表:

./gradlew[.bat] dependencies

查看可配置和使用的所有项目依赖项的完整列表:

curl https://localhost:8080/dependencies

或者:

curl https://localhost:8080/actuator/info

部署

通过以下方法成功部署后,服务器将在运行:

  • https://localhost:8443/cas

可执行 WAR

将服务器web应用程序作为可执行的WAR运行。请注意,运行可执行的WAR需要CAS使用嵌入式容器,如Apache Tomcat、Jetty等。

当前servlet容器被指定为 -tomcat.

java -jar build/libs/cas.war

或通过:

./gradlew[.bat] run

将CAS web应用程序调试为可执行的WAR:

./gradlew[.bat] debug

或通过:

java -Xdebug -Xrunjdwp:transport=dt_socket,address=5000,server=y,suspend=y -jar build/libs/cas.war

运行CAS web应用程序作为一个独立的可执行的WAR:

./gradlew[.bat] clean executable

External

成功构建servlet容器后,将二进制web应用程序文件部署到build/libs中。

Docker

以下策略概述了如何构建和部署CAS Docker映像。

Jib

覆盖包含了Jib Gradle Plugin,以提供易于使用的开箱即用的工具,用于构建CAS docker图像。Jib是一个来自谷歌的开源Java容器器,它允许Java开发人员使用他们知道的工具构建容器。它是一个容器映像构建器,处理将应用程序打包为容器映像的所有步骤。它不需要你编写Dockerfile或安装Docker,它直接集成到覆盖中。

# Running this task requires that you have Docker installed and running.
./gradlew build jibDockerBuild

Dockerfile

你也可以使用本地的Docker工具和提供的Dockerfile来构建和运行。

chmod +x *.sh
./docker-build.sh
./docker-run.sh

为方便起见,额外的docker-compose.yml也可被提供来协调构建:

docker-compose build

CAS 命令行

要启动到CAS命令行:

./gradlew[.bat] downloadShell runShell

Retrieve Overlay Resources

To fetch and overlay a CAS resource or view, use:

./gradlew[.bat] getResource -PresourceName=[resource-name]

Create User Interface Themes Structure

You can use the overlay to construct the correct directory structure for custom user interface themes:

./gradlew[.bat] createTheme -Ptheme=redbeard

The generated directory structure should match the following:

├── redbeard.properties
├── static
│ └── themes
│     └── redbeard
│         ├── css
│         │ └── cas.css
│         └── js
│             └── cas.js
└── templates
    └── redbeard
        └── fragments

HTML templates and fragments can be moved into the above directory structure, and the theme may be assigned to applications for use.

List Overlay Resources

To list all available CAS views and templates:

./gradlew[.bat] listTemplateViews

To unzip and explode the CAS web application file and the internal resources jar:

./gradlew[.bat] explodeWar

Configuration

  • The etc directory contains the configuration files and directories that need to be copied to /etc/cas/config.
./gradlew[.bat] copyCasConfiguration
  • 构建的细节是使用 gradle.properties 文件控制的.

配置metadata

配置metadata允许您将CAS属性集合作为报告导出到一个文件中,以便稍后进行检查。你会发现一个完整的CAS设置列表,以及注释、类型、默认值和接受值:

./gradlew exportConfigMetadata

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.