Barry Michael Doyle
Barry Michael Doyle

Reputation: 10608

Meteor: process.env.MAIL_URL sensitive info

I'm sending email verifications for my meteor app but I'm also uploading the app to github. I have the following code:

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;
    ..
    ..
    ..
}

Is there any way to make my username and password private in code so that it can't be viewed on my public github account?

Thanks

Upvotes: 1

Views: 217

Answers (1)

thatgibbyguy
thatgibbyguy

Reputation: 4103

Yes, you just make an addition to your gitignore file. https://git-scm.com/docs/gitignore

It may be worthwhile for you to have a single file or directory with sensitive info for your whole app (keys, passwords) that you ignore.

Upvotes: 1

Related Questions