Skip to content

Commit

Permalink
Merge pull request #141 from FederatedAI/feature-1.8.0-security
Browse files Browse the repository at this point in the history
Feature 1.8.0 security
  • Loading branch information
idwenwen authored Aug 2, 2022
2 parents ef57c98 + da8592e commit 3372d8f
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 50 deletions.
112 changes: 76 additions & 36 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>fateboard</groupId>
<artifactId>fateboard</artifactId>
<version>1.8.0</version>
<version>1.8.0.1</version>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.RELEASE</version>
<version>2.6.7</version>
<relativePath/>
</parent>

Expand All @@ -31,19 +31,18 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<pagehelper.version>1.2.3</pagehelper.version>
<log4j2.version>2.17.1</log4j2.version>
<log4j2.version>2.17.2</log4j2.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.5.12</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
<version>3.12.0</version>
</dependency>


Expand All @@ -55,32 +54,9 @@

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-loader-tools</artifactId>
<version>2.1.5.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.3.18</version>
</dependency>

<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-actuator</artifactId>
<version>2.0.4.RELEASE</version>

</dependency>


<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
Expand All @@ -96,13 +72,12 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
<version>2.1.5.RELEASE</version>
</dependency>

<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.70</version>
<version>1.2.83</version>
<exclusions>
<exclusion>
<artifactId>fastjson</artifactId>
Expand All @@ -114,7 +89,6 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
<version>2.0.4.RELEASE</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -164,10 +138,8 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<version>2.0.3.RELEASE</version>
</dependency>


<dependency>
<groupId>com.lmax</groupId>
<artifactId>disruptor</artifactId>
Expand Down Expand Up @@ -295,7 +267,51 @@
</extension>
</extensions>
<plugins>

<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.9.1</version>
<executions>
<!-- 检查是否安装node npm -->
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<phase>generate-resources</phase>
</execution>
<!-- npm install -->
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<!-- build -->
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
</executions>
<configuration>
<nodeVersion>v16.15.1</nodeVersion>
<npmVersion>8.11.0</npmVersion>
<!-- node安装路径 -->
<installDirectory>dist</installDirectory>
<!-- 前端代码路径 -->
<workingDirectory>resources-front-end</workingDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand All @@ -304,6 +320,31 @@
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution> <!-- 复制配置文件 -->
<id>copy-resources</id>
<phase>compile</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>resources-front-end/dist</directory>
<includes>
<include>static/**</include>
<include>index.html</include>
<include>FATE_logo.png</include>
</includes>
</resource>
</resources>
<outputDirectory>${project.build.directory}/classes/static</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand All @@ -318,7 +359,6 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.0.4.RELEASE</version>
<configuration>
<fork>true</fork>
<mainClass>com.webank.ai.fate.board.bootstrap.Bootstrap</mainClass>
Expand Down
14 changes: 0 additions & 14 deletions src/main/java/com/webank/ai/fate/board/bootstrap/Bootstrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,11 @@
package com.webank.ai.fate.board.bootstrap;


import org.apache.catalina.Context;
import org.apache.tomcat.websocket.server.WsSci;
import org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.web.embedded.tomcat.TomcatContextCustomizer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
Expand All @@ -44,14 +40,4 @@ public static void main(String[] args) {
e.printStackTrace();
}
}

@Bean
public TomcatContextCustomizer tomcatContextCustomizer() {
return new TomcatContextCustomizer() {
@Override
public void customize(Context context) {
context.addServletContainerInitializer(new WsSci(), null);
}
};
}
}

0 comments on commit 3372d8f

Please sign in to comment.