Meteor:process.env.MAIL_URL敏感信息

时间:2015-11-07 19:34:31

标签: javascript meteor privacy env email-verification

我正在为我的meteor应用程序发送电子邮件验证,但我也将应用程序上传到github。我有以下代码:

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 个答案:

答案 0 :(得分:1)

是的,您只需添加gitignore文件即可。 https://git-scm.com/docs/gitignore

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