Add SERVER_ADMIN environment variable support

This commit is contained in:
Dorian Niemiec 2023-08-27 09:26:45 +02:00
parent c8964e04e4
commit f8e3e1e094

View file

@ -190,6 +190,9 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
nEnv["SERVER_ADDR"] = pubip.replace(/^::ffff:/i, ""); nEnv["SERVER_ADDR"] = pubip.replace(/^::ffff:/i, "");
if (nEnv["SERVER_ADDR"].indexOf(":") != -1) nEnv["SERVER_ADDR"] = "[" + nEnv["SERVER_ADDR"] + "]"; if (nEnv["SERVER_ADDR"].indexOf(":") != -1) nEnv["SERVER_ADDR"] = "[" + nEnv["SERVER_ADDR"] + "]";
} }
if(configJSON.serverAdministratorEmail && configJSON.serverAdministratorEmail != "[no contact information]") {
nEnv["SERVER_ADMIN"] = configJSON.serverAdministratorEmail;
}
nEnv["SERVER_NAME"] = req.headers.host; nEnv["SERVER_NAME"] = req.headers.host;
nEnv["DOCUMENT_ROOT"] = process.cwd(); nEnv["DOCUMENT_ROOT"] = process.cwd();
nEnv["SCRIPT_NAME"] = scgiConf.path; nEnv["SCRIPT_NAME"] = scgiConf.path;