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

暴露了用户名密码以及服务器ip地址,很不安全 #204

Open
js00070 opened this issue Dec 5, 2019 · 1 comment
Open

暴露了用户名密码以及服务器ip地址,很不安全 #204

js00070 opened this issue Dec 5, 2019 · 1 comment

Comments

@js00070
Copy link
Contributor

js00070 commented Dec 5, 2019

err := orm.RegisterDataBase("default", "postgres", "user=sspkukcoin password=kcoin2019 dbname=postgres host=114.115.133.140 port=5432")

建议使用github.com/joho/godotenv 这个库,从环境变量或者代码目录里的.env文件中读取数据库连接信息,在.gitignore文件中添加.env这一项,避免生产环境配置被传到公共仓库上

@jiangyuzhao
Copy link
Contributor

是这样的,这个很早就想做了,beego框架提供了config文件以及从config文件中读取配置的接口,但是好像一直没做。

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