Compare commits

...

5 Commits

Author SHA1 Message Date
Shaun Chyxion
3410f3de27 code cleanup 2022-03-26 19:58:40 +08:00
Shaun Chyxion
6bc6f8ea5f database 2022-01-05 00:58:57 +08:00
Shaun Chyxion
d8bd45ede8 jdbc config 2021-07-26 21:39:20 +08:00
Shaun Chyxion
40212f9547 opt log4j2.xml 2021-07-26 16:57:31 +08:00
Shaun Chyxion
7def6ea35a add login enter 2021-07-26 15:16:38 +08:00
12 changed files with 457 additions and 73 deletions

95
cas.properties Normal file
View File

@ -0,0 +1,95 @@
server.port=8081
server.name=http://localhost:8080
server.prefix=${server.name}/cas
# security configuration based on IP address to access the /status and /statistics pages
# cas.securityContext.adminpages.ip=127\.0\.0\.1
##
# Unique CAS node name
# host.name is used to generate unique Service Ticket IDs and SAMLArtifacts. This is usually set to the specific
# hostname of the machine running the CAS node, but it could be any label so long as it is unique in the cluster.
# host.name=
##
# CAS SSO Cookie Generation & Security
# See https://github.com/mitreid-connect/json-web-key-generator
#
# Do note that the following settings MUST be generated per deployment.
#
# The encryption secret key. By default, must be a octet string of size 256.
# tgc.encryption.key=
# The signing secret key. By default, must be a octet string of size 512.
# tgc.signing.key=
# Decides whether SSO cookie should be created only under secure connections.
# tgc.secure=true
# The expiration value of the SSO cookie
# tgc.maxAge=-1
# The name of the SSO cookie
# tgc.name=TGC
# The path to which the SSO cookie will be scoped
# tgc.path=/cas
# The expiration value of the SSO cookie for long-term authentications
# tgc.remember.me.maxAge=1209600
# Decides whether SSO Warning cookie should be created only under secure connections.
# warn.cookie.secure=true
# The expiration value of the SSO Warning cookie
# warn.cookie.maxAge=-1
# The name of the SSO Warning cookie
# warn.cookie.name=CASPRIVACY
# The path to which the SSO Warning cookie will be scoped
# warn.cookie.path=/cas
# Whether we should track the most recent session by keeping the latest service ticket
# tgt.onlyTrackMostRecentSession = true
##
# CAS UI Theme Resolution
#
# cas.themeResolver.defaultThemeName=cas-theme-default
# cas.themeResolver.pathprefix=/WEB-INF/view/jsp/
# cas.themeResolver.param.name=theme
# Location of the Spring xml config file where views may be collected
# cas.viewResolver.xmlFile=/META-INF/spring/views.xml
##
# CAS Internationalization
#
# locale.default=en
# locale.param.name=locale
# message.bundle.encoding=UTF-8
# message.bundle.cacheseconds=180
# message.bundle.fallback.systemlocale=false
# message.bundle.usecode.message=true
# message.bundle.basenames=classpath:custom_messages,classpath:messages
datasource.url=jdbc:mysql://172.16.4.6/yobr-daily?useUnicode=true&characterEncoding=utf8
datasource.username=yobr_query
datasource.password=yobr_query!
cas.jdbc.authn.query.sql=select password from br_auth_user where account = ?
# cas.jdbc.authn.search.password=
# cas.jdbc.authn.search.user=
# cas.jdbc.authn.search.table=
##
# General Authentication
#
# cas.principal.transform.upperCase=false
# cas.authn.password.encoding.char=UTF-8
# cas.authn.password.encoding.alg=SHA-256
cas.authn.password.encoding.alg=MD5
# cas.principal.transform.prefix=
# cas.principal.transform.suffix=

124
log4j2.xml Normal file
View File

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Specify the refresh internal in seconds. -->
<Configuration monitorInterval="42">
<Properties>
<Property name="log.level">DEBUG</Property>
<Property name="log.dir">.logs</Property>
<Property name="pattern">%-d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%t][%c{1.}] %m%n</Property>
</Properties>
<Appenders>
<Console name="console" target="SYSTEM_OUT">
<PatternLayout pattern="%highlight{%-d{yyyy-MM-dd HH:mm:ss,SSS}}{FATAL=magenta, ERROR=magenta, WARN=magenta, INFO=magenta, DEBUG=magenta, TRACE=magenta} %highlight{%-5p}{FATAL=red blink, ERROR=red, WARN=yellow bold, INFO=black, DEBUG=green bold, TRACE=blue} [%t][%highlight{%c{1.}}{FATAL=cyan, ERROR=cyan, WARN=cyan, INFO=cyan, DEBUG=cyan, TRACE=cyan}] %m%n"/>
</Console>
<RollingFile name="appLogFile"
fileName="${log.dir}/app.log"
filePattern="${log.dir}/$${date:yyyy-MM}/app-%d{yyyy-MM-dd}-%i.log">
<PatternLayout pattern="${pattern}" />
<Policies>
<OnStartupTriggeringPolicy />
<TimeBasedTriggeringPolicy />
<SizeBasedTriggeringPolicy size="16 MB" />
</Policies>
<DefaultRolloverStrategy max="32" />
</RollingFile>
<RollingFile name="errorLogFile"
fileName="${log.dir}/error.log"
filePattern="${log.dir}/$${date:yyyy-MM}/error-%d{yyyy-MM-dd}-%i.log">
<PatternLayout pattern="${pattern}" />
<Policies>
<OnStartupTriggeringPolicy />
<TimeBasedTriggeringPolicy />
<SizeBasedTriggeringPolicy size="16 MB" />
</Policies>
<DefaultRolloverStrategy max="32" />
</RollingFile>
<RollingFile name="casLogFile"
append="true"
fileName="${log.dir}/cas.log"
filePattern="${log.dir}/$${date:yyyy-MM}/cas-%d{yyyy-MM-dd}-%i.log">
<PatternLayout pattern="${pattern}" />
<Policies>
<OnStartupTriggeringPolicy />
<TimeBasedTriggeringPolicy />
<SizeBasedTriggeringPolicy size="16 MB" />
</Policies>
<DefaultRolloverStrategy max="64" />
</RollingFile>
<RollingFile name="auditLogFile"
append="true"
fileName="${log.dir}/audit.log"
filePattern="${log.dir}/$${date:yyyy-MM}/audit-%d{yyyy-MM-dd}-%i.log">
<PatternLayout pattern="${pattern}" />
<Policies>
<OnStartupTriggeringPolicy />
<TimeBasedTriggeringPolicy />
<SizeBasedTriggeringPolicy size="16 MB" />
</Policies>
<DefaultRolloverStrategy max="64" />
</RollingFile>
<RollingFile name="perfStatsLogFile"
append="true"
fileName="${log.dir}/perfStats.log"
filePattern="${log.dir}/$${date:yyyy-MM}/perfStats-%d{yyyy-MM-dd}-%i.log">
<PatternLayout pattern="%m%n"/>
<Policies>
<OnStartupTriggeringPolicy />
<TimeBasedTriggeringPolicy />
<SizeBasedTriggeringPolicy size="16 MB" />
</Policies>
<DefaultRolloverStrategy max="64" />
</RollingFile>
</Appenders>
<Loggers>
<AsyncLogger name="org.jasig" level="info" additivity="false" includeLocation="true">
<AppenderRef ref="console"/>
<AppenderRef ref="casLogFile"/>
</AsyncLogger>
<!--
<AsyncLogger name="org.opensaml" level="debug" additivity="false">
<AppenderRef ref="console"/>
<AppenderRef ref="casLogFile"/>
</AsyncLogger>
<AsyncLogger name="org.ldaptive" level="debug" additivity="false">
<AppenderRef ref="console"/>
<AppenderRef ref="casLogFile"/>
</AsyncLogger>
<AsyncLogger name="com.hazelcast" level="debug" additivity="false">
<AppenderRef ref="console"/>
<AppenderRef ref="casLogFile"/>
</AsyncLogger>
-->
<AsyncLogger name="org.apereo.cas.security" level="warn" additivity="false" includeLocation="true">
<AppenderRef ref="console"/>
<AppenderRef ref="casLogFile"/>
</AsyncLogger>
<AsyncLogger name="perfStatsLogger" level="info" additivity="false" includeLocation="true">
<AppenderRef ref="perfStatsLogFile"/>
</AsyncLogger>
<AsyncLogger name="org.jasig.cas.web.flow" level="info" additivity="true" includeLocation="true">
<AppenderRef ref="casLogFile"/>
</AsyncLogger>
<AsyncLogger name="org.jasig.inspektr.audit.support" level="info" includeLocation="true">
<AppenderRef ref="auditLogFile"/>
<AppenderRef ref="casLogFile"/>
</AsyncLogger>
<AsyncLogger level="error">
<AppenderRef ref="console"/>
<AppenderRef ref="errorLogFile"/>
</AsyncLogger>
<AsyncRoot level="${log.level}">
<AppenderRef ref="console"/>
<AppenderRef ref="appLogFile"/>
</AsyncRoot>
</Loggers>
</Configuration>

75
pom.xml
View File

@ -17,20 +17,40 @@
<pac4j.version>1.8.9</pac4j.version>
<metrics.version>3.1.5</metrics.version>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceVersion>1.8</project.build.sourceVersion>
<project.build.targetVersion>1.8</project.build.targetVersion>
<maven.compiler.aspectj.skip>false</maven.compiler.aspectj.skip>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ssa</maven.build.timestamp.format>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss.SSS</maven.build.timestamp.format>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.pudonghot.emtomcat</groupId>
<artifactId>emtomcat-core</artifactId>
<groupId>me.chyxion.emtc</groupId>
<artifactId>emtomcat</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.jasig.cas</groupId>
<artifactId>cas-server-support-jdbc</artifactId>
<version>${cas.version}</version>
</dependency>
<dependency>
<groupId>org.jasig.cas</groupId>
<artifactId>cas-server-webapp-support</artifactId>
@ -66,13 +86,6 @@
<artifactId>cas-server-core-audit</artifactId>
<version>${cas.version}</version>
</dependency>
<!--
<dependency>
<groupId>org.jasig.cas</groupId>
<artifactId>cas-server-core-logging</artifactId>
<version>${cas.version}</version>
</dependency>
-->
<dependency>
<groupId>org.jasig.cas</groupId>
<artifactId>cas-server-core-tickets</artifactId>
@ -173,7 +186,6 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-web</artifactId>
<version>2.6.2</version>
</dependency>
<dependency>
<groupId>org.jasig</groupId>
@ -190,20 +202,18 @@
</exclusion>
</exclusions>
</dependency>
<!--
<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.5.2</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.51</version>
</dependency>
-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.16</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
@ -218,8 +228,35 @@
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-bom</artifactId>
<version>2.17.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<encoding>${project.build.sourceEncoding}</encoding>
<compilerArgs>
<!--<arg>-verbose</arg>-->
<!--<arg>-Xlint:all,-options,-path</arg>-->
<arg>-Xlint:unchecked</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>

View File

@ -1,14 +1,85 @@
package org.jasig.cas.web;
import com.pudonghot.emtomcat.EmTomcat;
import lombok.val;
import java.io.File;
import java.net.URL;
import java.io.IOException;
import java.util.Properties;
import java.io.FileInputStream;
import me.chyxion.emtc.EmTomcat;
import lombok.extern.slf4j.Slf4j;
import java.io.FileNotFoundException;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.core.config.Configurator;
/**
* @author Donghuang
* @date Jul 24, 2021 15:15:58
*/
@Slf4j
public class CasWebServer {
public static void main(String[] args) {
EmTomcat.run(8090);
static final String ARG_LOGGING_CONFIG_NAME = "--logging.config=";
static final String ARG_SPRING_CONFIG_NAME = "--spring.config.location=";
static final String ARG_SERVER_PORT = "--server.port=";
static final String PROP_SPRING_CONFIG_NAME = "spring.config.location";
static final String PROP_SERVER_PORT_NAME = "server.port";
public static void main(final String[] args) throws IOException {
Integer port = null;
for (val arg : args) {
if (arg.startsWith(ARG_LOGGING_CONFIG_NAME)) {
val loggingConfig = arg.substring(ARG_LOGGING_CONFIG_NAME.length());
if (StringUtils.isNotBlank(loggingConfig)) {
val configFile = new File(loggingConfig);
if (!configFile.isFile()) {
throw new FileNotFoundException(
"Log4j2 config [" + loggingConfig + "] is not a valid file");
}
Configurator.initialize(null, loggingConfig);
log.info("Logging config [{}] loaded.", loggingConfig);
continue;
}
}
if (arg.startsWith(ARG_SPRING_CONFIG_NAME)) {
val springConfig = arg.substring(ARG_SPRING_CONFIG_NAME.length());
if (StringUtils.isNotBlank(springConfig)) {
System.setProperty(PROP_SPRING_CONFIG_NAME, springConfig);
continue;
}
}
if (arg.startsWith(ARG_SERVER_PORT)) {
val serverPort = arg.substring(ARG_SERVER_PORT.length());
if (StringUtils.isNotBlank(serverPort)) {
log.info("Server port [{}] got from command line.", serverPort);
port = Integer.parseInt(serverPort);
continue;
}
}
}
if (port == null) {
val springConfig = System.getProperty(PROP_SPRING_CONFIG_NAME);
if (StringUtils.isNotBlank(springConfig)) {
log.info("Load spring config [{}].", springConfig);
try (val fin = new File(springConfig).isFile() ?
new FileInputStream(springConfig) :
new URL(springConfig).openStream()) {
val props = new Properties();
props.load(fin);
val serverPort = props.getProperty(PROP_SERVER_PORT_NAME);
if (StringUtils.isNotBlank(serverPort)) {
log.info("Server port [{}] got from spring config.", serverPort);
port = Integer.parseInt(serverPort);
}
}
}
}
EmTomcat.run(port != null ? port : 8080);
}
}

View File

@ -48,7 +48,7 @@ var Login = function () {
submitHandler: function (form) {
//$('.alert-danger', $('.login-form'))[1].show();
form.submit();
form.submit();
}
});

View File

@ -206,6 +206,10 @@ server.prefix=${server.name}/cas
# yubikey.client.id=
# yubikey.secret.key=
datasource.url=jdbc:mysql://172.16.4.6/yobr-daily?useUnicode=true&characterEncoding=utf8
datasource.username=yobr_query
datasource.password=yobr_query!
##
# JDBC Authentication
#
@ -217,7 +221,7 @@ server.prefix=${server.name}/cas
# cas.jdbc.authn.query.encode.iterations.field=
# cas.jdbc.authn.query.encode.iterations=
# cas.jdbc.authn.query.sql=
cas.jdbc.authn.query.sql=select password from br_auth_user where account = ?
# cas.jdbc.authn.search.password=
# cas.jdbc.authn.search.user=
@ -244,6 +248,7 @@ server.prefix=${server.name}/cas
# cas.principal.transform.upperCase=false
# cas.authn.password.encoding.char=UTF-8
# cas.authn.password.encoding.alg=SHA-256
cas.authn.password.encoding.alg=MD5
# cas.principal.transform.prefix=
# cas.principal.transform.suffix=

View File

@ -1,20 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:sec="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd">
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
init-method="init"
destroy-method="close">
<property name="url" value="${datasource.url}" />
<property name="username" value="${datasource.username}" />
<property name="password" value="${datasource.password}" />
</bean>
<alias name="dataSource" alias="queryDatabaseDataSource" />
<alias name="defaultPasswordEncoder" alias="passwordEncoder" />
<alias name="queryDatabaseAuthenticationHandler" alias="primaryAuthenticationHandler" />
<util:map id="authenticationHandlersResolvers">
<entry key-ref="proxyAuthenticationHandler" value-ref="proxyPrincipalResolver" />
@ -29,7 +34,7 @@
<bean id="attributeRepository" class="org.jasig.services.persondir.support.NamedStubPersonAttributeDao"
p:backingMap-ref="attrRepoBackingMap" />
<alias name="acceptUsersAuthenticationHandler" alias="primaryAuthenticationHandler" />
<!--<alias name="acceptUsersAuthenticationHandler" alias="primaryAuthenticationHandler" />-->
<alias name="personDirectoryPrincipalResolver" alias="primaryPrincipalResolver" />
<util:map id="attrRepoBackingMap">

View File

@ -16,7 +16,7 @@
can be moved between tiers without modification.
</description>
<util:properties id="casProperties" location="${cas.properties.config.location:/WEB-INF/cas.properties}"/>
<util:properties id="casProperties" location="${spring.config.location:/WEB-INF/cas.properties}"/>
<context:property-placeholder properties-ref="casProperties"/>

View File

@ -118,8 +118,8 @@
<input type="hidden" name="lt" value="${loginTicket}" />
<input type="hidden" name="execution" value="${flowExecutionKey}" />
<input type="hidden" name="_eventId" value="submit" />
<button type="submit" class="btn blue pull-right" name="submit">
Login <i class="m-icon-swapright m-icon-white"></i>
<button type="submit" class="btn blue pull-right" name="btnSubmit">
Login <i class="m-icon-swapright m-icon-white"></i>
</button>
</div>
</form:form>

View File

@ -2,13 +2,12 @@
<flow xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/webflow"
xsi:schemaLocation="http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow.xsd">
<var name="credential" class="org.jasig.cas.authentication.UsernamePasswordCredential"/>
http://www.springframework.org/schema/webflow/spring-webflow.xsd">
<!--
<var name="credential" class="org.jasig.cas.authentication.RememberMeUsernamePasswordCredential" />
<var name="credential" class="org.jasig.cas.authentication.UsernamePasswordCredential"/>
-->
<var name="credential" class="org.jasig.cas.authentication.RememberMeUsernamePasswordCredential" />
<on-start>
<evaluate expression="initialFlowSetupAction"/>
</on-start>

View File

@ -1,79 +1,124 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Specify the refresh internal in seconds. -->
<Configuration monitorInterval="60">
<Properties>
<Property name="log.level">DEBUG</Property>
<Property name="log.dir">.logs</Property>
<Property name="pattern">%-d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%t][%c{1.}] %m%n</Property>
</Properties>
<Appenders>
<Console name="console" target="SYSTEM_OUT">
<PatternLayout pattern="%d %p [%c] - &lt;%m&gt;%n"/>
<PatternLayout pattern="%highlight{%-d{yyyy-MM-dd HH:mm:ss,SSS}}{FATAL=magenta, ERROR=magenta, WARN=magenta, INFO=magenta, DEBUG=magenta, TRACE=magenta} %highlight{%-5p}{FATAL=red blink, ERROR=red, WARN=yellow bold, INFO=black, DEBUG=green bold, TRACE=blue} [%t][%highlight{%c{1.}}{FATAL=cyan, ERROR=cyan, WARN=cyan, INFO=cyan, DEBUG=cyan, TRACE=cyan}] %m%n"/>
</Console>
<RollingFile name="file" fileName="cas.log" append="true"
filePattern="cas-%d{yyyy-MM-dd-HH}-%i.log">
<PatternLayout pattern="%d %p [%c] - %m%n"/>
<RollingFile name="appLogFile"
fileName="${log.dir}/app.log"
filePattern="${log.dir}/$${date:yyyy-MM}/app-%d{yyyy-MM-dd}-%i.log">
<PatternLayout pattern="${pattern}" />
<Policies>
<OnStartupTriggeringPolicy />
<SizeBasedTriggeringPolicy size="10 MB"/>
<TimeBasedTriggeringPolicy />
<SizeBasedTriggeringPolicy size="16 MB" />
</Policies>
<DefaultRolloverStrategy max="32" />
</RollingFile>
<RollingFile name="auditlogfile" fileName="cas_audit.log" append="true"
filePattern="cas_audit-%d{yyyy-MM-dd-HH}-%i.log">
<PatternLayout pattern="%d %p [%c] - %m%n"/>
<RollingFile name="errorLogFile"
fileName="${log.dir}/error.log"
filePattern="${log.dir}/$${date:yyyy-MM}/error-%d{yyyy-MM-dd}-%i.log">
<PatternLayout pattern="${pattern}" />
<Policies>
<OnStartupTriggeringPolicy />
<SizeBasedTriggeringPolicy size="10 MB"/>
<TimeBasedTriggeringPolicy />
<SizeBasedTriggeringPolicy size="16 MB" />
</Policies>
<DefaultRolloverStrategy max="32" />
</RollingFile>
<RollingFile name="perfFileAppender" fileName="perfStats.log" append="true"
filePattern="perfStats-%d{yyyy-MM-dd-HH}-%i.log">
<RollingFile name="casLogFile"
append="true"
fileName="${log.dir}/cas.log"
filePattern="${log.dir}/$${date:yyyy-MM}/cas-%d{yyyy-MM-dd}-%i.log">
<PatternLayout pattern="${pattern}" />
<Policies>
<OnStartupTriggeringPolicy />
<TimeBasedTriggeringPolicy />
<SizeBasedTriggeringPolicy size="16 MB" />
</Policies>
<DefaultRolloverStrategy max="64" />
</RollingFile>
<RollingFile name="auditLogFile"
append="true"
fileName="${log.dir}/audit.log"
filePattern="${log.dir}/$${date:yyyy-MM}/audit-%d{yyyy-MM-dd}-%i.log">
<PatternLayout pattern="${pattern}" />
<Policies>
<OnStartupTriggeringPolicy />
<TimeBasedTriggeringPolicy />
<SizeBasedTriggeringPolicy size="16 MB" />
</Policies>
<DefaultRolloverStrategy max="64" />
</RollingFile>
<RollingFile name="perfStatsLogFile"
append="true"
fileName="${log.dir}/perfStats.log"
filePattern="${log.dir}/$${date:yyyy-MM}/perfStats-%d{yyyy-MM-dd}-%i.log">
<PatternLayout pattern="%m%n"/>
<Policies>
<OnStartupTriggeringPolicy />
<SizeBasedTriggeringPolicy size="10 MB"/>
<TimeBasedTriggeringPolicy />
<SizeBasedTriggeringPolicy size="16 MB" />
</Policies>
<DefaultRolloverStrategy max="64" />
</RollingFile>
</Appenders>
<Loggers>
<AsyncLogger name="org.jasig" level="info" additivity="false" includeLocation="true">
<AsyncLogger name="org.jasig" level="info" additivity="false" includeLocation="true">
<AppenderRef ref="console"/>
<AppenderRef ref="file"/>
<AppenderRef ref="casLogFile"/>
</AsyncLogger>
<AsyncLogger name="org.springframework" level="warn" />
<AsyncLogger name="org.springframework.webflow" level="warn" />
<AsyncLogger name="org.springframework.web" level="warn" />
<AsyncLogger name="org.pac4j" level="warn" />
<!--
<AsyncLogger name="org.opensaml" level="debug" additivity="false">
<AppenderRef ref="console"/>
<AppenderRef ref="file"/>
<AppenderRef ref="casLogFile"/>
</AsyncLogger>
<AsyncLogger name="org.ldaptive" level="debug" additivity="false">
<AppenderRef ref="console"/>
<AppenderRef ref="file"/>
<AppenderRef ref="casLogFile"/>
</AsyncLogger>
<AsyncLogger name="com.hazelcast" level="debug" additivity="false">
<AppenderRef ref="console"/>
<AppenderRef ref="file"/>
<AppenderRef ref="casLogFile"/>
</AsyncLogger>
-->
<AsyncLogger name="org.apereo.cas.security" level="warn" additivity="false" includeLocation="true">
<AsyncLogger name="org.apereo.cas.security" level="warn" additivity="false" includeLocation="true">
<AppenderRef ref="console"/>
<AppenderRef ref="file"/>
<AppenderRef ref="casLogFile"/>
</AsyncLogger>
<AsyncLogger name="perfStatsLogger" level="info" additivity="false" includeLocation="true">
<AppenderRef ref="perfFileAppender"/>
<AppenderRef ref="perfStatsLogFile"/>
</AsyncLogger>
<AsyncLogger name="org.jasig.cas.web.flow" level="info" additivity="true" includeLocation="true">
<AppenderRef ref="file"/>
<AppenderRef ref="casLogFile"/>
</AsyncLogger>
<AsyncLogger name="org.jasig.inspektr.audit.support" level="info" includeLocation="true">
<AppenderRef ref="auditlogfile"/>
<AppenderRef ref="file"/>
<AppenderRef ref="auditLogFile"/>
<AppenderRef ref="casLogFile"/>
</AsyncLogger>
<AsyncRoot level="error">
<AsyncLogger level="error">
<AppenderRef ref="console"/>
<AppenderRef ref="errorLogFile"/>
</AsyncLogger>
<AsyncRoot level="${log.level}">
<AppenderRef ref="console"/>
<AppenderRef ref="appLogFile"/>
</AsyncRoot>
</Loggers>
</Configuration>

View File

@ -28,6 +28,9 @@ echo "Work dir [$WORK_DIR]"
mvn -T 4C -DskipTests clean \
spring-boot:run \
-Dspring-boot.run.jvmArguments='-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000' \
-Dspring-boot.run.arguments="--spring.main.banner-mode=OFF
--spring.config.location=file://$WORK_DIR/cas.properties
--logging.config=$WORK_DIR/log4j2.xml" \
-Dspring-boot.run.fork=false
popd > /dev/null