Last active
August 29, 2015 14:07
-
-
Save tobie/ee909e29a4ebebf2dc1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ENV_REGEXPS = {}; | |
for (var k in process.env) { | |
ENV_REGEXPS["[" + k + "]"] = new RegExp(escRegExp(process.env[k]), "g"); | |
} | |
// Make sure ENV VARS don't accidentally end-up in a log. | |
// Note this opens up the risk of ENV VARS being | |
// leaked if known content contains the value of ENV VARS. | |
var log = kue.Job.prototype.log; | |
kue.Job.prototype.log = function() { | |
var str = arguments[0]; | |
for (var k in ENV_REGEXPS) { | |
str = str.replace(ENV_REGEXPS[k], k); | |
} | |
arguments[0] = str; | |
return log.apply(this, arguments); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment