mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Logging node version, and sme formatting
This commit is contained in:
parent
ef7066474c
commit
20488d90cb
1 changed files with 10 additions and 7 deletions
|
@ -53,7 +53,8 @@ const fullchainFile = "/etc/letsencrypt/live/qmining.tk/fullchain.pem";
|
||||||
const chainFile = "/etc/letsencrypt/live/qmining.tk/chain.pem";
|
const chainFile = "/etc/letsencrypt/live/qmining.tk/chain.pem";
|
||||||
|
|
||||||
var certsLoaded = false;
|
var certsLoaded = false;
|
||||||
if (startHTTPS && utils.FileExists(privkeyFile) && utils.FileExists(fullchainFile) && utils.FileExists(chainFile)) {
|
if (startHTTPS && utils.FileExists(privkeyFile) && utils.FileExists(fullchainFile) && utils.FileExists(
|
||||||
|
chainFile)) {
|
||||||
try {
|
try {
|
||||||
const key = fs.readFileSync(privkeyFile, "utf8");
|
const key = fs.readFileSync(privkeyFile, "utf8");
|
||||||
const cert = fs.readFileSync(fullchainFile, "utf8");
|
const cert = fs.readFileSync(fullchainFile, "utf8");
|
||||||
|
@ -220,7 +221,8 @@ function UploadFile(req, res, path, next) {
|
||||||
utils.CreatePath(path, true);
|
utils.CreatePath(path, true);
|
||||||
let d = new Date();
|
let d = new Date();
|
||||||
let fsplit = filename.split('.');
|
let fsplit = filename.split('.');
|
||||||
let fn = d.getHours() + "" + d.getMinutes() + "" + d.getSeconds() + "." + fsplit[fsplit.length - 1];
|
let fn = d.getHours() + "" + d.getMinutes() + "" + d.getSeconds() + "." + fsplit[fsplit.length -
|
||||||
|
1];
|
||||||
|
|
||||||
fstream = fs.createWriteStream(path + "/" + fn);
|
fstream = fs.createWriteStream(path + "/" + fn);
|
||||||
file.pipe(fstream);
|
file.pipe(fstream);
|
||||||
|
@ -274,6 +276,7 @@ if (startHTTPS && certsLoaded) {
|
||||||
logger.Log("Cert files does not exists, starting http only!", logger.GetColor("redbg"));
|
logger.Log("Cert files does not exists, starting http only!", logger.GetColor("redbg"));
|
||||||
}
|
}
|
||||||
logger.Log(msg, logger.GetColor("yellow"));
|
logger.Log(msg, logger.GetColor("yellow"));
|
||||||
|
logger.Log("Node version: " + process.version);
|
||||||
|
|
||||||
function Log(req, toFile, sc) {
|
function Log(req, toFile, sc) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue