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

cloudbaserc.json的环境变量,不支持设置json string的格式 #237

Open
huangjacky opened this issue Sep 6, 2021 · 3 comments
Open

Comments

@huangjacky
Copy link

image
如图SessionProviderConfig在定义里面是一个字符串。
执行

tcb framework deploy

报错
image

查看log文件,大致是因为
image
多Unmarshal了?

如何设置环境变量是json格式的字符串呢?

@huangjacky
Copy link
Author

使用env的方式也不行,这种方式感觉是字符串占位填充,挪过来后,导致json文件不对了

 "SessionProviderConfig": "{{env.SessionConfig}}",
cat .env                 
SessionConfig={"cookieName": "bid","enableSetCookie,omitempty":true,"secure":true,"providerConfig":"127.0.0.1:6379,10,123,7"}

直接报错
image

@binggg
Copy link
Collaborator

binggg commented Sep 6, 2021

可以试下 在.env 中

SessionProviderConfig.cookiename= bid 这种

@huangjacky
Copy link
Author

可以试下 在.env 中

SessionProviderConfig.cookiename= bid 这种
.env 文件内容
image

控制台显示设置有key,但是没有value的样子
image

程序中无法获取到这个环境变量。

看样子还是不行。

现在看只能把json string->base64->env var
然后程序里面 env var->base64 decode->json.Unmarsharl了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants