From 398e9ee177ae52e29182e41a503872d052f19338 Mon Sep 17 00:00:00 2001 From: ddlin0719 Date: Thu, 22 Jul 2021 18:23:32 +0800 Subject: [PATCH 1/5] feat: CodeCC For 1.5 #4572 remove jasypt-spring-boot-starter --- src/backend/codecc/core/common/common-web/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/src/backend/codecc/core/common/common-web/build.gradle b/src/backend/codecc/core/common/common-web/build.gradle index b08eb0da622..19d4b3cc38b 100644 --- a/src/backend/codecc/core/common/common-web/build.gradle +++ b/src/backend/codecc/core/common/common-web/build.gradle @@ -4,7 +4,6 @@ dependencies { compile project(":core:common:common-auth-api") compile "org.springframework.boot:spring-boot-starter-amqp" compile "org.springframework.boot:spring-boot-starter-aop" - compile "com.github.ulisesbocchio:jasypt-spring-boot-starter" compile group: 'net.sf.json-lib', name: 'json-lib', classifier: "jdk15" compile "org.apache.xmlrpc:xmlrpc-client" } From 9a8df902e358f1d7f7256422e0b7fcf2d38f8b03 Mon Sep 17 00:00:00 2001 From: ddlin0719 Date: Thu, 22 Jul 2021 18:25:05 +0800 Subject: [PATCH 2/5] feat: CodeCC For 1.5 #4572 remove jasypt-spring-boot-starter --- src/backend/codecc/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/src/backend/codecc/build.gradle b/src/backend/codecc/build.gradle index d46b1bafe0b..1fd59a0275d 100644 --- a/src/backend/codecc/build.gradle +++ b/src/backend/codecc/build.gradle @@ -223,7 +223,6 @@ subprojects { dependency "commons-io:commons-io:$commonsIOVersion" dependency "org.apache.xmlrpc:xmlrpc-client:$xmlrpcVersion" dependency "commons-httpclient:commons-httpclient:$commonsHttpclientVersion" - dependency "com.github.ulisesbocchio:jasypt-spring-boot-starter:$jasyptVersion" dependencySet(group: "org.springframework.cloud", version: "$springConsulVersion") { entry "spring-cloud-starter-consul-discovery" entry "spring-cloud-starter-consul-core" From 189e42e842cda6303f6a0ee3ec63f417a06fe3a2 Mon Sep 17 00:00:00 2001 From: ddlin0719 Date: Thu, 22 Jul 2021 18:28:50 +0800 Subject: [PATCH 3/5] feat: CodeCC For 1.5 #4572 remove jasypt-spring-boot-starter --- .../common/web/jasypt/DefaultEncryptor.kt | 41 ------------------- 1 file changed, 41 deletions(-) delete mode 100644 src/backend/codecc/core/common/common-web/src/main/kotlin/com/tencent/devops/common/web/jasypt/DefaultEncryptor.kt diff --git a/src/backend/codecc/core/common/common-web/src/main/kotlin/com/tencent/devops/common/web/jasypt/DefaultEncryptor.kt b/src/backend/codecc/core/common/common-web/src/main/kotlin/com/tencent/devops/common/web/jasypt/DefaultEncryptor.kt deleted file mode 100644 index eacef30367c..00000000000 --- a/src/backend/codecc/core/common/common-web/src/main/kotlin/com/tencent/devops/common/web/jasypt/DefaultEncryptor.kt +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.common.web.jasypt - -import com.tencent.devops.common.util.AESUtil -import org.jasypt.encryption.StringEncryptor - -class DefaultEncryptor(private val key: String) : StringEncryptor { - - override fun decrypt(message: String): String { - return AESUtil.decrypt(key, message) - } - - override fun encrypt(message: String): String { - return AESUtil.encrypt(key, message) - } -} \ No newline at end of file From 52a37eff73e5952e06b4cd80f708314ecb07a717 Mon Sep 17 00:00:00 2001 From: ddlin0719 Date: Thu, 22 Jul 2021 19:23:19 +0800 Subject: [PATCH 4/5] feat: CodeCC For 1.5 #4572 rename codecc.frontend.conf --- ... gateway#core#vhosts#codecc.frontend.conf} | 2 +- .../#etc#codecc#application-defect.yml | 13 ---- .../templates/#etc#codecc#application-job.yml | 11 --- .../#etc#codecc#application-quartz.yml | 29 -------- .../#etc#codecc#application-task.yml | 23 ------- .../templates/#etc#codecc#common.yml | 67 ------------------- 6 files changed, 1 insertion(+), 144 deletions(-) rename support-files/codecc/templates/{codecc.frontend.conf => gateway#core#vhosts#codecc.frontend.conf} (95%) delete mode 100644 support-files/templates/#etc#codecc#application-defect.yml delete mode 100644 support-files/templates/#etc#codecc#application-job.yml delete mode 100644 support-files/templates/#etc#codecc#application-quartz.yml delete mode 100644 support-files/templates/#etc#codecc#application-task.yml delete mode 100644 support-files/templates/#etc#codecc#common.yml diff --git a/support-files/codecc/templates/codecc.frontend.conf b/support-files/codecc/templates/gateway#core#vhosts#codecc.frontend.conf similarity index 95% rename from support-files/codecc/templates/codecc.frontend.conf rename to support-files/codecc/templates/gateway#core#vhosts#codecc.frontend.conf index 3b73c2cd36c..c8ec69ab3eb 100644 --- a/support-files/codecc/templates/codecc.frontend.conf +++ b/support-files/codecc/templates/gateway#core#vhosts#codecc.frontend.conf @@ -23,7 +23,7 @@ } location ~* \.(js|css|ttf)$ { - header_filter_by_lua_file 'conf/lua/cors_filter.lua'; + header_filter_by_luca_file 'conf/lua/cors_filter.lua'; add_header Cache-Control max-age=2592000; try_files $uri @fallback; # 匹配所有以 js,css或tff 结尾的请求 diff --git a/support-files/templates/#etc#codecc#application-defect.yml b/support-files/templates/#etc#codecc#application-defect.yml deleted file mode 100644 index 60039133df0..00000000000 --- a/support-files/templates/#etc#codecc#application-defect.yml +++ /dev/null @@ -1,13 +0,0 @@ -# 服务配置文件模板 -spring: - application: - name: defect${service-suffix} - desc: Defect Service - data: - mongodb: - uri: mongodb://__MONGODB_USER__:__MONGODB_PASS__@__MONGODB_IP__:__MONGODB_PORT__/db_defect?replicaSet=rs0&slaveOk=true - -# 服务器端口配置,在同一台机器上部署多个微服务,端口号要不同 23910 -server: - port: __CODECC_DEFECT_PORT__ # 服务端口 - diff --git a/support-files/templates/#etc#codecc#application-job.yml b/support-files/templates/#etc#codecc#application-job.yml deleted file mode 100644 index 081d30c6049..00000000000 --- a/support-files/templates/#etc#codecc#application-job.yml +++ /dev/null @@ -1,11 +0,0 @@ -# 服务配置文件模板 -spring: - application: - name: job${service-suffix} - desc: Job Service - data: - mongodb: - uri: mongodb://__MONGODB_USER__:__MONGODB_PASS__@__MONGODB_IP__:__MONGODB_PORT__/db_defect?replicaSet=rs0&slaveOk=true - -server: - port: __CODECC_CODECCJOB_PORT__ \ No newline at end of file diff --git a/support-files/templates/#etc#codecc#application-quartz.yml b/support-files/templates/#etc#codecc#application-quartz.yml deleted file mode 100644 index eee41a5e654..00000000000 --- a/support-files/templates/#etc#codecc#application-quartz.yml +++ /dev/null @@ -1,29 +0,0 @@ -# 服务配置文件模板 -spring: - application: - name: quartz{service-suffix} - desc: Quartz Service - data: - mongodb: - uri: mongodb://__MONGODB_USER__:__MONGODB_PASS__@__MONGODB_IP__:__MONGODB_PORT__/db_task?replicaSet=rs0&slaveOk=true - -# 服务器端口配置,在同一台机器上部署多个微服务,端口号要不同 23910 -server: - port: __CODECC_TASK_PORT__ # 服务端口 - -time: - analysis: - maxhour: __CODECC_ANALYSIS_MAXHOUR__ - -devops: - imageName: __DEVOPS_DISPATCH_DOCER_DEFAULT_IMAGE_NAME__ - retry: - attempt: __CODECC_RETRY_ATTEMPT__ - interval: __CODECC_RETRY_INTERVAL__ - -codecc: - encryptor: - password: __CODECC_ENC_PWD__ - quartz: - tag: prod - diff --git a/support-files/templates/#etc#codecc#application-task.yml b/support-files/templates/#etc#codecc#application-task.yml deleted file mode 100644 index e6c307d27d5..00000000000 --- a/support-files/templates/#etc#codecc#application-task.yml +++ /dev/null @@ -1,23 +0,0 @@ -# 服务配置文件模板 -spring: - application: - name: task${service-suffix} - desc: Task Service - data: - mongodb: - uri: mongodb://__MONGODB_USER__:__MONGODB_PASS__@__MONGODB_IP__:__MONGODB_PORT__/db_task?replicaSet=rs0&slaveOk=true - -# 服务器端口配置,在同一台机器上部署多个微服务,端口号要不同 23910 -server: - port: __CODECC_TASK_PORT__ # 服务端口 - - -time: - analysis: - maxhour: __CODECC_ANALYSIS_MAXHOUR__ - -devops: - imageName: __DEVOPS_DISPATCH_DOCER_DEFAULT_IMAGE_NAME__ - retry: - attempt: __CODECC_RETRY_ATTEMPT__ - interval: __CODECC_RETRY_INTERVAL__ diff --git a/support-files/templates/#etc#codecc#common.yml b/support-files/templates/#etc#codecc#common.yml deleted file mode 100644 index f7b4975c016..00000000000 --- a/support-files/templates/#etc#codecc#common.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Common config Template 重复的通用的配置抽离在到 - -spring: - application: - version: 4.0.0 - # consul config do not need to change - redis: - host: __REDIS_IP__ - port: __REDIS_PORT__ - password: __REDIS_PASS__ - pool: - maxActive: 16 - maxWait: 2000 - maxIdle: 16 - minIdle: 0 - rabbitmq: - virtual-host: __RABBITMQ_CODECC_VHOST__ - username: __RABBITMQ_USERNAME__ - password: __RABBITMQ_PASSWORD__ - addresses: __RABBITMQ_HOST__:__RABBITMQ_PORT__ - cloud: - consul: - discovery: - tags: __DEVOPS_CONSUL_TAG__ - health-check-path: /management/health - heartbeat: - enabled: true - query-passing: true - preferIpAddress: true - port: __DEVOPS_CONSUL_PORT__ - http: - encoding: - charset: UTF-8 - enabled: true - force: true - -# http concurrency -server: - servlet-path: / - undertow: - worker-threads: 100 - -# monitor path config -management: - security: - enabled: false - context-path: /management - - -auth: - envName: prod - url: __CODECC_AUTH_URL__ - codeccCode: __APP_CODE__ - codeccSecret: __APP_TOKEN__ - systemId: __CODECC_SYSTEM_ID__ - resourceType: __CODECC_RESOURCE_TYPE__ - -devopsGateway: - host: __DEVOPS_GATEWAY_HOST__:__DEVOPS_GATEWAY_PORT__ - -codeccGateway: - host: __CODECC_GATEWAY_HOST__:__CODECC_GATEWAY_PORT__ - api: __CODECC_GATEWAY_HOST__:__CODECC_GATEWAY_PORT__ - -service-suffix: "-__BKCI_CONSUL_TAG__" - - From bac9a0963d319e16a0d9264b6d3b9b5ce6210a8c Mon Sep 17 00:00:00 2001 From: ddlin0719 Date: Thu, 22 Jul 2021 19:34:19 +0800 Subject: [PATCH 5/5] feat: CodeCC For 1.5 #4572 rename codecc.frontend.conf --- .../codecc/templates/gateway#core#vhosts#codecc.frontend.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support-files/codecc/templates/gateway#core#vhosts#codecc.frontend.conf b/support-files/codecc/templates/gateway#core#vhosts#codecc.frontend.conf index c8ec69ab3eb..3b73c2cd36c 100644 --- a/support-files/codecc/templates/gateway#core#vhosts#codecc.frontend.conf +++ b/support-files/codecc/templates/gateway#core#vhosts#codecc.frontend.conf @@ -23,7 +23,7 @@ } location ~* \.(js|css|ttf)$ { - header_filter_by_luca_file 'conf/lua/cors_filter.lua'; + header_filter_by_lua_file 'conf/lua/cors_filter.lua'; add_header Cache-Control max-age=2592000; try_files $uri @fallback; # 匹配所有以 js,css或tff 结尾的请求