Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
roncoo
roncoo-education
提交
6395910e
R
roncoo-education
项目概览
roncoo
/
roncoo-education
10 个月 前同步成功
通知
146
Star
5
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roncoo-education
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
6395910e
编写于
1月 18, 2019
作者:
夏天飘过的风
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加roncoo-education-server-admin工程
上级
7a4c8a90
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
241 addition
and
0 deletion
+241
-0
pom.xml
pom.xml
+14
-0
roncoo-education-server-admin/pom.xml
roncoo-education-server-admin/pom.xml
+77
-0
roncoo-education-server-admin/src/main/java/com/roncoo/education/server/admin/ServerAdminApplication.java
...roncoo/education/server/admin/ServerAdminApplication.java
+21
-0
roncoo-education-server-admin/src/main/java/com/roncoo/education/server/admin/config/SecuritySecureConfig.java
...o/education/server/admin/config/SecuritySecureConfig.java
+29
-0
roncoo-education-server-admin/src/main/resources/bootstrap.properties
...tion-server-admin/src/main/resources/bootstrap.properties
+29
-0
roncoo-education-server-admin/src/main/resources/logback-roncoo.xml
...cation-server-admin/src/main/resources/logback-roncoo.xml
+71
-0
未找到文件。
pom.xml
浏览文件 @
6395910e
...
...
@@ -185,6 +185,18 @@
<artifactId>
itextpdf
</artifactId>
<version>
5.5.13
</version>
</dependency>
<!-- de.codecentric -->
<dependency>
<groupId>
de.codecentric
</groupId>
<artifactId>
spring-boot-admin-server-cloud
</artifactId>
<version>
${de.codecentric.version}
</version>
</dependency>
<dependency>
<groupId>
de.codecentric
</groupId>
<artifactId>
spring-boot-admin-server-ui
</artifactId>
<version>
${de.codecentric.version}
</version>
</dependency>
<!-- com.roncoo -->
<dependency>
...
...
@@ -259,6 +271,8 @@
<module>
roncoo-education-server-eureka
</module>
<!-- 配置中心 -->
<module>
roncoo-education-server-config
</module>
<!-- 监控中心 -->
<module>
roncoo-education-server-admin
</module>
<!-- 公用工具 -->
<module>
roncoo-education-util
</module>
<!-- 系统管理 -->
...
...
roncoo-education-server-admin/pom.xml
0 → 100644
浏览文件 @
6395910e
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<artifactId>
roncoo-education-server-admin
</artifactId>
<dependencies>
<!-- de.codecentric -->
<dependency>
<groupId>
de.codecentric
</groupId>
<artifactId>
spring-boot-admin-server-cloud
</artifactId>
</dependency>
<dependency>
<groupId>
de.codecentric
</groupId>
<artifactId>
spring-boot-admin-server-ui
</artifactId>
</dependency>
<!-- spring cloud -->
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-netflix-eureka-client
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-config
</artifactId>
</dependency>
<!-- security -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-security
</artifactId>
</dependency>
<!-- web -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<!-- spring boot -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-devtools
</artifactId>
</dependency>
<dependency>
<groupId>
org.jolokia
</groupId>
<artifactId>
jolokia-core
</artifactId>
</dependency>
</dependencies>
<build>
<finalName>
server-admin
</finalName>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<executions>
<execution>
<goals>
<goal>
repackage
</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>
true
</executable>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
roncoo-education-server-admin/src/main/java/com/roncoo/education/server/admin/ServerAdminApplication.java
0 → 100644
浏览文件 @
6395910e
/**
* Copyright 2015-现在 广州市领课网络科技有限公司
*/
package
com.roncoo.education.server.admin
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
de.codecentric.boot.admin.server.config.EnableAdminServer
;
@EnableAdminServer
@EnableDiscoveryClient
@SpringBootApplication
public
class
ServerAdminApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
ServerAdminApplication
.
class
,
args
);
}
}
roncoo-education-server-admin/src/main/java/com/roncoo/education/server/admin/config/SecuritySecureConfig.java
0 → 100644
浏览文件 @
6395910e
package
com.roncoo.education.server.admin.config
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
import
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
;
import
org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler
;
import
org.springframework.security.web.csrf.CookieCsrfTokenRepository
;
import
de.codecentric.boot.admin.server.config.AdminServerProperties
;
@Configuration
public
class
SecuritySecureConfig
extends
WebSecurityConfigurerAdapter
{
private
final
String
adminContextPath
;
public
SecuritySecureConfig
(
AdminServerProperties
adminServerProperties
)
{
this
.
adminContextPath
=
adminServerProperties
.
getContextPath
();
}
@Override
protected
void
configure
(
HttpSecurity
http
)
throws
Exception
{
// @formatter:off
SavedRequestAwareAuthenticationSuccessHandler
successHandler
=
new
SavedRequestAwareAuthenticationSuccessHandler
();
successHandler
.
setTargetUrlParameter
(
"redirectTo"
);
successHandler
.
setDefaultTargetUrl
(
adminContextPath
+
"/"
);
http
.
authorizeRequests
().
antMatchers
(
adminContextPath
+
"/assets/**"
).
permitAll
().
antMatchers
(
adminContextPath
+
"/login"
).
permitAll
().
anyRequest
().
authenticated
().
and
().
formLogin
().
loginPage
(
adminContextPath
+
"/login"
).
successHandler
(
successHandler
).
and
().
logout
().
logoutUrl
(
adminContextPath
+
"/logout"
).
and
().
httpBasic
().
and
().
csrf
().
csrfTokenRepository
(
CookieCsrfTokenRepository
.
withHttpOnlyFalse
()).
ignoringAntMatchers
(
adminContextPath
+
"/instances"
,
adminContextPath
+
"/actuator/**"
);
// @formatter:on
}
}
\ No newline at end of file
roncoo-education-server-admin/src/main/resources/bootstrap.properties
0 → 100644
浏览文件 @
6395910e
# security
spring.security.user.name
=
roncoo
spring.security.user.password
=
123456
# info
info.eureka.host01
=
192.168.1.181
info.eureka.host02
=
192.168.1.181
info.eureka.port01
=
5761
info.eureka.port02
=
5762
# profile
spring.profiles.active
=
test
# eureka
eureka.client.serviceUrl.defaultZone
=
http://${spring.security.user.name}:${spring.security.user.password}@${info.eureka.host01}:${info.eureka.port01}/eureka/,http://${spring.security.user.name}:${spring.security.user.password}@${info.eureka.host02}:${info.eureka.port02}/eureka/
eureka.instance.metadata-map.user.name
=
${spring.security.user.name}
eureka.instance.metadata-map.user.password
=
${spring.security.user.password}
# server
server.port
=
5721
# application
spring.application.name
=
roncoo-education-server-admin
# spring cloud config client
spring.cloud.config.profile
=
${spring.profiles.active}
spring.cloud.config.label
=
master
spring.cloud.config.discovery.enabled
=
true
spring.cloud.config.discovery.service-id
=
roncoo-education-server-config
roncoo-education-server-admin/src/main/resources/logback-roncoo.xml
0 → 100644
浏览文件 @
6395910e
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include
resource=
"org/springframework/boot/logging/logback/defaults.xml"
/>
<springProperty
name=
"springApplicationName"
source=
"spring.application.name"
defaultValue=
"roncoo-education"
/>
<springProperty
name=
"FILE_PATH"
source=
"info.roncoo.logging.path"
defaultValue=
"/home/roncoo/logs"
/>
<property
name=
"PATTERN"
value=
"%-12(%d{yyyy-MM-dd HH:mm:ss.SSS}) |-%-5level [%thread] %c [%L] -| %msg%n"
/>
<!-- 开发环境 -->
<springProfile
name=
"dev"
>
<appender
name=
"CONSOLE"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<pattern>
${PATTERN}
</pattern>
</encoder>
</appender>
<root
level=
"info"
>
<appender-ref
ref=
"CONSOLE"
/>
</root>
</springProfile>
<!-- 测试环境 -->
<springProfile
name=
"test"
>
<appender
name=
"CONSOLE"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<pattern>
${PATTERN}
</pattern>
</encoder>
</appender>
<appender
name=
"TEST-FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 文件路径 -->
<file>
${FILE_PATH}/info
</file>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!-- 文件名称 -->
<fileNamePattern>
${FILE_PATH}/info.%d{yyyy-MM-dd}.log
</fileNamePattern>
<!-- 文件最大保存历史数量 -->
<MaxHistory>
100
</MaxHistory>
</rollingPolicy>
<layout
class=
"ch.qos.logback.classic.PatternLayout"
>
<pattern>
${PATTERN}
</pattern>
</layout>
</appender>
<root
level=
"info"
>
<appender-ref
ref=
"CONSOLE"
/>
<appender-ref
ref=
"TEST-FILE"
/>
</root>
</springProfile>
<!-- 生产环境 -->
<springProfile
name=
"prod"
>
<appender
name=
"PROD_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<file>
${FILE_PATH}/warn
</file>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
${FILE_PATH}/warn.%d{yyyy-MM-dd}.log
</fileNamePattern>
<MaxHistory>
100
</MaxHistory>
</rollingPolicy>
<layout
class=
"ch.qos.logback.classic.PatternLayout"
>
<pattern>
${PATTERN}
</pattern>
</layout>
</appender>
<root
level=
"warn"
>
<appender-ref
ref=
"PROD_FILE"
/>
</root>
</springProfile>
</configuration>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录