gnormal / gnorm

A database-first code generator for any language
https://gnorm.org
Other
485 stars 40 forks source link

fix '$' replacement , passwords may contains '' or '$' #64

Closed ahmdrz closed 6 years ago

natefinch commented 6 years ago

I think most people will prefer to not have their password in the configuration file. However, what I think we can do is add another config value that'll tell gnorm not to expand environment variables in the connection string.

ahmdrz commented 6 years ago

Hi @natefinch ,

  1. I think we can encrypt config file , when we want to load file , enter password key to decrypt and use file as config.
  2. Your idea is great , But which one is important ? How many users use environment variables as config ?

So , I want to contribute your code :smile: , What can I do ?

File encryption or new config option ?

natefinch commented 6 years ago

I think a lot of people tend to use environment variables, especially for passwords, but it obviously depends on the person. I don't think many people will want their whole config file encrypted, because most of it is not sensitive information at all.

If you'd like to contribute, a you can add a new config value called

ExpandConnStr

Make it a boolean, make it default to true if not explicitly set in the config file.

After you get it working, add it to gnorm/cli/gnorm.toml with an explanation of what it does in the comment above it, and then run go generate ./... from the gnorm directory, which will update some of the docs from that gnorm.toml file.

ahmdrz commented 6 years ago

Of course As soon as possible

Regards.

On Oct 23, 2017 17:49, Nate Finch notifications@github.com wrote:

I think a lot of people tend to use environment variables, especially for passwords, but it obviously depends on the person. I don't think many people will want their whole config file encrypted, because most of it is not sensitive information at all.

If you'd like to contribute, a you can add a new config value called

ExpandConnStr

Make it a boolean, make it default to true if not explicitly set in the config file.

After you get it working, add it to gnorm/cli/gnorm.toml with an explanation of what it does in the comment above it, and then run go generate ./... from the gnorm directory, which will update some of the docs from that gnorm.toml file.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gnormal/gnorm/pull/64#issuecomment-338674342, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQK5JIH5azt4dqT9Uhlz8tswjJNOms-Tks5svKB6gaJpZM4QCWsH.

natefinch commented 6 years ago

Closing, looking forward to the new PR. Thanks!