Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 解决使用docker运行获取秘钥异常的问题 #263

Merged
merged 1 commit into from
Jun 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: 解决使用docker运行获取秘钥异常的问题
  • Loading branch information
eryajf committed Jun 22, 2023
commit c1944e5acc14f3d98a6af61bf1321de45a65ce04
7 changes: 3 additions & 4 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type Configuration struct {
// 会话超时时间
SessionTimeout time.Duration `yaml:"session_timeout"`
// 最大问题长度
MaxQuestionLen int `yaml:"max_question_len"`
MaxQuestionLen int `yaml:"max_question_len"`
// 最大答案长度
MaxAnswerLen int `yaml:"max_answer_len"`
// 最大文本 = 问题 + 回答, 接口限制
Expand Down Expand Up @@ -224,11 +224,10 @@ func LoadConfig() *Configuration {
if azureOpenaiToken != "" {
config.AzureOpenAIToken = azureOpenaiToken
}

credentials := os.Getenv("DINGTALK_CREDENTIALS")
if credentials != "" {
if config.Credentials == nil {
config.Credentials = []Credential{}
}
config.Credentials = []Credential{}
for _, idSecret := range strings.Split(credentials, ",") {
items := strings.SplitN(idSecret, ":", 2)
if len(items) == 2 {
Expand Down
Loading