diff --git a/README.md b/README.md index cd444e986..b3675f2f9 100644 --- a/README.md +++ b/README.md @@ -50,9 +50,9 @@ Topiam IAM/IDaaS身份管理平台 - https://www.topiam.cn/
| 后端代码风格 | 严格遵守Alibaba规范与项目统一配置的代码格式化 | 代码书写与常规结构不同阅读障碍大 | | 分布式注册中心 | 采用 Alibaba Nacos 源码集成便于调试扩展与二次开发 框架还为其增加了各种监控 | 采用 Alibaba Nacos 自行搭建纯官方版本不可靠 | | 分布式配置中心 | 采用 Alibaba Nacos 源码集成便于调试扩展与二次开发 框架还为其增加了各种监控 | 采用 Alibaba Nacos 自行搭建纯官方版本不可靠 | -| 服务网关 | 采用 SpringCloud Gateway 框架扩展了多种功能
例如:内网鉴权、请求体缓存、跨域配置、请求响应日志等 | 采用 SpringCloud Gateway 功能单一 | -| 负载均衡 | 采用 SpringCloud Loadbalancer 扩展支持了开发团队路由 便于多团队开发调试 | 采用 SpringCloud Loadbalancer 功能单一 | -| RPC远程调用 | 采用 全新 Apache Dubbo 3.X 历史悠远不用多说 | 采用 feign 功能有限编写方式 网络波动大 不稳定 | +| 服务网关 | 采用 SpringCloud Gateway 框架扩展了多种功能
例如:内网鉴权、请求体缓存、跨域配置、请求响应日志等 | 采用 SpringCloud Gateway | +| 负载均衡 | 采用 SpringCloud Loadbalancer 扩展支持了开发团队路由 便于多团队开发调试 | 采用 SpringCloud Loadbalancer | +| 远程调用 | 采用 feign 功能 | 采用 feign 功能 | | 分布式限流熔断 | 采用 Alibaba Sentinel 源码集成便于调试扩展与二次开发 框架还为其增加了各种监控 | 采用 Alibaba Sentinel 自行搭建纯官方版本不可靠 | | 分布式事务 | 采用 Alibaba Seata 源码集成对接了Nacos与各种监控 简化了搭建部署流程 | 采用 Alibaba Seata 自行搭建纯官方版本 搭建繁琐与Nacos不挂钩 代码内使用方式怪异等 | | Web容器 | 采用 Undertow 基于 XNIO 的高性能容器 | 采用 Tomcat | diff --git a/pom.xml b/pom.xml index 657c77a1f..813c843da 100644 --- a/pom.xml +++ b/pom.xml @@ -75,10 +75,8 @@ dev - public + prod 127.0.0.1:8848 - DEFAULT_GROUP - DEFAULT_GROUP nacos nacos 127.0.0.1:4560 @@ -93,8 +91,6 @@ prod 127.0.0.1:8848 - DEFAULT_GROUP - DEFAULT_GROUP nacos nacos 127.0.0.1:4560 diff --git a/ruoyi-auth/src/main/resources/application.yml b/ruoyi-auth/src/main/resources/application.yml index 90c053563..4bbe782d2 100644 --- a/ruoyi-auth/src/main/resources/application.yml +++ b/ruoyi-auth/src/main/resources/application.yml @@ -21,12 +21,12 @@ spring: password: @nacos.password@ discovery: # 注册组 - group: @nacos.discovery.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: # 配置组 - group: @nacos.config.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: import: - optional:nacos:application-common.yml diff --git a/ruoyi-example/ruoyi-demo/src/main/resources/application.yml b/ruoyi-example/ruoyi-demo/src/main/resources/application.yml index f30accfe1..cfe52a521 100644 --- a/ruoyi-example/ruoyi-demo/src/main/resources/application.yml +++ b/ruoyi-example/ruoyi-demo/src/main/resources/application.yml @@ -21,12 +21,12 @@ spring: password: @nacos.password@ discovery: # 注册组 - group: @nacos.discovery.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: # 配置组 - group: @nacos.config.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: import: - optional:nacos:application-common.yml diff --git a/ruoyi-example/ruoyi-test-mq/src/main/resources/application.yml b/ruoyi-example/ruoyi-test-mq/src/main/resources/application.yml index 13561bad9..7e27a143d 100644 --- a/ruoyi-example/ruoyi-test-mq/src/main/resources/application.yml +++ b/ruoyi-example/ruoyi-test-mq/src/main/resources/application.yml @@ -54,12 +54,12 @@ spring: password: @nacos.password@ discovery: # 注册组 - group: @nacos.discovery.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: # 配置组 - group: @nacos.config.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: import: - optional:nacos:application-common.yml diff --git a/ruoyi-gateway-mvc/src/main/resources/application.yml b/ruoyi-gateway-mvc/src/main/resources/application.yml index ef0e69ab0..b081bfe2c 100644 --- a/ruoyi-gateway-mvc/src/main/resources/application.yml +++ b/ruoyi-gateway-mvc/src/main/resources/application.yml @@ -23,12 +23,12 @@ spring: password: @nacos.password@ discovery: # 注册组 - group: @nacos.discovery.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: # 配置组 - group: @nacos.config.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: import: - optional:nacos:application-common.yml diff --git a/ruoyi-gateway/src/main/resources/application.yml b/ruoyi-gateway/src/main/resources/application.yml index 98c9dd040..7f4c0570b 100644 --- a/ruoyi-gateway/src/main/resources/application.yml +++ b/ruoyi-gateway/src/main/resources/application.yml @@ -23,12 +23,12 @@ spring: password: @nacos.password@ discovery: # 注册组 - group: @nacos.discovery.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: # 配置组 - group: @nacos.config.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: import: - optional:nacos:application-common.yml diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/application.yml b/ruoyi-modules/ruoyi-gen/src/main/resources/application.yml index b90d96481..d3c662c01 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/application.yml +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/application.yml @@ -21,12 +21,12 @@ spring: password: @nacos.password@ discovery: # 注册组 - group: @nacos.discovery.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: # 配置组 - group: @nacos.config.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: import: - optional:nacos:application-common.yml diff --git a/ruoyi-modules/ruoyi-job/src/main/resources/application.yml b/ruoyi-modules/ruoyi-job/src/main/resources/application.yml index caf02be39..8b10e7aeb 100644 --- a/ruoyi-modules/ruoyi-job/src/main/resources/application.yml +++ b/ruoyi-modules/ruoyi-job/src/main/resources/application.yml @@ -21,12 +21,12 @@ spring: password: @nacos.password@ discovery: # 注册组 - group: @nacos.discovery.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: # 配置组 - group: @nacos.config.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: import: - optional:nacos:application-common.yml diff --git a/ruoyi-modules/ruoyi-resource/src/main/resources/application.yml b/ruoyi-modules/ruoyi-resource/src/main/resources/application.yml index ff8e56ba1..21fc59e60 100644 --- a/ruoyi-modules/ruoyi-resource/src/main/resources/application.yml +++ b/ruoyi-modules/ruoyi-resource/src/main/resources/application.yml @@ -21,12 +21,12 @@ spring: password: @nacos.password@ discovery: # 注册组 - group: @nacos.discovery.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: # 配置组 - group: @nacos.config.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: import: - optional:nacos:application-common.yml diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/application.yml b/ruoyi-modules/ruoyi-system/src/main/resources/application.yml index 50b025163..41ecae509 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/application.yml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/application.yml @@ -21,12 +21,12 @@ spring: password: @nacos.password@ discovery: # 注册组 - group: @nacos.discovery.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: # 配置组 - group: @nacos.config.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: import: - optional:nacos:application-common.yml diff --git a/ruoyi-modules/ruoyi-workflow/src/main/resources/application.yml b/ruoyi-modules/ruoyi-workflow/src/main/resources/application.yml index 808604a5d..81c281cd4 100644 --- a/ruoyi-modules/ruoyi-workflow/src/main/resources/application.yml +++ b/ruoyi-modules/ruoyi-workflow/src/main/resources/application.yml @@ -21,12 +21,12 @@ spring: password: @nacos.password@ discovery: # 注册组 - group: @nacos.discovery.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: # 配置组 - group: @nacos.config.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: import: - optional:nacos:application-common.yml diff --git a/ruoyi-visual/pom.xml b/ruoyi-visual/pom.xml index f5894c1e8..4a8276070 100644 --- a/ruoyi-visual/pom.xml +++ b/ruoyi-visual/pom.xml @@ -10,8 +10,6 @@ ruoyi-monitor - ruoyi-seata-server - ruoyi-nacos ruoyi-snailjob-server diff --git a/ruoyi-visual/ruoyi-monitor/src/main/resources/application.yml b/ruoyi-visual/ruoyi-monitor/src/main/resources/application.yml index 2bca46ac0..f9df06a9e 100644 --- a/ruoyi-visual/ruoyi-monitor/src/main/resources/application.yml +++ b/ruoyi-visual/ruoyi-monitor/src/main/resources/application.yml @@ -21,12 +21,12 @@ spring: password: @nacos.password@ discovery: # 注册组 - group: @nacos.discovery.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: # 配置组 - group: @nacos.config.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: import: - optional:nacos:application-common.yml diff --git a/ruoyi-visual/ruoyi-nacos/Dockerfile b/ruoyi-visual/ruoyi-nacos/Dockerfile deleted file mode 100644 index fd9f8a745..000000000 --- a/ruoyi-visual/ruoyi-nacos/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -# 贝尔实验室 Spring 官方推荐镜像 JDK下载地址 https://bell-sw.com/pages/downloads/ -FROM bellsoft/liberica-openjdk-rocky:17.0.16-cds -#FROM bellsoft/liberica-openjdk-rocky:21.0.8-cds -#FROM findepi/graalvm:java17-native - -LABEL maintainer="Lion Li" - -RUN mkdir -p /ruoyi/nacos - -WORKDIR /ruoyi/nacos - -EXPOSE 8848 - -ENV TZ=Asia/Shanghai LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS="-Xms512m -Xmx1024m" - -ADD ./target/ruoyi-nacos.jar ./app.jar - -SHELL ["/bin/bash", "-c"] - -ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom ${JAVA_OPTS} -jar app.jar - diff --git a/ruoyi-visual/ruoyi-nacos/pom.xml b/ruoyi-visual/ruoyi-nacos/pom.xml deleted file mode 100644 index b59bb4898..000000000 --- a/ruoyi-visual/ruoyi-nacos/pom.xml +++ /dev/null @@ -1,365 +0,0 @@ - - - - 4.0.0 - - org.dromara - ruoyi-visual - ${revision} - - ruoyi-nacos - jar - - - 2.5.1 - 2.0 - - 2.7.18 - 2.7.11 - ${project.basedir}/src/main/resources/lib - - - - - - - org.springframework.boot - spring-boot-dependencies - ${spring-boot.version} - pom - import - - - com.alibaba.nacos - nacos-all - ${nacos.version} - pom - import - - - - - - - com.alibaba.nacos - nacos-console - ${nacos.version} - system - ${nacos.lib.path}/nacos-console-${nacos.version}.jar - - - com.alibaba.nacos - nacos-auth - ${nacos.version} - system - ${nacos.lib.path}/nacos-auth-${nacos.version}.jar - - - com.alibaba.nacos - nacos-cmdb - ${nacos.version} - system - ${nacos.lib.path}/nacos-cmdb-${nacos.version}.jar - - - com.alibaba.nacos - nacos-config - ${nacos.version} - system - ${nacos.lib.path}/nacos-config-${nacos.version}.jar - - - com.alibaba.nacos - nacos-persistence - ${nacos.version} - system - ${nacos.lib.path}/nacos-persistence-${nacos.version}.jar - - - com.alibaba.nacos - nacos-consistency - ${nacos.version} - system - ${nacos.lib.path}/nacos-consistency-${nacos.version}.jar - - - com.alibaba.nacos - nacos-control-plugin - ${nacos.version} - system - ${nacos.lib.path}/nacos-control-plugin-${nacos.version}.jar - - - com.alibaba.nacos - nacos-config-plugin - ${nacos.version} - system - ${nacos.lib.path}/nacos-config-plugin-${nacos.version}.jar - - - com.alibaba.nacos - nacos-core - ${nacos.version} - system - ${nacos.lib.path}/nacos-core-${nacos.version}.jar - - - com.alibaba.nacos - nacos-istio - ${nacos.version} - system - ${nacos.lib.path}/nacos-istio-${nacos.version}.jar - - - com.alibaba.nacos - nacos-naming - ${nacos.version} - system - ${nacos.lib.path}/nacos-naming-${nacos.version}.jar - - - com.alibaba.nacos - default-auth-plugin - ${nacos.version} - system - ${nacos.lib.path}/default-auth-plugin-${nacos.version}.jar - - - com.alibaba.nacos - default-control-plugin - ${nacos.version} - system - ${nacos.lib.path}/default-control-plugin-${nacos.version}.jar - - - com.alibaba.nacos - nacos-prometheus - ${nacos.version} - system - ${nacos.lib.path}/nacos-prometheus-${nacos.version}.jar - - - com.alibaba.nacos - nacos-sys - ${nacos.version} - system - ${nacos.lib.path}/nacos-sys-${nacos.version}.jar - - - com.alibaba.nacos - nacos-default-plugin-all - ${nacos.version} - system - ${nacos.lib.path}/nacos-default-plugin-all-${nacos.version}.jar - - - com.alibaba.nacos - nacos-custom-environment-plugin - ${nacos.version} - - - com.alibaba.nacos - nacos-datasource-plugin - ${nacos.version} - - - com.alibaba.nacos - nacos-encryption-plugin - ${nacos.version} - - - com.alibaba.nacos - nacos-trace-plugin - ${nacos.version} - - - com.alibaba.nacos - nacos-common - ${nacos.version} - - - com.alibaba.nacos - nacos-client - - - - - org.springframework.boot - spring-boot-starter-web - - - log4j-to-slf4j - org.apache.logging.log4j - - - - - - org.apache.tomcat.embed - tomcat-embed-websocket - 9.0.105 - - - org.apache.tomcat.embed - tomcat-embed-core - 9.0.105 - - - org.apache.tomcat.embed - tomcat-embed-el - 9.0.105 - - - org.springframework.boot - spring-boot-starter-jdbc - - - org.springframework.boot - spring-boot-starter-aop - - - org.springframework.ldap - spring-ldap-core - - - - com.caucho - hessian - - - commons-collections - commons-collections - - - ch.qos.logback - logback-classic - - - ch.qos.logback - logback-core - - - com.mysql - mysql-connector-j - - - org.apache.derby - derby - - - com.alipay.sofa - jraft-core - - - com.alipay.sofa - rpc-grpc-impl - - - io.jsonwebtoken - jjwt-api - - - io.jsonwebtoken - jjwt-impl - runtime - - - io.jsonwebtoken - jjwt-jackson - runtime - - - com.google.code.gson - gson - - - io.micrometer - micrometer-registry-prometheus - - - io.micrometer - micrometer-registry-influx - - - io.micrometer - micrometer-registry-elastic - - - org.springframework.boot - spring-boot-starter-actuator - - - - io.envoyproxy.controlplane - api - 0.1.27 - - - - - - org.slf4j - jcl-over-slf4j - - - - org.slf4j - jul-to-slf4j - - - - org.yaml - snakeyaml - ${SnakeYaml.version} - - - - org.springframework.boot - spring-boot-starter-security - - - de.codecentric - spring-boot-admin-client - ${spring-boot-admin.version} - - - - - ${project.artifactId} - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot.version} - - - - repackage - - - - - - true - - - - - - diff --git a/ruoyi-visual/ruoyi-nacos/src/main/java/com/alibaba/nacos/Nacos.java b/ruoyi-visual/ruoyi-nacos/src/main/java/com/alibaba/nacos/Nacos.java deleted file mode 100644 index 062f3e341..000000000 --- a/ruoyi-visual/ruoyi-nacos/src/main/java/com/alibaba/nacos/Nacos.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.alibaba.nacos; - -import com.alibaba.nacos.sys.filter.NacosTypeExcludeFilter; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.AutoConfigurationExcludeFilter; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.context.TypeExcludeFilter; -import org.springframework.boot.web.servlet.ServletComponentScan; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.ComponentScan.Filter; -import org.springframework.context.annotation.FilterType; - -/** - * Nacos starter. - *

- * Use @SpringBootApplication and @ComponentScan at the same time, using CUSTOM type filter to control module enabled. - *

- * - * @author nacos - */ -@SpringBootApplication -@ComponentScan(basePackages = "com.alibaba.nacos", excludeFilters = { - @Filter(type = FilterType.CUSTOM, classes = {NacosTypeExcludeFilter.class}), - @Filter(type = FilterType.CUSTOM, classes = {TypeExcludeFilter.class}), - @Filter(type = FilterType.CUSTOM, classes = {AutoConfigurationExcludeFilter.class})}) -@ServletComponentScan -public class Nacos { - - public static void main(String[] args) { - // true 单机模式 false 为集群模式 集群模式需搭配 cluster.conf 使用 使用方法请查看文档 - System.setProperty("nacos.standalone", "true"); - System.setProperty("server.tomcat.accesslog.enabled", "false"); - // 本地集群搭建使用 分别在所有 nacos 目录下创建 conf/cluster.conf 文件用于编写集群ip端口 - // 注意 如果本地启动多个 nacos 此目录不能相同 例如 nacos1 nacos2 nacos3 对应三个nacos服务 - // System.setProperty("nacos.home", "D:/nacos"); - SpringApplication.run(Nacos.class, args); - } -} - diff --git a/ruoyi-visual/ruoyi-nacos/src/main/java/com/alibaba/nacos/config/ActuatorAuthFilter.java b/ruoyi-visual/ruoyi-nacos/src/main/java/com/alibaba/nacos/config/ActuatorAuthFilter.java deleted file mode 100644 index 6fc8576d0..000000000 --- a/ruoyi-visual/ruoyi-nacos/src/main/java/com/alibaba/nacos/config/ActuatorAuthFilter.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.alibaba.nacos.config; - -import javax.servlet.*; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.Base64; - -public class ActuatorAuthFilter implements Filter { - - private final String username; - private final String password; - - public ActuatorAuthFilter(String username, String password) { - this.username = username; - this.password = password; - } - - @Override - public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { - HttpServletRequest request = (HttpServletRequest) servletRequest; - HttpServletResponse response = (HttpServletResponse) servletResponse; - - // 获取 Authorization 头 - String authHeader = request.getHeader("Authorization"); - - if (authHeader == null || !authHeader.startsWith("Basic ")) { - // 如果没有提供 Authorization 或者格式不对,则返回 401 - response.setHeader("WWW-Authenticate", "Basic realm=\"realm\""); - response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized"); - return; - } - - // 解码 Base64 编码的用户名和密码 - String base64Credentials = authHeader.substring("Basic ".length()); - byte[] credDecoded = Base64.getDecoder().decode(base64Credentials); - String credentials = new String(credDecoded, StandardCharsets.UTF_8); - String[] split = credentials.split(":"); - if (split.length != 2) { - response.setHeader("WWW-Authenticate", "Basic realm=\"realm\""); - response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized"); - return; - } - // 验证用户名和密码 - if (!username.equals(split[0]) || !password.equals(split[1])) { - response.setHeader("WWW-Authenticate", "Basic realm=\"realm\""); - response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized"); - return; - } - // 如果认证成功,继续处理请求 - filterChain.doFilter(request, response); - } - - @Override - public void init(FilterConfig filterConfig) { - } - - @Override - public void destroy() { - } - -} diff --git a/ruoyi-visual/ruoyi-nacos/src/main/java/com/alibaba/nacos/config/SecurityConfig.java b/ruoyi-visual/ruoyi-nacos/src/main/java/com/alibaba/nacos/config/SecurityConfig.java deleted file mode 100644 index ba030ba29..000000000 --- a/ruoyi-visual/ruoyi-nacos/src/main/java/com/alibaba/nacos/config/SecurityConfig.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.alibaba.nacos.config; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.web.servlet.FilterRegistrationBean; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -/** - * 权限安全配置 - * - * @author Lion Li - */ -@Configuration -public class SecurityConfig { - - @Value("${spring.boot.admin.client.username}") - private String username; - @Value("${spring.boot.admin.client.password}") - private String password; - - @Bean - public FilterRegistrationBean actuatorFilterRegistrationBean() { - FilterRegistrationBean registrationBean = new FilterRegistrationBean<>(); - registrationBean.setFilter(new ActuatorAuthFilter(username, password)); - registrationBean.addUrlPatterns("/actuator", "/actuator/*"); - return registrationBean; - } - -} diff --git a/ruoyi-visual/ruoyi-nacos/src/main/resources/application.properties b/ruoyi-visual/ruoyi-nacos/src/main/resources/application.properties deleted file mode 100644 index 9cc5f0dd9..000000000 --- a/ruoyi-visual/ruoyi-nacos/src/main/resources/application.properties +++ /dev/null @@ -1,218 +0,0 @@ -# -# Copyright 1999-2018 Alibaba Group Holding Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -#*************** Spring Boot Related Configurations ***************# - -### Default web context path: -server.servlet.contextPath=/nacos -### Include message field -server.error.include-message=ALWAYS -### Default web server port: -server.port=8848 - -#*************** Network Related Configurations ***************# -### If prefer hostname over ip for Nacos server addresses in cluster.conf: -# nacos.inetutils.prefer-hostname-over-ip=false - -### Specify local server's IP: -# nacos.inetutils.ip-address= - -spring.application.name=ruoyi-nacos -#*************** Config Module Related Configurations ***************# -### Deprecated configuration property, it is recommended to use `spring.sql.init.platform` replaced. -# spring.datasource.platform=mysql -nacos.plugin.datasource.log.enabled=true -spring.sql.init.platform=mysql -### Count of DB: -db.num=1 - -### Connect URL of DB: -db.url.0=jdbc:mysql://127.0.0.1:3306/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true -db.user.0=root -db.password.0=root - -### the maximum retry times for push -nacos.config.push.maxRetryTime=50 - -#*************** Naming Module Related Configurations ***************# - -### If enable data warmup. If set to false, the server would accept request without local data preparation: -# nacos.naming.data.warmup=true - -### If enable the instance auto expiration, kind like of health check of instance: -# nacos.naming.expireInstance=true - -nacos.naming.empty-service.auto-clean=true -nacos.naming.empty-service.clean.initial-delay-ms=50000 -nacos.naming.empty-service.clean.period-time-ms=30000 - - -#*************** CMDB Module Related Configurations ***************# -### The interval to dump external CMDB in seconds: -# nacos.cmdb.dumpTaskInterval=3600 - -### The interval of polling data change event in seconds: -# nacos.cmdb.eventTaskInterval=10 - -### The interval of loading labels in seconds: -# nacos.cmdb.labelTaskInterval=300 - -### If turn on data loading task: -# nacos.cmdb.loadDataAtStart=false - - -#*************** Metrics Related Configurations ***************# -# 指向 ruoyi-monitor 监控 -spring.boot.admin.client.url=http://127.0.0.1:9100 -spring.boot.admin.client.username=ruoyi -spring.boot.admin.client.password=123456 -spring.boot.admin.client.instance.service-host-type=IP -spring.boot.admin.client.instance.metadata.username=${spring.boot.admin.client.username} -spring.boot.admin.client.instance.metadata.userpassword=${spring.boot.admin.client.password} - -### Metrics for prometheus -management.endpoints.web.exposure.include=* - -### Metrics for elastic search -management.metrics.export.elastic.enabled=false -#management.metrics.export.elastic.host=http://localhost:9200 - -### Metrics for influx -management.metrics.export.influx.enabled=false -#management.metrics.export.influx.db=springboot -#management.metrics.export.influx.uri=http://localhost:8086 -#management.metrics.export.influx.auto-create-db=true -#management.metrics.export.influx.consistency=one -#management.metrics.export.influx.compressed=true - -#*************** Access Control Related Configurations ***************# -### If enable spring security, this option is deprecated in 1.2.0: -#spring.security.enabled=false - -### The ignore urls of auth, is deprecated in 1.2.0: -nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-ui/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/** - -### The auth system to use, currently only 'nacos' and 'ldap' is supported: -nacos.core.auth.system.type=nacos - -### If turn on auth system: -nacos.core.auth.enabled=true - -### Turn on/off caching of auth information. By turning on this switch, the update of auth information would have a 15 seconds delay. -nacos.core.auth.caching.enabled=true - -### Since 1.4.1, Turn on/off white auth for user-agent: nacos-server, only for upgrade from old version. -nacos.core.auth.enable.userAgentAuthWhite=false - -### Since 1.4.1, worked when nacos.core.auth.enabled=true and nacos.core.auth.enable.userAgentAuthWhite=false. -### The two properties is the white list for auth and used by identity the request from other server. -### 此处为用户名密码 需要自行修改 -nacos.core.auth.server.identity.key=ruoyi-vue-plus-key -nacos.core.auth.server.identity.value=ruoyi-vue-plus-value - -### worked when nacos.core.auth.system.type=nacos -### The token expiration in seconds: -nacos.core.auth.plugin.nacos.token.cache.enable=false -nacos.core.auth.plugin.nacos.token.expire.seconds=18000 -### The default token (Base64 string): -#nacos.core.auth.plugin.nacos.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789 -### 此处为token密钥 需要自行修改 -nacos.core.auth.plugin.nacos.token.secret.key=rE7bYayhpvduYwCxuhckybEPDXyna6xwm5m7MZjtjrdXjVxAbXAMccXHyaJvB346 - -### worked when nacos.core.auth.system.type=ldap,{0} is Placeholder,replace login username -#nacos.core.auth.ldap.url=ldap://localhost:389 -#nacos.core.auth.ldap.basedc=dc=example,dc=org -#nacos.core.auth.ldap.userDn=cn=admin,${nacos.core.auth.ldap.basedc} -#nacos.core.auth.ldap.password=admin -#nacos.core.auth.ldap.userdn=cn={0},dc=example,dc=org -#nacos.core.auth.ldap.filter.prefix=uid -#nacos.core.auth.ldap.case.sensitive=true -#nacos.core.auth.ldap.ignore.partial.result.exception=false - -#*************** Control Plugin Related Configurations ***************# -# plugin type -#nacos.plugin.control.manager.type=nacos - -# local control rule storage dir, default ${nacos.home}/data/connection and ${nacos.home}/data/tps -#nacos.plugin.control.rule.local.basedir=${nacos.home} - -# external control rule storage type, if exist -#nacos.plugin.control.rule.external.storage= - -#*************** Config Change Plugin Related Configurations ***************# -# webhook -#nacos.core.config.plugin.webhook.enabled=false -# It is recommended to use EB https://help.aliyun.com/document_detail/413974.html -#nacos.core.config.plugin.webhook.url=http://localhost:8080/webhook/send?token=*** -# The content push max capacity ,byte -#nacos.core.config.plugin.webhook.contentMaxCapacity=102400 - -# whitelist -#nacos.core.config.plugin.whitelist.enabled=false -# The import file suffixs -#nacos.core.config.plugin.whitelist.suffixs=xml,text,properties,yaml,html -# fileformatcheck,which validate the import file of type and content -#nacos.core.config.plugin.fileformatcheck.enabled=false -#*************** Istio Related Configurations ***************# -### If turn on the MCP server: -nacos.istio.mcp.server.enabled=false - - - -###*************** Add from 1.3.0 ***************### - - -#*************** Core Related Configurations ***************# - -### set the WorkerID manually -# nacos.core.snowflake.worker-id= - -### Member-MetaData -# nacos.core.member.meta.site= -# nacos.core.member.meta.adweight= -# nacos.core.member.meta.weight= - -### MemberLookup -### Addressing pattern category, If set, the priority is highest -# nacos.core.member.lookup.type=[file,address-server] -## Set the cluster list with a configuration file or command-line argument -# nacos.member.list=192.168.16.101:8847?raft_port=8807,192.168.16.101?raft_port=8808,192.168.16.101:8849?raft_port=8809 -## for AddressServerMemberLookup -# Maximum number of retries to query the address server upon initialization -# nacos.core.address-server.retry=5 -## Server domain name address of [address-server] mode -# address.server.domain=jmenv.tbsite.net -## Server port of [address-server] mode -# address.server.port=8080 -## Request address of [address-server] mode -# address.server.url=/nacos/serverlist - -#*************** JRaft Related Configurations ***************# - -### Sets the Raft cluster election timeout, default value is 5 second -# nacos.core.protocol.raft.data.election_timeout_ms=5000 -### Sets the amount of time the Raft snapshot will execute periodically, default is 30 minute -# nacos.core.protocol.raft.data.snapshot_interval_secs=30 -### raft internal worker threads -# nacos.core.protocol.raft.data.core_thread_num=8 -### Number of threads required for raft business request processing -# nacos.core.protocol.raft.data.cli_service_thread_num=4 -### raft linear read strategy. Safe linear reads are used by default, that is, the Leader tenure is confirmed by heartbeat -# nacos.core.protocol.raft.data.read_index_type=ReadOnlySafe -### rpc request timeout, default 5 seconds -# nacos.core.protocol.raft.data.rpc_request_timeout_ms=5000 -### enable to support prometheus service discovery -#nacos.prometheus.metrics.enabled=true diff --git a/ruoyi-visual/ruoyi-nacos/src/main/resources/banner.txt b/ruoyi-visual/ruoyi-nacos/src/main/resources/banner.txt deleted file mode 100644 index e197a61db..000000000 --- a/ruoyi-visual/ruoyi-nacos/src/main/resources/banner.txt +++ /dev/null @@ -1,15 +0,0 @@ - - ,--. - ,--.'| - ,--,: : | Nacos ${application.version} -,`--.'`| ' : ,---. Running in ${nacos.mode} mode, ${nacos.function.mode} function modules -| : : | | ' ,'\ .--.--. Port: ${server.port} -: | \ | : ,--.--. ,---. / / | / / ' Pid: ${pid} -| : ' '; | / \ / \. ; ,. :| : /`./ Console: http://${nacos.local.ip}:${server.port}${server.servlet.contextPath}/index.html -' ' ;. ;.--. .-. | / / '' | |: :| : ;_ -| | | \ | \__\/: . .. ' / ' | .; : \ \ `. https://nacos.io -' : | ; .' ," .--.; |' ; :__| : | `----. \ -| | '`--' / / ,. |' | '.'|\ \ / / /`--' / -' : | ; : .' \ : : `----' '--'. / -; |.' | , .-./\ \ / `--'---' -'---' `--`---' `----' diff --git a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/default-auth-plugin-2.5.1.jar b/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/default-auth-plugin-2.5.1.jar deleted file mode 100644 index 0100a6d02..000000000 Binary files a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/default-auth-plugin-2.5.1.jar and /dev/null differ diff --git a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/default-control-plugin-2.5.1.jar b/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/default-control-plugin-2.5.1.jar deleted file mode 100644 index 5129910c1..000000000 Binary files a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/default-control-plugin-2.5.1.jar and /dev/null differ diff --git a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-auth-2.5.1.jar b/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-auth-2.5.1.jar deleted file mode 100644 index 3d54380e9..000000000 Binary files a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-auth-2.5.1.jar and /dev/null differ diff --git a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-cmdb-2.5.1.jar b/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-cmdb-2.5.1.jar deleted file mode 100644 index da0205e9d..000000000 Binary files a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-cmdb-2.5.1.jar and /dev/null differ diff --git a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-config-2.5.1.jar b/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-config-2.5.1.jar deleted file mode 100644 index 2d5ba317b..000000000 Binary files a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-config-2.5.1.jar and /dev/null differ diff --git a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-config-plugin-2.5.1.jar b/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-config-plugin-2.5.1.jar deleted file mode 100644 index 8424dfcb4..000000000 Binary files a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-config-plugin-2.5.1.jar and /dev/null differ diff --git a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-consistency-2.5.1.jar b/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-consistency-2.5.1.jar deleted file mode 100644 index 15187f998..000000000 Binary files a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-consistency-2.5.1.jar and /dev/null differ diff --git a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-console-2.5.1.jar b/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-console-2.5.1.jar deleted file mode 100644 index 22dec8696..000000000 Binary files a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-console-2.5.1.jar and /dev/null differ diff --git a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-control-plugin-2.5.1.jar b/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-control-plugin-2.5.1.jar deleted file mode 100644 index 6e96af21f..000000000 Binary files a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-control-plugin-2.5.1.jar and /dev/null differ diff --git a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-core-2.5.1.jar b/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-core-2.5.1.jar deleted file mode 100644 index 663c51878..000000000 Binary files a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-core-2.5.1.jar and /dev/null differ diff --git a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-default-plugin-all-2.5.1.jar b/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-default-plugin-all-2.5.1.jar deleted file mode 100644 index dde502274..000000000 Binary files a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-default-plugin-all-2.5.1.jar and /dev/null differ diff --git a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-istio-2.5.1.jar b/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-istio-2.5.1.jar deleted file mode 100644 index 0445a067b..000000000 Binary files a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-istio-2.5.1.jar and /dev/null differ diff --git a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-naming-2.5.1.jar b/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-naming-2.5.1.jar deleted file mode 100644 index dc15dc51a..000000000 Binary files a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-naming-2.5.1.jar and /dev/null differ diff --git a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-persistence-2.5.1.jar b/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-persistence-2.5.1.jar deleted file mode 100644 index d8981429d..000000000 Binary files a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-persistence-2.5.1.jar and /dev/null differ diff --git a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-prometheus-2.5.1.jar b/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-prometheus-2.5.1.jar deleted file mode 100644 index b096db5ac..000000000 Binary files a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-prometheus-2.5.1.jar and /dev/null differ diff --git a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-sys-2.5.1.jar b/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-sys-2.5.1.jar deleted file mode 100644 index c258929d6..000000000 Binary files a/ruoyi-visual/ruoyi-nacos/src/main/resources/lib/nacos-sys-2.5.1.jar and /dev/null differ diff --git a/ruoyi-visual/ruoyi-seata-server/Dockerfile b/ruoyi-visual/ruoyi-seata-server/Dockerfile deleted file mode 100644 index d8082203b..000000000 --- a/ruoyi-visual/ruoyi-seata-server/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -# 贝尔实验室 Spring 官方推荐镜像 JDK下载地址 https://bell-sw.com/pages/downloads/ -FROM bellsoft/liberica-openjdk-rocky:17.0.16-cds -#FROM bellsoft/liberica-openjdk-rocky:21.0.8-cds -#FROM findepi/graalvm:java17-native - -LABEL maintainer="Lion Li" - -RUN mkdir -p /ruoyi/seata-server/logs \ - /ruoyi/skywalking/agent - -WORKDIR /ruoyi/seata-server - -ENV TZ=PRC LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS="" SEATA_IP="" SEATA_PORT="" -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -EXPOSE 7091 -EXPOSE 8091 - -ADD ./target/ruoyi-seata-server.jar ./app.jar - -SHELL ["/bin/bash", "-c"] - -ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \ - #-Dskywalking.agent.service_name=ruoyi-seata-server \ - #-Dskywalking.plugin.seata.server=true \ - #-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar \ - ${JAVA_OPTS} -jar app.jar diff --git a/ruoyi-visual/ruoyi-seata-server/pom.xml b/ruoyi-visual/ruoyi-seata-server/pom.xml deleted file mode 100644 index 90fa04efc..000000000 --- a/ruoyi-visual/ruoyi-seata-server/pom.xml +++ /dev/null @@ -1,297 +0,0 @@ - - - - - org.dromara - ruoyi-visual - ${revision} - - 4.0.0 - ruoyi-seata-server - jar - - - 2.5.0 - 2.7.18 - 5.3.39 - 2.0 - 7.2 - 3.8.0 - 1.9.13 - 3.6.1 - - - - - - - org.springframework - spring-framework-bom - ${spring-framework-for-server.version} - pom - import - - - - - org.springframework.boot - spring-boot-dependencies - ${spring-boot-for-server.version} - - - org.apache.kafka - kafka-clients - - - org.apache.tomcat.embed - tomcat-embed-core - - - org.apache.tomcat.embed - tomcat-embed-websocket - - - org.apache.tomcat.embed - tomcat-embed-el - - - org.springframework - spring-framework-bom - - - pom - import - - - org.yaml - snakeyaml - ${snakeyaml-for-server.version} - - - org.apache.seata - seata-dependencies - ${seata.version} - pom - import - - - - - - - - org.springframework.boot - spring-boot-starter - - - org.springframework - spring-web - - - org.yaml - snakeyaml - - - javax.servlet - javax.servlet-api - - - org.apache.seata - seata-server - ${seata.version} - system - ${project.basedir}/src/main/resources/lib/seata-server-${seata.version}.jar - - - - org.apache.seata - seata-spring-autoconfigure-server - ${seata.version} - - - - org.apache.seata - seata-core - ${seata.version} - - - org.apache.seata - seata-config-all - ${seata.version} - - - log4j - log4j - - - - - org.apache.seata - seata-discovery-all - ${seata.version} - - - org.apache.seata - seata-serializer-all - ${seata.version} - - - org.apache.seata - seata-compressor-all - ${seata.version} - - - - org.apache.seata - seata-metrics-all - ${seata.version} - - - - - - - - - - - com.alibaba - druid - - - org.apache.commons - commons-dbcp2 - - - com.zaxxer - HikariCP - - - mysql - mysql-connector-java - 8.0.27 - - - org.postgresql - postgresql - - - com.dameng - DmJdbcDriver18 - - - com.beust - jcommander - - - - - com.google.guava - guava - - - - - redis.clients - jedis - ${jedis.version} - - - - com.alibaba - fastjson - - - - - ch.qos.logback - logback-classic - - - ch.qos.logback - logback-core - - - - net.logstash.logback - logstash-logback-encoder - ${logstash-logback-encoder.version} - - - com.github.danielwegener - logback-kafka-appender - - - org.apache.kafka - kafka-clients - - - - - org.apache.kafka - kafka-clients - ${kafka-clients.version} - - - com.alipay.sofa - jraft-core - - - com.alipay.sofa - bolt - - - - - com.alipay.sofa - bolt - - - org.codehaus.janino - janino - - - com.bucket4j - bucket4j_jdk8-core - - - - - ${project.artifactId} - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot.version} - - - - repackage - - - - - - true - - - - - - diff --git a/ruoyi-visual/ruoyi-seata-server/src/main/java/org/apache/seata/core/store/db/AbstractDataSourceProvider.java b/ruoyi-visual/ruoyi-seata-server/src/main/java/org/apache/seata/core/store/db/AbstractDataSourceProvider.java deleted file mode 100644 index 10e324874..000000000 --- a/ruoyi-visual/ruoyi-seata-server/src/main/java/org/apache/seata/core/store/db/AbstractDataSourceProvider.java +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.seata.core.store.db; - -import org.apache.seata.common.exception.ShouldNeverHappenException; -import org.apache.seata.common.exception.StoreException; -import org.apache.seata.common.executor.Initialize; -import org.apache.seata.common.util.ConfigTools; -import org.apache.seata.common.util.StringUtils; -import org.apache.seata.config.Configuration; -import org.apache.seata.config.ConfigurationFactory; -import org.apache.seata.common.ConfigurationKeys; -import org.apache.seata.core.constants.DBType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.sql.DataSource; -import java.io.File; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLClassLoader; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Stream; - -import static org.apache.seata.common.DefaultValues.DEFAULT_DB_MAX_CONN; -import static org.apache.seata.common.DefaultValues.DEFAULT_DB_MIN_CONN; - -/** - * The abstract datasource provider - * - */ -public abstract class AbstractDataSourceProvider implements DataSourceProvider, Initialize { - - private static final Logger LOGGER = LoggerFactory.getLogger(AbstractDataSourceProvider.class); - - private DataSource dataSource; - - /** - * The constant CONFIG. - */ - protected static final Configuration CONFIG = ConfigurationFactory.getInstance(); - - private static final String MYSQL_DRIVER_CLASS_NAME = "com.mysql.jdbc.Driver"; - - private static final String MYSQL8_DRIVER_CLASS_NAME = "com.mysql.cj.jdbc.Driver"; - - private static final String MYSQL_DRIVER_FILE_PREFIX = "mysql-connector-j"; - - private static final Map DRIVER_LOADERS; - - private static final long DEFAULT_DB_MAX_WAIT = 5000; - - static { - DRIVER_LOADERS = createMysqlDriverClassLoaders(); - } - - @Override - public void init() { - this.dataSource = generate(); - } - - @Override - public DataSource provide() { - return this.dataSource; - } - - public DataSource generate() { - validate(); - return doGenerate(); - } - - public void validate() { - // valid driver class name - String driverClassName = getDriverClassName(); -// ClassLoader loader = getDriverClassLoader(); -// if (null == loader) { -// throw new StoreException("class loader set error, you should not use the Bootstrap classloader"); -// } - try { -// loader.loadClass(driverClassName); - Class.forName(driverClassName); - } catch (ClassNotFoundException exx) { - String folderPath = System.getProperty("loader.path"); - if (folderPath == null) { - folderPath = System.getProperty("java.class.path"); - } - String driverClassPath = Stream.of(folderPath.split(File.pathSeparator)) - .map(File::new) - .filter(File::exists) - .map(file -> file.isFile() ? file.getParentFile() : file) - .filter(Objects::nonNull) - .filter(File::isDirectory) - // Only the MySQL driver needs to be placed in the jdbc folder. - .map(file -> (MYSQL8_DRIVER_CLASS_NAME.equals(driverClassName) - || MYSQL_DRIVER_CLASS_NAME.equals(driverClassName)) - ? new File(file, "jdbc") - : file) - .filter(File::exists) - .filter(File::isDirectory) - .distinct() - .findAny() - .map(File::getAbsolutePath) - .orElseThrow(() -> new ShouldNeverHappenException("cannot find jdbc folder")); - throw new StoreException(String.format( - "The driver {%s} cannot be found in the path %s. Please ensure that the appropriate database driver dependencies are included in the classpath.", - driverClassName, driverClassPath)); - } - } - /** - * generate the datasource - * @return datasource - */ - public abstract DataSource doGenerate(); - - /** - * Get db type db type. - * - * @return the db type - */ - protected DBType getDBType() { - return DBType.valueof(CONFIG.getConfig(ConfigurationKeys.STORE_DB_TYPE)); - } - - /** - * get db driver class name - * - * @return the db driver class name - */ - protected String getDriverClassName() { - String driverClassName = CONFIG.getConfig(ConfigurationKeys.STORE_DB_DRIVER_CLASS_NAME); - if (StringUtils.isBlank(driverClassName)) { - throw new StoreException( - String.format("the {%s} can't be empty", ConfigurationKeys.STORE_DB_DRIVER_CLASS_NAME)); - } - return driverClassName; - } - - /** - * get db max wait - * - * @return the db max wait - */ - protected Long getMaxWait() { - return CONFIG.getLong(ConfigurationKeys.STORE_DB_MAX_WAIT, DEFAULT_DB_MAX_WAIT); - } - - protected ClassLoader getDriverClassLoader() { - return DRIVER_LOADERS.getOrDefault(getDriverClassName(), this.getClass().getClassLoader()); - } - - private static Map createMysqlDriverClassLoaders() { - Map loaders = new HashMap<>(); - String cp = System.getProperty("loader.path"); - if (cp == null) { - cp = System.getProperty("java.class.path"); - } - if (cp == null || cp.isEmpty()) { - return loaders; - } - Stream.of(cp.split(File.pathSeparator)) - .map(File::new) - .filter(File::exists) - .map(file -> file.isFile() ? file.getParentFile() : file) - .filter(Objects::nonNull) - .filter(File::isDirectory) - .map(file -> new File(file, "jdbc")) - .filter(File::exists) - .filter(File::isDirectory) - .distinct() - .flatMap(file -> { - File[] files = file.listFiles((f, name) -> name.startsWith(MYSQL_DRIVER_FILE_PREFIX)); - if (files != null) { - return Stream.of(files); - } else { - return Stream.of(); - } - }) - .forEach(file -> { - if (loaders.containsKey(MYSQL8_DRIVER_CLASS_NAME) && loaders.containsKey(MYSQL_DRIVER_CLASS_NAME)) { - return; - } - try { - URL url = file.toURI().toURL(); - ClassLoader loader = new URLClassLoader(new URL[] {url}, ClassLoader.getSystemClassLoader()); - try { - loader.loadClass(MYSQL8_DRIVER_CLASS_NAME); - loaders.putIfAbsent(MYSQL8_DRIVER_CLASS_NAME, loader); - } catch (ClassNotFoundException e) { - loaders.putIfAbsent(MYSQL_DRIVER_CLASS_NAME, loader); - } - } catch (MalformedURLException ignore) { - } - }); - return loaders; - } - - /** - * Get url string. - * - * @return the string - */ - protected String getUrl() { - String url = CONFIG.getConfig(ConfigurationKeys.STORE_DB_URL); - if (StringUtils.isBlank(url)) { - throw new StoreException(String.format("the {%s} can't be empty", ConfigurationKeys.STORE_DB_URL)); - } - return url; - } - - /** - * Get user string. - * - * @return the string - */ - protected String getUser() { - String user = CONFIG.getConfig(ConfigurationKeys.STORE_DB_USER); - if (StringUtils.isBlank(user)) { - throw new StoreException(String.format("the {%s} can't be empty", ConfigurationKeys.STORE_DB_USER)); - } - return user; - } - - /** - * Get password string. - * - * @return the string - */ - protected String getPassword() { - String password = CONFIG.getConfig(ConfigurationKeys.STORE_DB_PASSWORD); - String publicKey = getPublicKey(); - if (StringUtils.isNotBlank(publicKey)) { - try { - password = ConfigTools.publicDecrypt(password, publicKey); - } catch (Exception e) { - LOGGER.error( - "decryption failed,please confirm whether the ciphertext and secret key are correct! error msg: {}", - e.getMessage()); - } - } - return password; - } - - /** - * Get min conn int. - * - * @return the int - */ - protected int getMinConn() { - int minConn = CONFIG.getInt(ConfigurationKeys.STORE_DB_MIN_CONN, DEFAULT_DB_MIN_CONN); - return minConn < 0 ? DEFAULT_DB_MIN_CONN : minConn; - } - - /** - * Get max conn int. - * - * @return the int - */ - protected int getMaxConn() { - int maxConn = CONFIG.getInt(ConfigurationKeys.STORE_DB_MAX_CONN, DEFAULT_DB_MAX_CONN); - return maxConn < 0 ? DEFAULT_DB_MAX_CONN : maxConn; - } - - /** - * Get validation query string. - * - * @param dbType the db type - * @return the string - */ - protected String getValidationQuery(DBType dbType) { - if (DBType.ORACLE.equals(dbType)) { - return "select sysdate from dual"; - } else { - return "select 1"; - } - } - - /** - * Get public key. - * - * @return the string - */ - protected String getPublicKey() { - return CONFIG.getConfig(ConfigurationKeys.STORE_PUBLIC_KEY); - } -} diff --git a/ruoyi-visual/ruoyi-seata-server/src/main/java/org/apache/seata/server/SeataServerApplication.java b/ruoyi-visual/ruoyi-seata-server/src/main/java/org/apache/seata/server/SeataServerApplication.java deleted file mode 100644 index cd45fba17..000000000 --- a/ruoyi-visual/ruoyi-seata-server/src/main/java/org/apache/seata/server/SeataServerApplication.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.seata.server; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -import java.io.IOException; - -/** - */ -@SpringBootApplication(scanBasePackages = {"org.apache.seata"}) -public class SeataServerApplication { - public static void main(String[] args) throws IOException { - // run the spring-boot application - SpringApplication.run(ServerApplication.class, args); - } -} diff --git a/ruoyi-visual/ruoyi-seata-server/src/main/resources/application.yml b/ruoyi-visual/ruoyi-seata-server/src/main/resources/application.yml deleted file mode 100644 index f20f8368f..000000000 --- a/ruoyi-visual/ruoyi-seata-server/src/main/resources/application.yml +++ /dev/null @@ -1,51 +0,0 @@ -server: - port: 8091 - -spring: - application: - name: ruoyi-seata-server - main: - web-application-type: none - profiles: - # 环境配置 - active: @profiles.active@ - -logging: - config: classpath:logback-spring.xml - file: - path: ./logs/seata -# extend: -# logstash-appender: -# destination: 127.0.0.1:4560 -# kafka-appender: -# bootstrap-servers: 127.0.0.1:9092 -# topic: logback_to_logstash - -seata: - config: - # support: nacos 、 consul 、 apollo 、 zk 、 etcd3 - type: nacos - nacos: - server-addr: @nacos.server@ - group: @nacos.discovery.group@ - namespace: ${spring.profiles.active} - username: @nacos.username@ - password: @nacos.password@ - ##if use MSE Nacos with auth, mutex with username/password attribute - #access-key: "" - #secret-key: "" - data-id: seata-server.properties - registry: - # support: nacos 、 eureka 、 redis 、 zk 、 consul 、 etcd3 、 sofa - type: nacos - nacos: - application: ${spring.application.name} - server-addr: @nacos.server@ - group: @nacos.discovery.group@ - namespace: ${spring.profiles.active} - cluster: default - username: @nacos.username@ - password: @nacos.password@ - ##if use MSE Nacos with auth, mutex with username/password attribute - #access-key: "" - #secret-key: "" diff --git a/ruoyi-visual/ruoyi-seata-server/src/main/resources/banner.txt b/ruoyi-visual/ruoyi-seata-server/src/main/resources/banner.txt deleted file mode 100644 index 0064688df..000000000 --- a/ruoyi-visual/ruoyi-seata-server/src/main/resources/banner.txt +++ /dev/null @@ -1,8 +0,0 @@ -Spring Boot Version: ${spring-boot.version} -Spring Application Name: ${spring.application.name} - _ - | | - ___ ___ __ _| |_ __ _ ______ ___ ___ _ ____ _____ _ __ -/ __|/ _ \/ _` | __/ _` |______/ __|/ _ \ '__\ \ / / _ \ '__| -\__ \ __/ (_| | || (_| | \__ \ __/ | \ V / __/ | -|___/\___|\__,_|\__\__,_| |___/\___|_| \_/ \___|_| diff --git a/ruoyi-visual/ruoyi-seata-server/src/main/resources/lib/seata-server-2.5.0.jar b/ruoyi-visual/ruoyi-seata-server/src/main/resources/lib/seata-server-2.5.0.jar deleted file mode 100644 index 988822d82..000000000 Binary files a/ruoyi-visual/ruoyi-seata-server/src/main/resources/lib/seata-server-2.5.0.jar and /dev/null differ diff --git a/ruoyi-visual/ruoyi-seata-server/src/main/resources/logback-common.xml b/ruoyi-visual/ruoyi-seata-server/src/main/resources/logback-common.xml deleted file mode 100644 index 89eaa97ec..000000000 --- a/ruoyi-visual/ruoyi-seata-server/src/main/resources/logback-common.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - ${log.path}/console.log - - - ${log.path}/console.%d{yyyy-MM-dd}.log - - 1 - - - ${log.pattern} - utf-8 - - - - INFO - - - - - - ${log.path}/info.log - - - - ${log.path}/info.%d{yyyy-MM-dd}.log - - 60 - - - ${log.pattern} - - - - INFO - - ACCEPT - - DENY - - - - - ${log.path}/error.log - - - - ${log.path}/error.%d{yyyy-MM-dd}.log - - 60 - - - ${log.pattern} - - - - ERROR - - ACCEPT - - DENY - - - - - - - 0 - - 512 - - - - - - - - 0 - - 512 - - - - - - - - - - - diff --git a/ruoyi-visual/ruoyi-seata-server/src/main/resources/logback-spring.xml b/ruoyi-visual/ruoyi-seata-server/src/main/resources/logback-spring.xml deleted file mode 100644 index 06c7b1488..000000000 --- a/ruoyi-visual/ruoyi-seata-server/src/main/resources/logback-spring.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - ${console.log.pattern} - utf-8 - - - - - - - - - - - - - - diff --git a/ruoyi-visual/ruoyi-snailjob-server/src/main/resources/application.yml b/ruoyi-visual/ruoyi-snailjob-server/src/main/resources/application.yml index 4ce70334f..4dd63b873 100644 --- a/ruoyi-visual/ruoyi-snailjob-server/src/main/resources/application.yml +++ b/ruoyi-visual/ruoyi-snailjob-server/src/main/resources/application.yml @@ -48,12 +48,12 @@ spring: password: @nacos.password@ discovery: # 注册组 - group: @nacos.discovery.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: # 配置组 - group: @nacos.config.group@ - namespace: ${spring.profiles.active} + group: DEFAULT_GROUP + namespace: public config: import: - optional:nacos:datasource.yml diff --git a/script/config/nacos/application-common.yml b/script/config/nacos/application-common.yml index b13691ffc..3e5b3939b 100644 --- a/script/config/nacos/application-common.yml +++ b/script/config/nacos/application-common.yml @@ -242,7 +242,7 @@ seata: nacos: server-addr: ${spring.cloud.nacos.server-addr} group: ${spring.cloud.nacos.config.group} - namespace: ${spring.profiles.active} + namespace: public username: ${spring.cloud.nacos.username} password: ${spring.cloud.nacos.password} data-id: seata-server.properties @@ -254,6 +254,6 @@ seata: group: ${spring.cloud.nacos.discovery.group} username: ${spring.cloud.nacos.username} password: ${spring.cloud.nacos.password} - namespace: ${spring.profiles.active} + namespace: public # 关闭自动代理 enable-auto-data-source-proxy: false diff --git a/script/config/nacos/ruoyi-job.yml b/script/config/nacos/ruoyi-job.yml index e9ed16bab..44afb3ede 100644 --- a/script/config/nacos/ruoyi-job.yml +++ b/script/config/nacos/ruoyi-job.yml @@ -26,7 +26,7 @@ snail-job: host: 127.0.0.1 port: 17888 # 详见 sql/ry_job.sql `sj_namespace` 表 `unique_id` - namespace: ${spring.profiles.active} + namespace: public # 随主应用端口飘逸 port: 2${server.port} # 客户端ip指定 diff --git a/script/sql/ry-config.sql b/script/sql/ry-config.sql deleted file mode 100644 index a217a8086..000000000 --- a/script/sql/ry-config.sql +++ /dev/null @@ -1,198 +0,0 @@ - -/******************************************/ -/* 表名称 = config_info */ -/******************************************/ -CREATE TABLE `config_info` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id', - `data_id` varchar(255) NOT NULL COMMENT 'data_id', - `group_id` varchar(128) DEFAULT NULL COMMENT 'group_id', - `content` longtext NOT NULL COMMENT 'content', - `md5` varchar(32) DEFAULT NULL COMMENT 'md5', - `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', - `src_user` text COMMENT 'source user', - `src_ip` varchar(50) DEFAULT NULL COMMENT 'source ip', - `app_name` varchar(128) DEFAULT NULL COMMENT 'app_name', - `tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段', - `c_desc` varchar(256) DEFAULT NULL COMMENT 'configuration description', - `c_use` varchar(64) DEFAULT NULL COMMENT 'configuration usage', - `effect` varchar(64) DEFAULT NULL COMMENT '配置生效的描述', - `type` varchar(64) DEFAULT NULL COMMENT '配置的类型', - `c_schema` text COMMENT '配置的模式', - `encrypted_data_key` text NOT NULL COMMENT '密钥', - PRIMARY KEY (`id`), - UNIQUE KEY `uk_configinfo_datagrouptenant` (`data_id`,`group_id`,`tenant_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info'; - -insert into config_info(id, data_id, group_id, content, md5, gmt_create, gmt_modified, src_user, src_ip, app_name, tenant_id, c_desc, c_use, effect, type, c_schema, encrypted_data_key) values -(1, 'application-common.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:18:55', '2022-01-09 15:18:55', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '通用配置基础配置', NULL, NULL, 'yaml', NULL, ''), -(2, 'datasource.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:19:07', '2022-01-09 15:19:07', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '数据源配置', NULL, NULL, 'yaml', NULL, ''), -(3, 'ruoyi-gateway.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:19:43', '2022-01-09 15:22:42', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '网关模块', NULL, NULL, 'yaml', NULL, ''), -(4, 'ruoyi-auth.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:19:43', '2022-01-09 15:22:29', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '认证中心', NULL, NULL, 'yaml', NULL, ''), -(5, 'ruoyi-monitor.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:20:18', '2022-01-09 15:22:15', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '监控中心', NULL, NULL, 'yaml', NULL, ''), -(6, 'ruoyi-system.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:20:18', '2022-01-09 15:22:03', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '系统模块', NULL, NULL, 'yaml', NULL, ''), -(7, 'ruoyi-gen.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:20:18', '2022-01-09 15:21:51', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '代码生成', NULL, NULL, 'yaml', NULL, ''), -(8, 'ruoyi-job.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:20:18', '2022-01-09 15:21:36', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '定时任务', NULL, NULL, 'yaml', NULL, ''), -(9, 'ruoyi-resource.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:20:35', '2022-01-09 15:21:21', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '文件服务', NULL, NULL, 'yaml', NULL, ''), -(10, 'ruoyi-workflow.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:20:35', '2022-01-09 15:21:21', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '工作流服务', NULL, NULL, 'yaml', NULL, ''), -(12, 'seata-server.properties', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:21:02', '2022-01-09 15:21:02', NULL, '0:0:0:0:0:0:0:1', '', 'dev', 'seata配置文件', NULL, NULL, 'properties', NULL, ''), -(14, 'ruoyi-snailjob-server.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:21:02', '2022-01-09 15:21:02', NULL, '0:0:0:0:0:0:0:1', '', 'dev', 'SJ定时任务控制台', NULL, NULL, 'yaml', NULL, ''), - -(101, 'application-common.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '通用配置基础配置', NULL, NULL, 'yaml', NULL, ''), -(102, 'datasource.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '数据源配置', NULL, NULL, 'yaml', NULL, ''), -(103, 'ruoyi-gateway.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '网关模块', NULL, NULL, 'yaml', NULL, ''), -(104, 'ruoyi-auth.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '认证中心', NULL, NULL, 'yaml', NULL, ''), -(105, 'ruoyi-monitor.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '监控中心', NULL, NULL, 'yaml', NULL, ''), -(106, 'ruoyi-system.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '系统模块', NULL, NULL, 'yaml', NULL, ''), -(107, 'ruoyi-gen.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '代码生成', NULL, NULL, 'yaml', NULL, ''), -(108, 'ruoyi-job.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '定时任务', NULL, NULL, 'yaml', NULL, ''), -(109, 'ruoyi-resource.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '文件服务', NULL, NULL, 'yaml', NULL, ''), -(110, 'ruoyi-workflow.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '工作流服务', NULL, NULL, 'yaml', NULL, ''), -(112, 'seata-server.properties', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:21:02', '2022-01-09 15:21:02', NULL, '0:0:0:0:0:0:0:1', '', 'prod', 'seata配置文件', NULL, NULL, 'properties', NULL, ''), -(114, 'ruoyi-snailjob-server.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:21:02', '2022-01-09 15:21:02', NULL, '0:0:0:0:0:0:0:1', '', 'prod', 'SJ定时任务控制台', NULL, NULL, 'yaml', NULL, ''); - -/******************************************/ -/* 表名称 = config_info since 2.5.0 */ -/******************************************/ -CREATE TABLE `config_info_gray` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', - `data_id` varchar(255) NOT NULL COMMENT 'data_id', - `group_id` varchar(128) NOT NULL COMMENT 'group_id', - `content` longtext NOT NULL COMMENT 'content', - `md5` varchar(32) DEFAULT NULL COMMENT 'md5', - `src_user` text COMMENT 'src_user', - `src_ip` varchar(100) DEFAULT NULL COMMENT 'src_ip', - `gmt_create` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT 'gmt_create', - `gmt_modified` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT 'gmt_modified', - `app_name` varchar(128) DEFAULT NULL COMMENT 'app_name', - `tenant_id` varchar(128) DEFAULT '' COMMENT 'tenant_id', - `gray_name` varchar(128) NOT NULL COMMENT 'gray_name', - `gray_rule` text NOT NULL COMMENT 'gray_rule', - `encrypted_data_key` varchar(256) NOT NULL DEFAULT '' COMMENT 'encrypted_data_key', - PRIMARY KEY (`id`), - UNIQUE KEY `uk_configinfogray_datagrouptenantgray` (`data_id`,`group_id`,`tenant_id`,`gray_name`), - KEY `idx_dataid_gmt_modified` (`data_id`,`gmt_modified`), - KEY `idx_gmt_modified` (`gmt_modified`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='config_info_gray'; - -/******************************************/ -/* 表名称 = config_tags_relation */ -/******************************************/ -CREATE TABLE `config_tags_relation` ( - `id` bigint(20) NOT NULL COMMENT 'id', - `tag_name` varchar(128) NOT NULL COMMENT 'tag_name', - `tag_type` varchar(64) DEFAULT NULL COMMENT 'tag_type', - `data_id` varchar(255) NOT NULL COMMENT 'data_id', - `group_id` varchar(128) NOT NULL COMMENT 'group_id', - `tenant_id` varchar(128) DEFAULT '' COMMENT 'tenant_id', - `nid` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'nid, 自增长标识', - PRIMARY KEY (`nid`), - UNIQUE KEY `uk_configtagrelation_configidtag` (`id`,`tag_name`,`tag_type`), - KEY `idx_tenant_id` (`tenant_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_tag_relation'; - -/******************************************/ -/* 表名称 = group_capacity */ -/******************************************/ -CREATE TABLE `group_capacity` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', - `group_id` varchar(128) NOT NULL DEFAULT '' COMMENT 'Group ID,空字符表示整个集群', - `quota` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '配额,0表示使用默认值', - `usage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用量', - `max_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限,单位为字节,0表示使用默认值', - `max_aggr_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数,,0表示使用默认值', - `max_aggr_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值', - `max_history_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量', - `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', - PRIMARY KEY (`id`), - UNIQUE KEY `uk_group_id` (`group_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='集群、各Group容量信息表'; - -/******************************************/ -/* 表名称 = his_config_info */ -/******************************************/ -CREATE TABLE `his_config_info` ( - `id` bigint(20) unsigned NOT NULL COMMENT 'id', - `nid` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'nid, 自增标识', - `data_id` varchar(255) NOT NULL COMMENT 'data_id', - `group_id` varchar(128) NOT NULL COMMENT 'group_id', - `app_name` varchar(128) DEFAULT NULL COMMENT 'app_name', - `content` longtext NOT NULL COMMENT 'content', - `md5` varchar(32) DEFAULT NULL COMMENT 'md5', - `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', - `src_user` text COMMENT 'source user', - `src_ip` varchar(50) DEFAULT NULL COMMENT 'source ip', - `op_type` char(10) DEFAULT NULL COMMENT 'operation type', - `tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段', - `encrypted_data_key` varchar(1024) NOT NULL DEFAULT '' COMMENT '密钥', - `publish_type` varchar(50) DEFAULT 'formal' COMMENT 'publish type gray or formal', - `gray_name` varchar(50) DEFAULT NULL COMMENT 'gray name', - `ext_info` longtext DEFAULT NULL COMMENT 'ext info', - PRIMARY KEY (`nid`), - KEY `idx_gmt_create` (`gmt_create`), - KEY `idx_gmt_modified` (`gmt_modified`), - KEY `idx_did` (`data_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='多租户改造'; - - -/******************************************/ -/* 表名称 = tenant_capacity */ -/******************************************/ -CREATE TABLE `tenant_capacity` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', - `tenant_id` varchar(128) NOT NULL DEFAULT '' COMMENT 'Tenant ID', - `quota` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '配额,0表示使用默认值', - `usage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用量', - `max_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限,单位为字节,0表示使用默认值', - `max_aggr_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数', - `max_aggr_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值', - `max_history_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量', - `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', - PRIMARY KEY (`id`), - UNIQUE KEY `uk_tenant_id` (`tenant_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='租户容量信息表'; - - -CREATE TABLE `tenant_info` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id', - `kp` varchar(128) NOT NULL COMMENT 'kp', - `tenant_id` varchar(128) default '' COMMENT 'tenant_id', - `tenant_name` varchar(128) default '' COMMENT 'tenant_name', - `tenant_desc` varchar(256) DEFAULT NULL COMMENT 'tenant_desc', - `create_source` varchar(32) DEFAULT NULL COMMENT 'create_source', - `gmt_create` bigint(20) NOT NULL COMMENT '创建时间', - `gmt_modified` bigint(20) NOT NULL COMMENT '修改时间', - PRIMARY KEY (`id`), - UNIQUE KEY `uk_tenant_info_kptenantid` (`kp`,`tenant_id`), - KEY `idx_tenant_id` (`tenant_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='tenant_info'; - -insert into tenant_info(id, kp, tenant_id, tenant_name, tenant_desc, create_source, gmt_create, gmt_modified) values -(1, '1', 'dev', 'dev', '开发环境', NULL, 1641741261189, 1641741261189), -(2, '1', 'prod', 'prod', '生产环境', NULL, 1641741270448, 1641741287236); - -CREATE TABLE `users` ( - `username` varchar(50) NOT NULL PRIMARY KEY COMMENT 'username', - `password` varchar(500) NOT NULL COMMENT 'password', - `enabled` boolean NOT NULL COMMENT 'enabled' -); - -CREATE TABLE `roles` ( - `username` varchar(50) NOT NULL COMMENT 'username', - `role` varchar(50) NOT NULL COMMENT 'role', - UNIQUE INDEX `idx_user_role` (`username` ASC, `role` ASC) USING BTREE -); - -CREATE TABLE `permissions` ( - `role` varchar(50) NOT NULL COMMENT 'role', - `resource` varchar(128) NOT NULL COMMENT 'resource', - `action` varchar(8) NOT NULL COMMENT 'action', - UNIQUE INDEX `uk_role_permission` (`role`,`resource`,`action`) USING BTREE -); - -INSERT INTO users (username, password, enabled) VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', TRUE); - -INSERT INTO roles (username, role) VALUES ('nacos', 'ROLE_ADMIN');