Skip to content

Commit b3e5410

Browse files
Hiding the password
1 parent 2ab7f2c commit b3e5410

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

server.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,38 @@ if (configName.indexOf("-") === 0) {
1515
configName = "default";
1616
}
1717

18+
// If a password is given as a command line parameter, we hide it
19+
// in the title of the process instead of displaying it in plain
20+
// text.
21+
var title_parts = process.argv;
22+
title_parts.forEach(function(element, index, array) {
23+
if (element === '--password') {
24+
array[index+1] = 'xxxxxxxx';
25+
}
26+
});
27+
process.title = title_parts.join(' ');
28+
1829
var debug = false;
1930
var packed = false;
2031
var packedName = "";
2132

2233
for (var p = 2; p < process.argv.length; p++) {
2334
if (process.argv[p] === "-d") {
2435
debug = true;
25-
36+
2637
// apf debug doesn't exist, or it's older than three days--rebuild it
2738
if(!path.existsSync("plugins-client/lib.apf/www/apf-packaged/apf_debug.js") ||
2839
(path.existsSync("plugins-client/lib.apf/www/apf-packaged/apf_debug.js")) &&
2940
((new Date() - fs.statSync("plugins-client/lib.apf/www/apf-packaged/apf_debug.js").mtime.valueOf()) / 86400000) >= 3) {
3041
console.log("Building apfdebug for first run...");
31-
42+
3243
var buildDebug = spawn("npm", ["run-script", "build-debug"]);
33-
44+
3445
buildDebug.stderr.setEncoding("utf8");
3546
buildDebug.stderr.on('data', function (data) {
3647
console.error(data);
3748
});
38-
49+
3950
buildDebug.on('exit', function (code) {
4051
if (code !== 0) {
4152
console.error('build-debug process exited with code ' + code);
@@ -65,7 +76,7 @@ for (var p = 2; p < process.argv.length; p++) {
6576
" '---''(_/--' `-'\\_) Felix Lee");
6677

6778
var buildPackage = spawn("npm", ["run-script", "build-packed"]);
68-
79+
6980
buildPackage.stderr.setEncoding("utf8");
7081
buildPackage.stderr.on('data', function (data) {
7182
console.error(data);

0 commit comments

Comments
 (0)