spring boot init

spring boot init
This commit is contained in:
shimingxy
2019-09-04 23:47:22 +08:00
parent 6181f5d657
commit fb15e2b070
1192 changed files with 2693 additions and 4070 deletions

View File

@@ -0,0 +1,19 @@
package org.maxkey;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
@SpringBootApplication
public class MaxKeyApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(MaxKeyApplication.class, args);
}
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(MaxKeyApplication.class);
}
}

View File

@@ -0,0 +1,10 @@
package org.maxkey;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
@Configuration
@ImportResource(locations={"classpath:spring/maxkey.xml"})
public class MaxKeyConfig {
}

View File

@@ -79,11 +79,6 @@ public class AppListController{
WebContext.setAttribute(app.getId(), app.getIcon());
}
if(appList.size()%5>0){
for(int i=0;i<=appList.size()%5;i++){
appList.add(new UserApplications());
}
}
return appList;
}

View File

@@ -54,7 +54,7 @@ public class OneTimePasswordController {
@RequestMapping(value={"/timebased"})
public ModelAndView timebased(){
ModelAndView modelAndView=new ModelAndView("otp/timeBased");
ModelAndView modelAndView=new ModelAndView("safe/timeBased");
UserInfo userInfo=WebContext.getUserInfo();
String sharedSecret=passwordReciprocal.decoder(userInfo.getSharedSecret());
timeBasedKeyUriFormat.setSecret(sharedSecret);
@@ -84,7 +84,7 @@ public class OneTimePasswordController {
@RequestMapping(value={"/counterbased"})
public ModelAndView counterbased(){
ModelAndView modelAndView=new ModelAndView("otp/counterBased");
ModelAndView modelAndView=new ModelAndView("safe/counterBased");
UserInfo userInfo=WebContext.getUserInfo();
String sharedSecret=passwordReciprocal.decoder(userInfo.getSharedSecret());
counterBasedKeyUriFormat.setSecret(sharedSecret);
@@ -117,7 +117,7 @@ public class OneTimePasswordController {
@RequestMapping(value={"/hotp"})
public ModelAndView hotp(){
ModelAndView modelAndView=new ModelAndView("otp/hotp");
ModelAndView modelAndView=new ModelAndView("safe/hotp");
UserInfo userInfo=WebContext.getUserInfo();
String sharedSecret=passwordReciprocal.decoder(userInfo.getSharedSecret());
hotpKeyUriFormat.setSecret(sharedSecret);

View File

@@ -67,9 +67,9 @@ public class LoginEndpoint {
@Qualifier("userInfoService")
UserInfoService userInfoService;
@Autowired
/*@Autowired
@Qualifier("wsFederationService")
WsFederationService wsFederationService;
WsFederationService wsFederationService;*/
@Autowired
@Qualifier("authenticationProvider")
@@ -117,7 +117,7 @@ public class LoginEndpoint {
if(applicationConfig.getLoginConfig().isWsFederation()&&
StringUtils.isNotEmpty(wsFederationWA) &&
wsFederationWA.equalsIgnoreCase(WsFederationConstants.WSIGNIN)){
isAuthenticated=wsFederationService.login(wsFederationWA,wsFederationWResult,request);
//isAuthenticated=wsFederationService.login(wsFederationWA,wsFederationWResult,request);
}
}

View File

@@ -0,0 +1,22 @@
#server config
#spring.profiles.active=dev
#server port
server.port=80
#web app context path
server.servlet.context-path=/maxkey
#for freemarker
spring.freemarker.template-loader-path=classpath:/templates/views
spring.freemarker.cache=false
spring.freemarker.charset=UTF-8
spring.freemarker.check-template-location=true
spring.freemarker.content-type=text/html
spring.freemarker.expose-request-attributes=false
spring.freemarker.expose-session-attributes=false
spring.freemarker.request-context-attribute=request
spring.freemarker.suffix=.ftl
#static resources
spring.mvc.static-path-pattern=/static/**
spring.main.allow-bean-definition-overriding=true

View File

@@ -5,22 +5,16 @@
<Console name="consolePrint" target="SYSTEM_OUT">
<PatternLayout pattern="%d{YYYY-MM-dd HH:mm:ss,SSS} [%t] %-5level %logger{36} - %msg%n" />
</Console>
<!--
<File name="File" fileName="logs/PipeLineRunner.log">
<PatternLayout pattern="%d{YYYY-MM-dd HH:mm:ss,SSS} [%t] %-5level %logger{36} - %msg%n" />
</File>
-->
<!-- 输出到文件,按天或者超过80MB分割 -->
<RollingFile name="RollingFile" fileName="${catalina.home}/logs/maxkey.log" filePattern="${catalina.home}/logs/$${date:yyyy-MM}/maxkey-%d{yyyy-MM-dd}-%i.log.gz">
<!-- 输出到文件,按天或者超过250MB分割 每天进行归档yyyy-MM-dd -->
<RollingFile name="RollingFile" fileName="${catalina.home}/logs/maxkey.log" filePattern="${catalina.home}/logs/$${date:yyyy-MM-dd}/maxkey-%d{yyyy-MM-dd}-%i.log.gz">
<!-- 需要记录的级别 -->
<!-- <ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY" /> -->
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n" />
<Policies>
<OnStartupTriggeringPolicy />
<TimeBasedTriggeringPolicy />
<SizeBasedTriggeringPolicy size="512 MB" />
<!-- <SizeBasedTriggeringPolicy size="80 MB" /> -->
<SizeBasedTriggeringPolicy size="250 MB" />
</Policies>
</RollingFile>
</appenders>

View File

@@ -26,11 +26,10 @@
<import resource="maxkey-support-kerberos.xml"/>
<import resource="maxkey-support-social.xml"/>
<import resource="maxkey-support-wsfederation.xml"/>
<import resource="maxkey-support-cas.xml"/>
<!--
<import resource="maxkey-support-wsfederation.xml"/>
<import resource="maxkey-support-jwt.xml"/>
-->

View File

@@ -108,9 +108,9 @@
</property>
</bean>
<!-- View Resolver -->
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/WEB-INF/views/" p:suffix=".jsp" p:order="2" />
<!-- View Resolver
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/templates/" p:suffix=".jsp" p:order="2" />
-->
<!-- upload file support -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="maxUploadSize" value="4194304" />

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 406 B

After

Width:  |  Height:  |  Size: 406 B

View File

Before

Width:  |  Height:  |  Size: 404 B

After

Width:  |  Height:  |  Size: 404 B

View File

Before

Width:  |  Height:  |  Size: 407 B

After

Width:  |  Height:  |  Size: 407 B

Some files were not shown because too many files have changed in this diff Show More