使用 base32 解码传入的密钥;优化调试接口返回内容;新增 RUN_MODE,根据环境变量确定是否要公开调试接口

This commit is contained in:
2025-05-22 14:52:31 +08:00
parent 8c824595f4
commit 12038f0af7
6 changed files with 71 additions and 33 deletions

11
gateway/env/env.go vendored
View File

@@ -10,6 +10,8 @@ import (
)
var (
RunMode = "dev" // 运行模式dev: 开发模式prod: 生产模式
AppCtrlPort uint16 = 18080
AppDataPort uint16 = 18081
AppWebPort uint16 = 8848
@@ -38,6 +40,15 @@ func Init() {
}
var value string
value = os.Getenv("RUN_MODE")
switch value {
case "dev", "prod":
RunMode = value
case "":
default:
panic(fmt.Sprintf("环境变量 RUN_MODE 格式错误: %s", value))
}
value = os.Getenv("APP_CTRL_PORT")
if value != "" {
appCtrlPort, err := strconv.Atoi(value)