Quellcode durchsuchen

使用Nacos作为注册中心和配置中心

mrbird vor 6 Jahren
Ursprung
Commit
0fe4c24a88
39 geänderte Dateien mit 60 neuen und 1052 gelöschten Zeilen
  1. 1 1
      febs-auth/src/main/java/cc/mrbird/febs/auth/service/FebsUserDetailService.java
  2. 9 21
      febs-auth/src/main/resources/bootstrap.yml
  3. 0 2
      febs-cloud/pom.xml
  4. 2 2
      febs-common/pom.xml
  5. 2 2
      febs-common/src/main/java/cc/mrbird/febs/common/configure/FebsOAuth2FeignConfigure.java
  6. 4 4
      febs-common/src/main/java/cc/mrbird/febs/common/entity/FebsConstant.java
  7. 2 2
      febs-common/src/main/java/cc/mrbird/febs/common/interceptor/FebsServerProtectInterceptor.java
  8. 0 5
      febs-config/Dockerfile
  9. 0 46
      febs-config/pom.xml
  10. 0 60
      febs-config/repository/config/FEBS-Auth-dev.yml
  11. 0 61
      febs-config/repository/config/FEBS-Auth-prod.yml
  12. 0 60
      febs-config/repository/config/FEBS-Auth-test.yml
  13. 0 57
      febs-config/repository/config/FEBS-Gateway.yml
  14. 0 74
      febs-config/repository/config/FEBS-Server-System-dev.yml
  15. 0 74
      febs-config/repository/config/FEBS-Server-System-prod.yml
  16. 0 74
      febs-config/repository/config/FEBS-Server-System-test.yml
  17. 0 42
      febs-config/repository/config/FEBS-Server-Test.yml
  18. 0 4
      febs-config/run.sh
  19. 0 20
      febs-config/src/main/java/cc/mrbird/febs/config/FebsConfigApplication.java
  20. 0 35
      febs-config/src/main/java/cc/mrbird/febs/config/runner/StartedUpRunner.java
  21. 0 8
      febs-config/src/main/resources/banner.txt
  22. 0 49
      febs-config/src/main/resources/bootstrap.yml
  23. 0 53
      febs-config/src/main/resources/logback-spring.xml
  24. 0 4
      febs-gateway/pom.xml
  25. 3 1
      febs-gateway/src/main/resources/bootstrap.yml
  26. 4 0
      febs-monitor/febs-monitor-admin/pom.xml
  27. 0 14
      febs-monitor/febs-monitor-admin/src/main/resources/application.yml
  28. 10 0
      febs-monitor/febs-monitor-admin/src/main/resources/bootstrap.yml
  29. 0 5
      febs-register/Dockerfile
  30. 0 42
      febs-register/pom.xml
  31. 0 4
      febs-register/run.sh
  32. 0 17
      febs-register/src/main/java/cc/mrbird/febs/register/FebsRegisterApplication.java
  33. 0 24
      febs-register/src/main/java/cc/mrbird/febs/register/configure/FebsRegisterWebSecurityConfigure.java
  34. 0 35
      febs-register/src/main/java/cc/mrbird/febs/register/runner/StartedUpRunner.java
  35. 0 8
      febs-register/src/main/resources/banner.txt
  36. 0 46
      febs-register/src/main/resources/bootstrap.yml
  37. 0 54
      febs-register/src/main/resources/logback-spring.xml
  38. 13 21
      febs-server/febs-server-system/src/main/resources/bootstrap.yml
  39. 10 21
      febs-server/febs-server-test/src/main/resources/bootstrap.yml

+ 1 - 1
febs-auth/src/main/java/cc/mrbird/febs/auth/service/FebsUserDetailService.java

@@ -35,7 +35,7 @@ public class FebsUserDetailService implements UserDetailsService {
             FebsAuthUser authUser = new FebsAuthUser(systemUser.getUsername(), systemUser.getPassword(), true, true, true, notLocked,
                     AuthorityUtils.commaSeparatedStringToAuthorityList(permissions));
 
-            BeanUtils.copyProperties(systemUser,authUser);
+            BeanUtils.copyProperties(systemUser, authUser);
             return authUser;
         } else {
             throw new UsernameNotFoundException("");

+ 9 - 21
febs-auth/src/main/resources/bootstrap.yml

@@ -1,26 +1,14 @@
-server:
-  port: 8101
 spring:
   application:
     name: FEBS-Auth
-  cloud:
-    config:
-      fail-fast: true
-      name: ${spring.application.name}
-      profile: ${spring.profiles.active}
-      discovery:
-        enabled: true
-        service-id: FEBS-Config
   profiles:
     active: dev
-
-eureka:
-  instance:
-    lease-renewal-interval-in-seconds: 20
-  client:
-    register-with-eureka: true
-    fetch-registry: true
-    instance-info-replication-interval-seconds: 30
-    registry-fetch-interval-seconds: 3
-    serviceUrl:
-      defaultZone: http://febs:123456@${febs-register}:8001/register/eureka/
+  cloud:
+    nacos:
+      config:
+        server-addr: ${nacos.url}:8001
+        group: DEFAULT_GROUP
+        prefix: febs-auth
+        file-extension: yaml
+      discovery:
+        server-addr: ${nacos.url}:8001

+ 0 - 2
febs-cloud/pom.xml

@@ -13,13 +13,11 @@
     <description>FEBS-Cloud:Spring Cloud,Spring Security OAuth2 微服务权限管理系统</description>
 
     <modules>
-        <module>../febs-register</module>
         <module>../febs-auth</module>
         <module>../febs-common</module>
         <module>../febs-server</module>
         <module>../febs-gateway</module>
         <module>../febs-monitor</module>
-        <module>../febs-config</module>
     </modules>
 
     <parent>

+ 2 - 2
febs-common/pom.xml

@@ -57,11 +57,11 @@
         </dependency>
         <dependency>
             <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
         </dependency>
         <dependency>
             <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-config-client</artifactId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
         </dependency>
         <dependency>
             <groupId>org.springframework.cloud</groupId>

+ 2 - 2
febs-common/src/main/java/cc/mrbird/febs/common/configure/FebsOAuth2FeignConfigure.java

@@ -19,8 +19,8 @@ public class FebsOAuth2FeignConfigure {
     public RequestInterceptor oauth2FeignRequestInterceptor() {
         return requestTemplate -> {
             // 请求头中添加 Zuul Token
-            String zuulToken = new String(Base64Utils.encode(FebsConstant.ZUUL_TOKEN_VALUE.getBytes()));
-            requestTemplate.header(FebsConstant.ZUUL_TOKEN_HEADER, zuulToken);
+            String zuulToken = new String(Base64Utils.encode(FebsConstant.GATEWAY_TOKEN_VALUE.getBytes()));
+            requestTemplate.header(FebsConstant.GATEWAY_TOKEN_HEADER, zuulToken);
             // 请求头中添加原请求头中的 Token
             Object details = SecurityContextHolder.getContext().getAuthentication().getDetails();
             if (details instanceof OAuth2AuthenticationDetails) {

+ 4 - 4
febs-common/src/main/java/cc/mrbird/febs/common/entity/FebsConstant.java

@@ -15,13 +15,13 @@ public class FebsConstant {
     public static final String ORDER_ASC = "ascending";
 
     /**
-     * Zuul请求头TOKEN名称(不要有空格)
+     * Gateway请求头TOKEN名称(不要有空格)
      */
-    public static final String ZUUL_TOKEN_HEADER = "ZuulToken";
+    public static final String GATEWAY_TOKEN_HEADER = "GatewayToken";
     /**
-     * Zuul请求头TOKEN值
+     * Gateway请求头TOKEN值
      */
-    public static final String ZUUL_TOKEN_VALUE = "febs:zuul:123456";
+    public static final String GATEWAY_TOKEN_VALUE = "febs:gateway:123456";
 
     /**
      * 允许下载的文件类型,根据需求自己添加(小写)

+ 2 - 2
febs-common/src/main/java/cc/mrbird/febs/common/interceptor/FebsServerProtectInterceptor.java

@@ -20,8 +20,8 @@ public class FebsServerProtectInterceptor implements HandlerInterceptor {
     @Override
     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws IOException {
         // 从请求头中获取 Zuul Token
-        String token = request.getHeader(FebsConstant.ZUUL_TOKEN_HEADER);
-        String zuulToken = new String(Base64Utils.encode(FebsConstant.ZUUL_TOKEN_VALUE.getBytes()));
+        String token = request.getHeader(FebsConstant.GATEWAY_TOKEN_HEADER);
+        String zuulToken = new String(Base64Utils.encode(FebsConstant.GATEWAY_TOKEN_VALUE.getBytes()));
         // 校验 Zuul Token的正确性
         if (StringUtils.equals(zuulToken, token)) {
             return true;

+ 0 - 5
febs-config/Dockerfile

@@ -1,5 +0,0 @@
-FROM openjdk:8u212-jre
-MAINTAINER MrBird 852252810@qq.com
-
-COPY ./target/febs-config-1.0-SNAPSHOT.jar /febs/febs-config-1.0-SNAPSHOT.jar
-ENTRYPOINT ["java", "-Xmx256m", "-jar", "/febs/febs-config-1.0-SNAPSHOT.jar"]

+ 0 - 46
febs-config/pom.xml

@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>cc.mrbird</groupId>
-        <artifactId>febs-cloud</artifactId>
-        <version>1.0-SNAPSHOT</version>
-        <relativePath>../febs-cloud/pom.xml</relativePath>
-    </parent>
-    <groupId>cc.mrbird.febs</groupId>
-    <artifactId>febs-config</artifactId>
-    <version>1.0-SNAPSHOT</version>
-    <name>FEBS-Config</name>
-    <description>FEBS-Config微服务配置中心</description>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-config-server</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>de.codecentric</groupId>
-            <artifactId>spring-boot-admin-starter-client</artifactId>
-            <version>2.1.6</version>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-            </plugin>
-        </plugins>
-    </build>
-
-</project>

+ 0 - 60
febs-config/repository/config/FEBS-Auth-dev.yml

@@ -1,60 +0,0 @@
-spring:
-  datasource:
-    dynamic:
-      hikari:
-        connection-timeout: 30000
-        max-lifetime: 1800000
-        max-pool-size: 15
-        min-idle: 5
-        connection-test-query: select 1
-        pool-name: FebsHikariCP
-      primary: base
-      datasource:
-        base:
-          username: root
-          password: 123456
-          driver-class-name: com.mysql.cj.jdbc.Driver
-          url: jdbc:mysql://${mysql.url}:3306/febs_cloud_base?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2b8
-
-  jackson:
-    date-format: yyyy-MM-dd HH:mm:ss
-    time-zone: GMT+8
-  boot:
-    admin:
-      client:
-        url: http://${febs-monitor-admin}:8401
-        username: febs
-        password: 123456
-
-  redis:
-    database: 0
-    host: ${redis.url}
-    port: 6379
-    lettuce:
-      pool:
-        min-idle: 8
-        max-idle: 500
-        max-active: 2000
-        max-wait: 10000
-    timeout: 5000
-mybatis-plus:
-  type-aliases-package: cc.mrbird.febs.common.entity.system
-  mapper-locations: classpath:mapper/*.xml
-  configuration:
-    jdbc-type-for-null: null
-  global-config:
-    banner: false
-info:
-  app:
-    name: ${spring.application.name}
-    description: "@project.description@"
-    version: "@project.version@"
-
-management:
-  endpoints:
-    web:
-      exposure:
-        include: '*'
-  endpoint:
-    health:
-      show-details: ALWAYS

+ 0 - 61
febs-config/repository/config/FEBS-Auth-prod.yml

@@ -1,61 +0,0 @@
-spring:
-  datasource:
-    dynamic:
-      hikari:
-        connection-timeout: 30000
-        max-lifetime: 1800000
-        max-pool-size: 15
-        min-idle: 5
-        connection-test-query: select 1
-        pool-name: FebsHikariCP
-      primary: base
-      datasource:
-        base:
-          username: root
-          password: 123456
-          driver-class-name: com.mysql.cj.jdbc.Driver
-          url: jdbc:mysql://${mysql.url}:3306/febs_cloud_base?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2b8
-
-  jackson:
-    date-format: yyyy-MM-dd HH:mm:ss
-    time-zone: GMT+8
-  boot:
-    admin:
-      client:
-        url: http://${febs-monitor-admin}:8401
-        username: febs
-        password: 123456
-
-  redis:
-    database: 0
-    host: ${redis.url}
-    port: 6379
-    password: 123456
-    lettuce:
-      pool:
-        min-idle: 8
-        max-idle: 500
-        max-active: 2000
-        max-wait: 10000
-    timeout: 5000
-mybatis-plus:
-  type-aliases-package: cc.mrbird.febs.common.entity.system
-  mapper-locations: classpath:mapper/*.xml
-  configuration:
-    jdbc-type-for-null: null
-  global-config:
-    banner: false
-info:
-  app:
-    name: ${spring.application.name}
-    description: "@project.description@"
-    version: "@project.version@"
-
-management:
-  endpoints:
-    web:
-      exposure:
-        include: '*'
-  endpoint:
-    health:
-      show-details: ALWAYS

+ 0 - 60
febs-config/repository/config/FEBS-Auth-test.yml

@@ -1,60 +0,0 @@
-spring:
-  datasource:
-    dynamic:
-      hikari:
-        connection-timeout: 30000
-        max-lifetime: 1800000
-        max-pool-size: 15
-        min-idle: 5
-        connection-test-query: select 1
-        pool-name: FebsHikariCP
-      primary: base
-      datasource:
-        base:
-          username: root
-          password: 123456
-          driver-class-name: com.mysql.cj.jdbc.Driver
-          url: jdbc:mysql://${mysql.url}:3306/febs_cloud_base?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2b8
-
-  jackson:
-    date-format: yyyy-MM-dd HH:mm:ss
-    time-zone: GMT+8
-  boot:
-    admin:
-      client:
-        url: http://${febs-monitor-admin}:8401
-        username: febs
-        password: 123456
-
-  redis:
-    database: 0
-    host: ${redis.url}
-    port: 6379
-    lettuce:
-      pool:
-        min-idle: 8
-        max-idle: 500
-        max-active: 2000
-        max-wait: 10000
-    timeout: 5000
-mybatis-plus:
-  type-aliases-package: cc.mrbird.febs.common.entity.system
-  mapper-locations: classpath:mapper/*.xml
-  configuration:
-    jdbc-type-for-null: null
-  global-config:
-    banner: false
-info:
-  app:
-    name: ${spring.application.name}
-    description: "@project.description@"
-    version: "@project.version@"
-
-management:
-  endpoints:
-    web:
-      exposure:
-        include: '*'
-  endpoint:
-    health:
-      show-details: ALWAYS

+ 0 - 57
febs-config/repository/config/FEBS-Gateway.yml

@@ -1,57 +0,0 @@
-spring:
-  boot:
-    admin:
-      client:
-        url: http://${febs-monitor-admin}:8401
-        username: febs
-        password: 123456
-  mvc:
-    throw-exception-if-no-handler-found: true
-  autoconfigure:
-    exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
-zuul:
-  routes:
-    auth:
-      path: /auth/**
-      serviceId: FEBS-Auth
-      sensitiveHeaders: "*"
-    system:
-      path: /system/**
-      serviceId: FEBS-Server-System
-      sensitiveHeaders: "*"
-    test:
-      path: /test/**
-      serviceId: FEBS-Server-Test
-      sensitiveHeaders: "*"
-  retryable: false
-  ignored-services: "*"
-  ribbon:
-    eager-load:
-      enabled: true
-  host:
-    connect-timeout-millis: 5000
-    socket-timeout-millis: 5000
-  add-proxy-headers: true
-
-  SendErrorFilter:
-    error:
-      disable: true
-
-ribbon:
-  ConnectTimeout: 3000
-  ReadTimeout: 5000
-
-info:
-  app:
-    name: ${spring.application.name}
-    description: "@project.description@"
-    version: "@project.version@"
-
-management:
-  endpoints:
-    web:
-      exposure:
-        include: '*'
-  endpoint:
-    health:
-      show-details: ALWAYS

+ 0 - 74
febs-config/repository/config/FEBS-Server-System-dev.yml

@@ -1,74 +0,0 @@
-spring:
-  aop:
-    proxy-target-class: true
-  jackson:
-    date-format: yyyy-MM-dd HH:mm:ss
-    time-zone: GMT+8
-  boot:
-    admin:
-      client:
-        url: http://${febs-monitor-admin}:8401
-        username: febs
-        password: 123456
-  freemarker:
-    check-template-location: false
-
-  datasource:
-    dynamic:
-      p6spy: true
-      hikari:
-        connection-timeout: 30000
-        max-lifetime: 1800000
-        max-pool-size: 15
-        min-idle: 5
-        connection-test-query: select 1
-        pool-name: FebsHikariCP
-      primary: base
-      datasource:
-        base:
-          username: root
-          password: 123456
-          driver-class-name: com.mysql.cj.jdbc.Driver
-          url: jdbc:mysql://${mysql.url}:3306/febs_cloud_base?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2b8
-  zipkin:
-    sender:
-      type: rabbit
-  sleuth:
-    sampler:
-      probability: 1
-  rabbitmq:
-    host: ${rabbitmq.url}
-    port: 5672
-    username: febs
-    password: 123456
-
-  autoconfigure:
-    exclude: org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
-
-mybatis-plus:
-  type-aliases-package: cc.mrbird.febs.common.entity.system
-  mapper-locations: classpath:mapper/*/*.xml
-  configuration:
-    jdbc-type-for-null: null
-  global-config:
-    banner: false
-security:
-  oauth2:
-    resource:
-      id: ${spring.application.name}
-      user-info-uri: http://${febs-gateway}:8301/auth/user
-
-info:
-  app:
-    name: ${spring.application.name}
-    description: "@project.description@"
-    version: "@project.version@"
-
-management:
-  endpoints:
-    web:
-      exposure:
-        include: '*'
-  endpoint:
-    health:
-      show-details: ALWAYS

+ 0 - 74
febs-config/repository/config/FEBS-Server-System-prod.yml

@@ -1,74 +0,0 @@
-spring:
-  aop:
-    proxy-target-class: true
-  jackson:
-    date-format: yyyy-MM-dd HH:mm:ss
-    time-zone: GMT+8
-  boot:
-    admin:
-      client:
-        url: http://${febs-monitor-admin}:8401
-        username: febs
-        password: 123456
-  freemarker:
-    check-template-location: false
-
-  datasource:
-    dynamic:
-      p6spy: true
-      hikari:
-        connection-timeout: 30000
-        max-lifetime: 1800000
-        max-pool-size: 15
-        min-idle: 5
-        connection-test-query: select 1
-        pool-name: FebsHikariCP
-      primary: base
-      datasource:
-        base:
-          username: root
-          password: 123456
-          driver-class-name: com.mysql.cj.jdbc.Driver
-          url: jdbc:mysql://${mysql.url}:3306/febs_cloud_base?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2b8
-  zipkin:
-    sender:
-      type: rabbit
-  sleuth:
-    sampler:
-      probability: 1
-  rabbitmq:
-    host: ${rabbitmq.url}
-    port: 5672
-    username: febs
-    password: 123456
-
-  autoconfigure:
-    exclude: org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
-
-mybatis-plus:
-  type-aliases-package: cc.mrbird.febs.common.entity.system
-  mapper-locations: classpath:mapper/*/*.xml
-  configuration:
-    jdbc-type-for-null: null
-  global-config:
-    banner: false
-security:
-  oauth2:
-    resource:
-      id: ${spring.application.name}
-      user-info-uri: http://${febs-gateway}:8301/auth/user
-
-info:
-  app:
-    name: ${spring.application.name}
-    description: "@project.description@"
-    version: "@project.version@"
-
-management:
-  endpoints:
-    web:
-      exposure:
-        include: '*'
-  endpoint:
-    health:
-      show-details: ALWAYS

+ 0 - 74
febs-config/repository/config/FEBS-Server-System-test.yml

@@ -1,74 +0,0 @@
-spring:
-  aop:
-    proxy-target-class: true
-  jackson:
-    date-format: yyyy-MM-dd HH:mm:ss
-    time-zone: GMT+8
-  boot:
-    admin:
-      client:
-        url: http://${febs-monitor-admin}:8401
-        username: febs
-        password: 123456
-  freemarker:
-    check-template-location: false
-
-  datasource:
-    dynamic:
-      p6spy: true
-      hikari:
-        connection-timeout: 30000
-        max-lifetime: 1800000
-        max-pool-size: 15
-        min-idle: 5
-        connection-test-query: select 1
-        pool-name: FebsHikariCP
-      primary: base
-      datasource:
-        base:
-          username: root
-          password: 123456
-          driver-class-name: com.mysql.cj.jdbc.Driver
-          url: jdbc:mysql://${mysql.url}:3306/febs_cloud_base?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2b8
-  zipkin:
-    sender:
-      type: rabbit
-  sleuth:
-    sampler:
-      probability: 1
-  rabbitmq:
-    host: ${rabbitmq.url}
-    port: 5672
-    username: febs
-    password: 123456
-
-  autoconfigure:
-    exclude: org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
-
-mybatis-plus:
-  type-aliases-package: cc.mrbird.febs.common.entity.system
-  mapper-locations: classpath:mapper/*/*.xml
-  configuration:
-    jdbc-type-for-null: null
-  global-config:
-    banner: false
-security:
-  oauth2:
-    resource:
-      id: ${spring.application.name}
-      user-info-uri: http://${febs-gateway}:8301/auth/user
-
-info:
-  app:
-    name: ${spring.application.name}
-    description: "@project.description@"
-    version: "@project.version@"
-
-management:
-  endpoints:
-    web:
-      exposure:
-        include: '*'
-  endpoint:
-    health:
-      show-details: ALWAYS

+ 0 - 42
febs-config/repository/config/FEBS-Server-Test.yml

@@ -1,42 +0,0 @@
-spring:
-  boot:
-    admin:
-      client:
-        url: http://${febs-monitor-admin}:8401
-        username: febs
-        password: 123456
-  autoconfigure:
-    exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration,org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
-
-  zipkin:
-    sender:
-      type: rabbit
-  sleuth:
-    sampler:
-      probability: 1
-  rabbitmq:
-    host: ${rabbitmq.url}
-    port: 5672
-    username: febs
-    password: 123456
-
-security:
-  oauth2:
-    resource:
-      id: ${spring.application.name}
-      user-info-uri: http://${febs-gateway}:8301/auth/user
-
-info:
-  app:
-    name: ${spring.application.name}
-    description: "@project.description@"
-    version: "@project.version@"
-
-management:
-  endpoints:
-    web:
-      exposure:
-        include: '*'
-  endpoint:
-    health:
-      show-details: ALWAYS

+ 0 - 4
febs-config/run.sh

@@ -1,4 +0,0 @@
-#!/usr/bin/env bash
-mvn package
-
-docker build - t febs-config .

+ 0 - 20
febs-config/src/main/java/cc/mrbird/febs/config/FebsConfigApplication.java

@@ -1,20 +0,0 @@
-package cc.mrbird.febs.config;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
-import org.springframework.cloud.config.server.EnableConfigServer;
-
-/**
- * 配置中心服务
- */
-@EnableDiscoveryClient
-@EnableConfigServer
-@SpringBootApplication
-public class FebsConfigApplication {
-
-    public static void main(String[] args) {
-        SpringApplication.run(FebsConfigApplication.class, args);
-    }
-
-}

+ 0 - 35
febs-config/src/main/java/cc/mrbird/febs/config/runner/StartedUpRunner.java

@@ -1,35 +0,0 @@
-package cc.mrbird.febs.config.runner;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.ApplicationArguments;
-import org.springframework.boot.ApplicationRunner;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.stereotype.Component;
-
-import java.time.LocalDateTime;
-
-@Component
-public class StartedUpRunner implements ApplicationRunner {
-
-    private Logger log = LoggerFactory.getLogger(this.getClass());
-
-    @Autowired
-    private ConfigurableApplicationContext context;
-
-    @Value("${spring.application.name:'FEBS-Config'}")
-    private String applicationName;
-
-    @Override
-    public void run(ApplicationArguments args) {
-        if (context.isActive()) {
-            log.info(" __    ___   _      ___   _     ____ _____  ____ ");
-            log.info("/ /`  / / \\ | |\\/| | |_) | |   | |_   | |  | |_  ");
-            log.info("\\_\\_, \\_\\_/ |_|  | |_|   |_|__ |_|__  |_|  |_|__ ");
-            log.info("                                                      ");
-            log.info("{} 启动完毕,时间:{}", applicationName, LocalDateTime.now());
-        }
-    }
-}

+ 0 - 8
febs-config/src/main/resources/banner.txt

@@ -1,8 +0,0 @@
-|------------------------------|
-|    ____  ____  ___   __      |
-|   | |_  | |_  | |_) ( (`     |
-|   |_|   |_|__ |_|_) _)_)     |
-|                              |
-|   ${spring.application.name}                |
-|   Spring-Boot: ${spring-boot.version} |
-|------------------------------|

+ 0 - 49
febs-config/src/main/resources/bootstrap.yml

@@ -1,49 +0,0 @@
-server:
-  port: 8501
-spring:
-  application:
-    name: FEBS-Config
-  boot:
-    admin:
-      client:
-        url: http://${febs-monitor-admin}:8401
-        username: febs
-        password: 123456
-
-  profiles:
-    active: git
-  cloud:
-    config:
-      server:
-        git:
-          uri: 您的git仓库链接
-          search-paths: /config/
-          username: 您的git仓库用户名
-          password: 您的git仓库密码
-          clone-on-start: true
-
-eureka:
-  instance:
-    lease-renewal-interval-in-seconds: 20
-  client:
-    register-with-eureka: true
-    fetch-registry: true
-    instance-info-replication-interval-seconds: 30
-    registry-fetch-interval-seconds: 3
-    serviceUrl:
-      defaultZone: http://febs:123456@${febs-register}:8001/register/eureka/
-
-info:
-  app:
-    name: ${spring.application.name}
-    description: "@project.description@"
-    version: "@project.version@"
-
-management:
-  endpoints:
-    web:
-      exposure:
-        include: '*'
-  endpoint:
-    health:
-      show-details: ALWAYS

+ 0 - 53
febs-config/src/main/resources/logback-spring.xml

@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration scan="true" scanPeriod="60 seconds" debug="false">
-    <contextName>febs</contextName>
-    <property name="log.path" value="log/febs-config" />
-    <property name="log.maxHistory" value="15" />
-    <property name="log.colorPattern" value="%magenta(%d{yyyy-MM-dd HH:mm:ss}) %highlight(%-5level) %yellow(%thread) %green(%logger) %msg%n"/>
-    <property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5level %thread %logger %msg%n"/>
-    <!--输出到控制台-->
-    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
-        <encoder>
-            <pattern>${log.colorPattern}</pattern>
-        </encoder>
-    </appender>
-
-    <!--输出到文件-->
-    <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <fileNamePattern>${log.path}/info/info.%d{yyyy-MM-dd}.log</fileNamePattern>
-            <MaxHistory>${log.maxHistory}</MaxHistory>
-        </rollingPolicy>
-        <encoder>
-            <pattern>${log.pattern}</pattern>
-        </encoder>
-        <filter class="ch.qos.logback.classic.filter.LevelFilter">
-            <level>INFO</level>
-            <onMatch>ACCEPT</onMatch>
-            <onMismatch>DENY</onMismatch>
-        </filter>
-    </appender>
-
-    <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <fileNamePattern>${log.path}/error/error.%d{yyyy-MM-dd}.log</fileNamePattern>
-        </rollingPolicy>
-        <encoder>
-            <pattern>${log.pattern}</pattern>
-        </encoder>
-        <filter class="ch.qos.logback.classic.filter.LevelFilter">
-            <level>ERROR</level>
-            <onMatch>ACCEPT</onMatch>
-            <onMismatch>DENY</onMismatch>
-        </filter>
-    </appender>
-
-    <root level="debug">
-        <appender-ref ref="console" />
-    </root>
-
-    <root level="info">
-        <appender-ref ref="file_info" />
-        <appender-ref ref="file_error" />
-    </root>
-</configuration>

+ 0 - 4
febs-gateway/pom.xml

@@ -53,10 +53,6 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-actuator</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
-        </dependency>
         <dependency>
             <groupId>com.alibaba.csp</groupId>
             <artifactId>sentinel-spring-cloud-gateway-adapter</artifactId>

+ 3 - 1
febs-gateway/src/main/resources/bootstrap.yml

@@ -7,4 +7,6 @@ spring:
         server-addr: ${nacos.url}:8001
         group: DEFAULT_GROUP
         prefix: febs-gateway
-        file-extension: yaml
+        file-extension: yaml
+      discovery:
+        server-addr: ${nacos.url}:8001

+ 4 - 0
febs-monitor/febs-monitor-admin/pom.xml

@@ -33,6 +33,10 @@
             <artifactId>spring-boot-admin-server-ui</artifactId>
             <version>2.1.6</version>
         </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

+ 0 - 14
febs-monitor/febs-monitor-admin/src/main/resources/application.yml

@@ -1,14 +0,0 @@
-server:
-  port: 8401
-
-spring:
-  application:
-    name: FEBS-Monitor-Admin
-  security:
-    user:
-      name: febs
-      password: 123456
-  boot:
-    admin:
-      ui:
-        title: ${spring.application.name}

+ 10 - 0
febs-monitor/febs-monitor-admin/src/main/resources/bootstrap.yml

@@ -0,0 +1,10 @@
+spring:
+  application:
+    name: FEBS-Monitor-Admin
+  cloud:
+    nacos:
+      config:
+        server-addr: ${nacos.url}:8001
+        group: DEFAULT_GROUP
+        prefix: febs-monitor-admin
+        file-extension: yaml

+ 0 - 5
febs-register/Dockerfile

@@ -1,5 +0,0 @@
-FROM openjdk:8u212-jre
-MAINTAINER MrBird 852252810@qq.com
-
-COPY ./target/febs-register-1.0-SNAPSHOT.jar /febs/febs-register-1.0-SNAPSHOT.jar
-ENTRYPOINT ["java", "-Xmx256m", "-jar", "/febs/febs-register-1.0-SNAPSHOT.jar"]

+ 0 - 42
febs-register/pom.xml

@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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>cc.mrbird</groupId>
-        <artifactId>febs-cloud</artifactId>
-        <version>1.0-SNAPSHOT</version>
-        <relativePath>../febs-cloud/pom.xml</relativePath>
-    </parent>
-
-    <artifactId>febs-register</artifactId>
-    <version>1.0-SNAPSHOT</version>
-    <name>FEBS-Register</name>
-    <description>FEBS-Cloud服务注册中心</description>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-starter-security</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>de.codecentric</groupId>
-            <artifactId>spring-boot-admin-starter-client</artifactId>
-            <version>2.1.6</version>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-            </plugin>
-        </plugins>
-    </build>
-
-</project>

+ 0 - 4
febs-register/run.sh

@@ -1,4 +0,0 @@
-#!/usr/bin/env bash
-mvn package
-
-docker build -t febs-register .

+ 0 - 17
febs-register/src/main/java/cc/mrbird/febs/register/FebsRegisterApplication.java

@@ -1,17 +0,0 @@
-package cc.mrbird.febs.register;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
-
-/**
- * @author MrBird
- */
-@EnableEurekaServer
-@SpringBootApplication
-public class FebsRegisterApplication {
-
-    public static void main(String[] args) {
-        SpringApplication.run(FebsRegisterApplication.class, args);
-    }
-}

+ 0 - 24
febs-register/src/main/java/cc/mrbird/febs/register/configure/FebsRegisterWebSecurityConfigure.java

@@ -1,24 +0,0 @@
-package cc.mrbird.febs.register.configure;
-
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
-
-/**
- * WebSecurity配置
- *
- * @author MrBird
- */
-@EnableWebSecurity
-public class FebsRegisterWebSecurityConfigure extends WebSecurityConfigurerAdapter {
-    @Override
-    protected void configure(HttpSecurity http) throws Exception {
-        http.headers().frameOptions().disable()
-                .and()
-                .csrf().ignoringAntMatchers("/eureka/**")
-                .and()
-                .authorizeRequests().antMatchers("/actuator/**").permitAll();
-        super.configure(http);
-    }
-
-}

+ 0 - 35
febs-register/src/main/java/cc/mrbird/febs/register/runner/StartedUpRunner.java

@@ -1,35 +0,0 @@
-package cc.mrbird.febs.register.runner;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.ApplicationArguments;
-import org.springframework.boot.ApplicationRunner;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.stereotype.Component;
-
-import java.time.LocalDateTime;
-
-@Component
-public class StartedUpRunner implements ApplicationRunner {
-
-    private Logger log = LoggerFactory.getLogger(this.getClass());
-
-    @Autowired
-    private ConfigurableApplicationContext context;
-
-    @Value("${spring.application.name:'FEBS-Register'}")
-    private String applicationName;
-
-    @Override
-    public void run(ApplicationArguments args) {
-        if (context.isActive()) {
-            log.info(" __    ___   _      ___   _     ____ _____  ____ ");
-            log.info("/ /`  / / \\ | |\\/| | |_) | |   | |_   | |  | |_  ");
-            log.info("\\_\\_, \\_\\_/ |_|  | |_|   |_|__ |_|__  |_|  |_|__ ");
-            log.info("                                                      ");
-            log.info("{} 启动完毕,时间:{}", applicationName, LocalDateTime.now());
-        }
-    }
-}

+ 0 - 8
febs-register/src/main/resources/banner.txt

@@ -1,8 +0,0 @@
-|------------------------------|
-|    ____  ____  ___   __      |
-|   | |_  | |_  | |_) ( (`     |
-|   |_|   |_|__ |_|_) _)_)     |
-|                              |
-|   ${spring.application.name}              |
-|   Spring-Boot: ${spring-boot.version} |
-|------------------------------|

+ 0 - 46
febs-register/src/main/resources/bootstrap.yml

@@ -1,46 +0,0 @@
-server:
-  port: 8001
-  servlet:
-    context-path: /register
-
-spring:
-  application:
-    name: FEBS-Register
-  boot:
-    admin:
-      client:
-        url: http://${febs-monitor-admin}:8401
-        username: febs
-        password: 123456
-  security:
-    user:
-      name: febs
-      password: 123456
-
-eureka:
-  instance:
-    hostname: ${febs-register}
-    lease-renewal-interval-in-seconds: 20
-    lease-expiration-duration-in-seconds: 60
-    prefer-ip-address: true
-  client:
-    register-with-eureka: false
-    fetch-registry: false
-    instance-info-replication-interval-seconds: 30
-    serviceUrl:
-      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@${eureka.instance.hostname}:${server.port}${server.servlet.context-path}/eureka/
-
-info:
-  app:
-    name: ${spring.application.name}
-    description: "@project.description@"
-    version: "@project.version@"
-
-management:
-  endpoints:
-    web:
-      exposure:
-        include: '*'
-  endpoint:
-    health:
-      show-details: ALWAYS

+ 0 - 54
febs-register/src/main/resources/logback-spring.xml

@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration scan="true" scanPeriod="60 seconds" debug="false">
-    <contextName>febs</contextName>
-    <property name="log.path" value="log/febs-register" />
-    <property name="log.maxHistory" value="15" />
-    <property name="log.colorPattern" value="%magenta(%d{yyyy-MM-dd HH:mm:ss}) %highlight(%-5level) %yellow(%thread) %green(%logger) %msg%n"/>
-    <property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5level %thread %logger %msg%n"/>
-
-    <!--输出到控制台-->
-    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
-        <encoder>
-            <pattern>${log.colorPattern}</pattern>
-        </encoder>
-    </appender>
-
-    <!--输出到文件-->
-    <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <fileNamePattern>${log.path}/info/info.%d{yyyy-MM-dd}.log</fileNamePattern>
-            <MaxHistory>${log.maxHistory}</MaxHistory>
-        </rollingPolicy>
-        <encoder>
-            <pattern>${log.pattern}</pattern>
-        </encoder>
-        <filter class="ch.qos.logback.classic.filter.LevelFilter">
-            <level>INFO</level>
-            <onMatch>ACCEPT</onMatch>
-            <onMismatch>DENY</onMismatch>
-        </filter>
-    </appender>
-
-    <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <fileNamePattern>${log.path}/error/error.%d{yyyy-MM-dd}.log</fileNamePattern>
-        </rollingPolicy>
-        <encoder>
-            <pattern>${log.pattern}</pattern>
-        </encoder>
-        <filter class="ch.qos.logback.classic.filter.LevelFilter">
-            <level>ERROR</level>
-            <onMatch>ACCEPT</onMatch>
-            <onMismatch>DENY</onMismatch>
-        </filter>
-    </appender>
-
-    <root level="debug">
-        <appender-ref ref="console" />
-    </root>
-
-    <root level="info">
-        <appender-ref ref="file_info" />
-        <appender-ref ref="file_error" />
-    </root>
-</configuration>

+ 13 - 21
febs-server/febs-server-system/src/main/resources/bootstrap.yml

@@ -1,27 +1,19 @@
-server:
-  port: 8201
-
 spring:
   application:
     name: FEBS-Server-System
-  cloud:
-    config:
-      fail-fast: true
-      name: ${spring.application.name}
-      profile: ${spring.profiles.active}
-      discovery:
-        enabled: true
-        service-id: FEBS-Config
   profiles:
     active: dev
+  cloud:
+    nacos:
+      config:
+        server-addr: ${nacos.url}:8001
+        group: DEFAULT_GROUP
+        prefix: febs-server-system
+        file-extension: yaml
+        refreshable-dataids:
+      discovery:
+        server-addr: ${nacos.url}:8001
 
-eureka:
-  instance:
-    lease-renewal-interval-in-seconds: 20
-  client:
-    register-with-eureka: true
-    fetch-registry: true
-    instance-info-replication-interval-seconds: 30
-    registry-fetch-interval-seconds: 3
-    serviceUrl:
-      defaultZone: http://febs:123456@${febs-register}:8001/register/eureka/
+logging:
+  level:
+    com.alibaba.nacos.client: error

+ 10 - 21
febs-server/febs-server-test/src/main/resources/bootstrap.yml

@@ -1,26 +1,15 @@
-server:
-  port: 8202
-
 spring:
   application:
     name: FEBS-Server-Test
   cloud:
-    config:
-      fail-fast: true
-      name: ${spring.application.name}
-      profile: ${spring.profiles.active}
+    nacos:
+      config:
+        server-addr: ${nacos.url}:8001
+        group: DEFAULT_GROUP
+        prefix: febs-server-test
+        file-extension: yaml
       discovery:
-        enabled: true
-        service-id: FEBS-Config
-  profiles:
-    active: dev
-
-eureka:
-  instance:
-    lease-renewal-interval-in-seconds: 20
-  client:
-    register-with-eureka: true
-    fetch-registry: true
-    instance-info-replication-interval-seconds: 30
-    serviceUrl:
-      defaultZone: http://febs:123456@${febs-register}:8001/register/eureka/
+        server-addr: ${nacos.url}:8001
+logging:
+  level:
+    com.alibaba.nacos.client: error