mirror of
https://gitlab.com/jusax23/fmi.git
synced 2024-11-24 15:46:32 +01:00
31 lines
791 B
JavaScript
31 lines
791 B
JavaScript
|
import config from "./config.js";
|
||
|
|
||
|
|
||
|
const conf_struct = {
|
||
|
System:{
|
||
|
PORT:{type:"number",default:80},
|
||
|
URL:{type:"string",default:"https://google.de/"}
|
||
|
},
|
||
|
ssl:{
|
||
|
enable:{type:"boolean",default:true},
|
||
|
privkey:{type:"string",default:"privkey.pem"},
|
||
|
cert:{type:"string",default:"cert.pem"},
|
||
|
chain:{type:"string",default:"chain.pem"}
|
||
|
}
|
||
|
};
|
||
|
const mc = new config();
|
||
|
mc.connect("./config.juml",conf_struct,true);
|
||
|
|
||
|
if(mc.get("ssl","enable")){
|
||
|
console.log("SSL Enabled");
|
||
|
mc.readPathes(mc.get("ssl","privkey"),mc.get("ssl","cert"),mc.get("ssl","chain"))
|
||
|
.then(([privkey,cert,chain])=>{
|
||
|
console.log("privkey: ",privkey,"\ncert: ",cert,"\nchain: ",chain);
|
||
|
}).catch(err=>{
|
||
|
console.error(err);
|
||
|
process.exit();
|
||
|
});
|
||
|
}else{
|
||
|
console.log("SSL Disabled");
|
||
|
}
|