简体   繁体   中英

Where do keep my config if I can't push it to github?

This is a dumb question, but i'm new to Github and was wondering where I should keep my config file for my app since I can't (rather shouldn't) push it to Github where it can be compromised. I know you can simply not stage the file for a commit, but then when I clone my repository it would be missing that file which would make my program not work.

Where should I put my config file? Is there some special method in Github that prevents people from viewing sensitive info?

That kind of data is specific to environment. Meaning, let's say, you are going to host your app in kubernetes in prod, then you would use kubernetes secrets to hold the sensitive data and then pull that data at app run. Since you local is just another environment then you want to keep those secrets in your local, or using other some other tool in your local so that you can remember the config values when you are setting up your app from scratch. That being said, you can have template configs that will let the developer know what envs the app expects, and this can be committed into github. And from there, the readme can state how to get the secret data so that each developer can stand up their own local env.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM