Skip to content

Commit

Permalink
feature: 新增 BK_CC_HOST 环境变量用于前端跳转逻辑 (closed TencentBlueKing#1255)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhuoZhuoCrayon committed Dec 22, 2022
1 parent 7bbbbce commit 60fcfee
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions common/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ def mysetting(request):
"LOGIN_SERVICE_URL": ConfFixture.LOGIN_URL,
# PAAS域名
"BK_PAAS_HOST": settings.BK_PAAS_HOST,
# CMDB 访问地址
"CMDB_URL": settings.BK_CC_HOST,
# 当前页面,主要为了login_required做跳转用
"APP_PATH": request.get_full_path(),
"NOW": datetime.datetime.now(),
Expand Down
1 change: 1 addition & 0 deletions config/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@
# 节点管理后台外网域名,用于构造文件导入导出的API URL
BK_NODEMAN_BACKEND_HOST = env.BK_NODEMAN_BACKEND_HOST
BK_JOB_HOST = os.environ.get("BK_JOB_HOST", BK_PAAS_HOST.replace("paas", "job"))
BK_CC_HOST = env.BK_CC_HOST

# 是否使用权限中心
USE_IAM = bool(os.getenv("BKAPP_USE_IAM", False))
Expand Down
3 changes: 3 additions & 0 deletions dev_log/2.2.32/crayon_202211211745.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
feature:
- "新增 BK_CC_HOST 环境变量用于前端跳转逻辑 (closed #1255)"
6 changes: 6 additions & 0 deletions env/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"BKAPP_OTEL_SAMPLER",
"BKAPP_OTEL_BK_DATA_TOKEN",
"BKAPP_OTEL_GRPC_URL",
"BK_CC_HOST",
"ENVIRONMENT",
# esb 访问地址
"BK_COMPONENT_API_URL",
Expand Down Expand Up @@ -85,3 +86,8 @@
# 监控上报配置项
BKAPP_OTEL_BK_DATA_TOKEN = get_type_env(key="BKAPP_OTEL_BK_DATA_TOKEN", _type=str)
BKAPP_OTEL_GRPC_URL = get_type_env(key="BKAPP_OTEL_GRPC_URL", _type=str)

# ===============================================================================
# 第三方依赖
# ===============================================================================
BK_CC_HOST = get_type_env(key="BK_CC_HOST", default="", _type=str)
1 change: 1 addition & 0 deletions support-files/kubernetes/helm/bk-nodeman/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ externalRabbitMQ:
| `bkNodemanUrl` | 节点管理浏览器访问地址 | `http://bknodeman.example.com` |
| `bkNodemanApiUrl` | 节点管理后台访问地址 | `http://bk-nodeman-backend-api` |
| `bkJobUrl` | 蓝鲸作业平台浏览器访问地址 | `http://job.example.com` |
| `bkCmdbUrl` | 蓝鲸配置平台浏览器访问地址 | `http://cmdb.example.com` |
| `bkIamUrl` | 蓝鲸权限中心 SaaS 地址 | `http://bkiam.example.com` |
| `bkIamApiUrl` | 蓝鲸权限中心后台 API 地址 | `http://bkiam-api.example.com` |
| `bkRepoUrl` | 蓝鲸制品库浏览器访问域名和后台 API http://bkiam-api.example.com 域名同一个 | `http://bkrepo.example.com` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ data:

JOB_VERSION: "{{ .Values.config.jobVersion }}"
BLUEKING_BIZ_ID: "{{ .Values.config.bluekingBizId }}"
BK_CC_HOST: "{{ .Values.bkCmdbUrl }}"
BK_JOB_HOST: "{{ .Values.config.bkJobUrl | default .Values.bkJobUrl }}"

BKAPP_USE_IAM: "{{ .Values.config.bkAppUseIam }}"
Expand Down
3 changes: 3 additions & 0 deletions support-files/kubernetes/helm/bk-nodeman/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ bkNodemanUrl: "http://bknodeman.example.com"
## 节点管理后台访问地址
bkNodemanApiUrl: "http://bk-nodeman-backend-api"

## 蓝鲸配置平台浏览器访问地址
bkCmdbUrl: http://cmdb.example.com

## 蓝鲸作业平台浏览器访问地址
bkJobUrl: "http://job.example.com"

Expand Down

0 comments on commit 60fcfee

Please sign in to comment.