Преглед на файлове

:wrench: 修改配置文件。配置文件hosts

冷冷 преди 6 години
родител
ревизия
a6d5936afb

+ 1 - 1
doc/md/deploy.md

@@ -40,7 +40,7 @@ spring:
     driver-class-name: com.mysql.jdbc.Driver
     username: root
     password: lengleng
-    url: jdbc:mysql://mysql:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
+    url: jdbc:pigx-mysql://mysql:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
 ```
 
 ### 四、配置本地hosts

+ 17 - 0
docker-compose.yml

@@ -1,10 +1,18 @@
 version: '2'
 services:
+  pigx-zookeeper:
+    image: zookeeper:3.4.13
+    ports:
+      - 2181:2181
+    restart: always
+    container_name: pigx-zookeeper
+
   pigx-redis:
     image: redis:4.0.10
     ports:
       - 6379:6379
     restart: always
+    container_name: pigx-redis
 
   pigx-eureka:
     build:
@@ -13,6 +21,7 @@ services:
     restart: always
     ports:
       - 1025:1025
+    container_name: pigx-eureka
 
   pigx-config:
     links:
@@ -21,6 +30,7 @@ services:
       context: ./
       dockerfile: ./pigx-config/Dockerfile
     restart: always
+    container_name: pigx-config
 
   pigx-gateway:
     links:
@@ -32,6 +42,7 @@ services:
     restart: always
     ports:
       - 9999:9999
+    container_name: pigx-gateway
 
   pigx-auth:
     links:
@@ -41,6 +52,7 @@ services:
       context: ./
       dockerfile: ./pigx-auth/Dockerfile
     restart: always
+    container_name: pigx-auth
 
   pigx-upms:
     links:
@@ -51,6 +63,7 @@ services:
       context: ./
       dockerfile: ./pigx-upms/pigx-upms-biz/Dockerfile
     restart: always
+    container_name: pigx-upms
 
   pigx-monitor:
     links:
@@ -62,6 +75,7 @@ services:
     restart: always
     ports:
       - 5001:5001
+    container_name: pigx-monitor
 
   pigx-daemon:
     links:
@@ -73,6 +87,7 @@ services:
     restart: always
     ports:
       - 5002:5002
+    container_name: pigx-daemon
 
   pigx-codegen:
     links:
@@ -82,6 +97,7 @@ services:
       context: ./
       dockerfile: ./pigx-visual/pigx-codegen/Dockerfile
     restart: always
+    container_name: pigx-codegen
 
   pigx-tx-manager:
     links:
@@ -94,3 +110,4 @@ services:
     ports:
       - 5004:5004
       - 9998:9998
+    container_name: pigx-tx-manager

+ 1 - 1
pigx-auth/src/main/resources/bootstrap.yml

@@ -20,4 +20,4 @@ eureka:
     prefer-ip-address: true
   client:
     service-url:
-      defaultZone: http://pig:pig@localhost:1025/eureka/
+      defaultZone: http://pig:pig@pigx-eureka:1025/eureka/

+ 1 - 1
pigx-config/src/main/resources/bootstrap.yml

@@ -19,7 +19,7 @@ eureka:
     prefer-ip-address: true
   client:
     service-url:
-      defaultZone: http://pig:pig@localhost:1025/eureka/
+      defaultZone: http://pig:pig@pigx-eureka:1025/eureka/
 
 # 暴露监控端点
 management:

+ 5 - 6
pigx-config/src/main/resources/config/application-dev.yml

@@ -6,7 +6,7 @@ jasypt:
 spring:
   redis:
     password:
-    host: redis
+    host: pigx-redis
   # Jackson配置
   jackson:
     time-zone: GMT+8
@@ -78,7 +78,7 @@ mybatis-plus:
 swagger:
   title: PigX Swagger API
   description: 全宇宙最牛逼的Spring Cloud微服务开发脚手架
-  version: 1.6.2
+  version: 1.7.0
   license: Powered By PigX
   licenseUrl: https://pig4cloud.com/
   terms-of-service-url: https://pig4cloud.com/
@@ -93,12 +93,11 @@ swagger:
       - scope: server
         description: server all
     token-url-list:
-      - ${security.auth.server}/token
+      - http://pigx-gateway:9999/auth/oauth/token
 
 ## spring security 配置
 security:
-  auth:
-    server: http://localhost:9999/auth/oauth
   oauth2:
     resource:
-      token-info-uri: ${security.auth.server}/check_token
+      loadBalanced: true
+      token-info-uri: http://pigx-auth/oauth/check_token

+ 2 - 2
pigx-config/src/main/resources/config/pigx-auth-dev.yml

@@ -4,5 +4,5 @@ spring:
     type: com.zaxxer.hikari.HikariDataSource
     driver-class-name: com.mysql.jdbc.Driver
     username: root
-    password: 123456
-    url: jdbc:mysql://mysql:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
+    password:  root
+    url: jdbc:mysql://pigx-mysql:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false

+ 2 - 2
pigx-config/src/main/resources/config/pigx-codegen-dev.yml

@@ -12,7 +12,7 @@ spring:
     type: com.zaxxer.hikari.HikariDataSource
     driver-class-name: com.mysql.jdbc.Driver
     username: root
-    password: 123456
-    url: jdbc:mysql://mysql:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
+    password:  root
+    url: jdbc:mysql://pigx-mysql:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
   resources:
     static-locations: classpath:/static/,classpath:/views/

+ 3 - 3
pigx-config/src/main/resources/config/pigx-daemon-dev.yml

@@ -13,12 +13,12 @@ spring:
     type: com.zaxxer.hikari.HikariDataSource
     driver-class-name: com.mysql.jdbc.Driver
     username: root
-    password: 123456
-    url: jdbc:mysql://mysql:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
+    password:  root
+    url: jdbc:mysql://pigx-mysql:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
   elasticjob:
     # 分布式任务协调依赖zookeeper
     zookeeper:
-      server-lists: zookeeper:2181
+      server-lists: pigx-zookeeper:2181
       namespace: pigx-daemon
     # 普通任务
     simples:

+ 1 - 1
pigx-config/src/main/resources/config/pigx-gateway-dev.yml

@@ -11,7 +11,7 @@ spring:
         - Path=/auth/**
         filters:
           # 验证码处理
-        - ImageCodeGatewayFilter
+        - ValidateCodeGatewayFilter
           # 前端密码解密
         - PasswordDecoderFilter
       #UPMS 模块

+ 2 - 2
pigx-config/src/main/resources/config/pigx-upms-dev.yml

@@ -12,8 +12,8 @@ spring:
     type: com.zaxxer.hikari.HikariDataSource
     driver-class-name: com.mysql.jdbc.Driver
     username: root
-    password: 123456
-    url: jdbc:mysql://mysql:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true
+    password: root
+    url: jdbc:mysql://pigx-mysql:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true
 
 # swagger相关配置,覆盖全局配置
 swagger:

+ 1 - 1
pigx-gateway/src/main/java/com/pig4cloud/pigx/gateway/filter/PasswordDecoderFilter.java

@@ -65,7 +65,7 @@ public class PasswordDecoderFilter extends AbstractGatewayFilterFactory {
 			ServerHttpRequest request = exchange.getRequest();
 
 			// 不是登录请求,直接向下执行
-			if (!StrUtil.containsAnyIgnoreCase(request.getURI().getPath(), ImageCodeGatewayFilter.OAUTH_TOKEN_URL)) {
+			if (!StrUtil.containsAnyIgnoreCase(request.getURI().getPath(), ValidateCodeGatewayFilter.OAUTH_TOKEN_URL)) {
 				return chain.filter(exchange);
 			}
 

+ 1 - 1
pigx-gateway/src/main/java/com/pig4cloud/pigx/gateway/filter/ImageCodeGatewayFilter.java

@@ -42,7 +42,7 @@ import java.io.IOException;
  */
 @Slf4j
 @Component
-public class ImageCodeGatewayFilter extends AbstractGatewayFilterFactory {
+public class ValidateCodeGatewayFilter extends AbstractGatewayFilterFactory {
 	public static final String DEFAULT_CODE_KEY = "DEFAULT_CODE_KEY";
 	public static final String OAUTH_TOKEN_URL = "/oauth/token";
 	private static final String BASIC_ = "Basic ";

+ 2 - 2
pigx-gateway/src/main/java/com/pig4cloud/pigx/gateway/handler/ImageCodeHandler.java

@@ -18,7 +18,7 @@
 package com.pig4cloud.pigx.gateway.handler;
 
 import com.google.code.kaptcha.Producer;
-import com.pig4cloud.pigx.gateway.filter.ImageCodeGatewayFilter;
+import com.pig4cloud.pigx.gateway.filter.ValidateCodeGatewayFilter;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.core.io.ByteArrayResource;
@@ -58,7 +58,7 @@ public class ImageCodeHandler implements HandlerFunction<ServerResponse> {
 
 		//保存验证码信息
 		String randomStr = serverRequest.queryParam("randomStr").get();
-		redisTemplate.opsForValue().set(ImageCodeGatewayFilter.DEFAULT_CODE_KEY + randomStr, text, 60, TimeUnit.SECONDS);
+		redisTemplate.opsForValue().set(ValidateCodeGatewayFilter.DEFAULT_CODE_KEY + randomStr, text, 60, TimeUnit.SECONDS);
 
 		// 转换流信息写出
 		FastByteArrayOutputStream os = new FastByteArrayOutputStream();

+ 1 - 1
pigx-gateway/src/main/resources/bootstrap.yml

@@ -22,6 +22,6 @@ eureka:
     prefer-ip-address: true
   client:
     service-url:
-      defaultZone: http://pig:pig@localhost:1025/eureka/
+      defaultZone: http://pig:pig@pigx-eureka:1025/eureka/
 
 

+ 1 - 1
pigx-upms/pigx-upms-biz/src/main/resources/bootstrap.yml

@@ -23,4 +23,4 @@ eureka:
     prefer-ip-address: true
   client:
     service-url:
-      defaultZone: http://pig:pig@localhost:1025/eureka/
+      defaultZone: http://pig:pig@pigx-eureka:1025/eureka/

+ 1 - 1
pigx-visual/pigx-codegen/src/main/resources/bootstrap.yml

@@ -20,7 +20,7 @@ eureka:
     prefer-ip-address: true
   client:
     service-url:
-      defaultZone: http://pig:pig@localhost:1025/eureka/
+      defaultZone: http://pig:pig@pigx-eureka:1025/eureka/
 logging:
   level:
     root: info

+ 1 - 1
pigx-visual/pigx-daemon/src/main/resources/bootstrap.yml

@@ -20,4 +20,4 @@ eureka:
     prefer-ip-address: true
   client:
     service-url:
-      defaultZone: http://pig:pig@localhost:1025/eureka/
+      defaultZone: http://pig:pig@pigx-eureka:1025/eureka/

+ 1 - 1
pigx-visual/pigx-monitor/src/main/resources/bootstrap.yml

@@ -20,4 +20,4 @@ eureka:
     prefer-ip-address: true
   client:
     service-url:
-      defaultZone: http://pig:pig@localhost:1025/eureka/
+      defaultZone: http://pig:pig@pigx-eureka:1025/eureka/

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/resources/bootstrap.yml

@@ -20,5 +20,5 @@ eureka:
     prefer-ip-address: true
   client:
     service-url:
-      defaultZone: http://pig:pig@localhost:1025/eureka/
+      defaultZone: http://pig:pig@pigx-eureka:1025/eureka/
 

+ 1 - 1
pom.xml

@@ -30,7 +30,7 @@
 	<url>https://www.pig4cloud.com</url>
 
 	<properties>
-		<pigx.version>1.6.4</pigx.version>
+		<pigx.version>1.7.0</pigx.version>
 		<spring-boot.version>2.0.6.RELEASE</spring-boot.version>
 		<spring-cloud.version>Finchley.SR2</spring-cloud.version>
 		<spring-platform.version>Cairo-SR3</spring-platform.version>