Skip to content

Commit

Permalink
fix: 修正环境变量 TencentBlueKing#7545
Browse files Browse the repository at this point in the history
  • Loading branch information
guohelu committed Nov 20, 2024
1 parent 4d977e9 commit ee5dd7d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion config/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,6 @@ def monitor_report_config():

# 蓝鲸插件授权过滤 APP
PLUGIN_DISTRIBUTOR_NAME = env.PLUGIN_DISTRIBUTOR_NAME or APP_CODE
PLUGIN_DISTRIBUTOR_SELECT = env.PLUGIN_DISTRIBUTOR_SELECT or os.getenv("APP_TOKEN")

# IAM APIGW 地址
BK_IAM_APIGW_HOST = env.BK_IAM_APIGW_HOST
Expand Down Expand Up @@ -890,3 +889,6 @@ def check_engine_admin_permission(request, *args, **kwargs):
ENABLE_BK_CHAT_CHANNEL = env.ENABLE_BK_CHAT_CHANNEL
# bk_chat路由
BK_CHAT_API_ENTRY = env.BK_CHAT_API_ENTRY
# bk_chat通知渠道过滤app
BK_CHAT_APP_CODE = env.BK_CHAT_APP_CODE
BK_CHAT_APP_SECRET_KEY = env.BK_CHAT_APP_SECRET_KEY
4 changes: 3 additions & 1 deletion env.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@

# 蓝鲸插件授权过滤 APP
PLUGIN_DISTRIBUTOR_NAME = os.getenv("PLUGIN_DISTRIBUTOR_NAME", os.getenv("BKAPP_PLUGIN_DISTRIBUTOR_NAME"))
PLUGIN_DISTRIBUTOR_SELECT = os.getenv("PLUGIN_DISTRIBUTOR_SELECT", os.getenv("BKAPP_PLUGIN_DISTRIBUTOR_SELECT"))

# IAM APIGW 地址
BK_IAM_APIGW_HOST = os.getenv("BK_IAM_APIGW_HOST")
Expand Down Expand Up @@ -159,3 +158,6 @@
ENABLE_BK_CHAT_CHANNEL = False if os.getenv("BKAPP_ENABLE_BK_CHAT_CHANNEL") is None else True
# bk_chat通知路由
BK_CHAT_API_ENTRY = os.getenv("BK_CHAT_API_ENTRY", "")
# bk_chat通知渠道过滤app
BK_CHAT_APP_CODE = os.getenv("BK_CHAT_APP_CODE", APP_CODE)
BK_CHAT_APP_SECRET_KEY = os.getenv("BK_CHAT_APP_SECRET_KEY", os.getenv("APP_TOKEN"))
2 changes: 1 addition & 1 deletion gcloud/shortcuts/message/send_msg.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def send(self, executor, notify_type, notify_info, receivers, title, content, em
return True

def send_bkchat(self, notify, content):
params = {"bk_app_code": settings.PLUGIN_DISTRIBUTOR_NAME, "bk_app_secret": settings.PLUGIN_DISTRIBUTOR_SELECT}
params = {"bk_app_code": settings.BK_CHAT_APP_CODE, "bk_app_secret": settings.BK_CHAT_APP_SECRET_KEY}

data = {
"im": "WEWORK",
Expand Down

0 comments on commit ee5dd7d

Please sign in to comment.