2015-11-07 144 views
1

我正在为我的流星应用程序发送电子邮件验证,但我还将应用程序上传到github。我有以下代码:流星:process.env.MAIL_URL敏感信息

if (Meteor.isServer) { 
// This code only runs on the server 
Meteor.startup(function() { 
    // code to run on server at startup 

    process.env.MAIL_URL = "smtp://" + 
     encodeURIComponent("myUsernameIsHere") + ":" + 
     encodeURIComponent("myPasswordIsHere") + '@' + 
     encodeURIComponent("smtp.gmail.com") + ":" + 465; 
    .. 
    .. 
    .. 
} 

有没有什么办法让代码我的用户名和密码保密,使其无法在我的公开GitHub的帐户被视为?

感谢

回答

1

是的,你只是做一个除了你gitignore文件。 https://git-scm.com/docs/gitignore

您可能需要为您的整个应用程序(密钥,密码)提供一个包含敏感信息的单个文件或目录,并忽略它。