Skip to content

Commit

Permalink
fix(svc-otel): bKKRILL_ENCRYPT_SECRET_KEY can be set in env (#1413)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiayuan929 authored Jun 21, 2024
1 parent 600c545 commit 41788ee
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions svc-otel/svc_otel/settings/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
to the current version of the project delivered to anyone in the future.
"""

import base64
import os
from pathlib import Path

Expand Down Expand Up @@ -207,7 +206,12 @@ def get_logging_config(log_level="DEBUG"):
}


BKKRILL_ENCRYPT_SECRET_KEY = base64.b64encode(b"oVOcQCMuuXjFoLvrbJvUKAnNvrAoalqV")
# 环境变量设置了 BKKRILL_ENCRYPT_SECRET_KEY 且不为空时才使用环境变量中的值,否则使用默认值
BKKRILL_ENCRYPT_SECRET_KEY = (
env.str("BKKRILL_ENCRYPT_SECRET_KEY", default="").encode()
or "b1ZPY1FDTXV1WGpGb0x2cmJKdlVLQW5OdnJBb2FscVY=".encode()
)


METRIC_CLIENT_TOKEN_DICT = {
"monitoring": env.str("METRIC_CLIENT_TOKEN", "f7b58586-5e20-f189-7cf5-a020524cda3e"),
Expand Down

0 comments on commit 41788ee

Please sign in to comment.