Hiding my sensitive information (e.g. password) from github

后端 未结 3 2117
礼貌的吻别
礼貌的吻别 2020-12-09 11:21

I just set up Devise (rails authentication plugin) to send a confirmation email upon sign up. This involved my putting the following into my environment.rb file:

<         


        
3条回答
  •  温柔的废话
    2020-12-09 11:54

    apneadiving is correct, adding to his solution, other folks downloading your code, may won't figure out quickly how to generate this yml, so you'll need to give them a hint, by having the following structure:

    config
      |
      |--- environment.rb
      |--- mail_settings.yml
      |--- main_settings.yml.example
    

    Having the file 'mail_settings.yml' contains your sensitive information and NOT included in the repo, and have 'main_settings.yml.example' included in your repo, and having the same structure as 'mail_settings.yml'.

    And to be more helpful, provide a section in you README file, describing that people need to copy the mail_settings.yml.example file to mail_settings.yml and enhance it's content.

提交回复
热议问题