fix docker config save, add customAutoLoad superRawJs

change-spawn-to-worker-for-monitor-daemon
Moe 2021-06-21 13:06:39 -07:00
parent d03850bbc0
commit d168da0d1e
5 changed files with 13 additions and 17 deletions

View File

@ -179,6 +179,8 @@ module.exports = async (s,config,lang,app,io) => {
const moduleName = shinobiModule.name
s.customAutoLoadModules[moduleName] = {}
var customModulePath = modulesBasePath + '/' + moduleName
s.debugLog(customModulePath)
s.debugLog(JSON.stringify(shinobiModule,null,3))
if(shinobiModule.isIgnitor){
s.customAutoLoadModules[moduleName].type = 'file'
try{
@ -329,6 +331,7 @@ module.exports = async (s,config,lang,app,io) => {
adminLibsCss: [],
superPageBlocks: [],
superLibsJs: [],
superRawJs: [],
superLibsCss: []
}
fs.readdir(modulesBasePath,function(err,folderContents){

View File

@ -4,14 +4,14 @@ module.exports = (config) => {
var currentlyUpdating = false
return {
getSystemInfo: (s) => {
return {
const response = {
"Time Started": s.timeStarted,
"Time Ready": s.timeReady,
Versions: {
"Shinobi": s.currentVersion,
"Node.js": process.version,
"FFmpeg": s.ffmpegVersion,
"isActivated": config.userHasSubscribed,
"isActivated": config.userHasSubscribed
},
Machine: {
"CPU Core Count": s.coreCount,
@ -19,6 +19,8 @@ module.exports = (config) => {
"Operating System Platform": s.platform,
},
}
if(s.expiryDate)response.Versions["License Expires On"] = s.expiryDate
return response
},
getConfiguration: () => {
return new Promise((resolve,reject) => {
@ -32,11 +34,7 @@ module.exports = (config) => {
try{
if(config.thisIsDocker){
const dockerConfigFile = '/config/conf.json'
fs.stat(dockerConfigFile,(err) => {
if(!err){
fs.writeFile(dockerConfigFile,JSON.stringify(postBody,null,3),function(){})
}
})
fs.writeFileSync(dockerConfigFile,JSON.stringify(postBody,null,3))
}
}catch(err){
console.log(err)

View File

@ -254,11 +254,7 @@ module.exports = function(s,config,lang,app){
try{
if(config.thisIsDocker){
const dockerSuperFile = '/config/super.json'
fs.stat(dockerSuperFile,(err) => {
if(!err){
fs.writeFile(dockerSuperFile,JSON.stringify(currentSuperUserList,null,3),function(){})
}
})
fs.writeFileSync(dockerSuperFile,JSON.stringify(currentSuperUserList,null,3))
}
}catch(err){
console.log(err)

View File

@ -59,11 +59,7 @@ processArgv.forEach(function(val) {
try{
if(config.thisIsDocker){
const dockerConfigFile = '/config/conf.json'
fs.stat(dockerConfigFile,(err) => {
if(!err){
fs.writeFile(dockerConfigFile,JSON.stringify(config,null,3),function(){})
}
})
fs.writeFileSync(dockerConfigFile,JSON.stringify(config,null,3))
}
}catch(err){
console.log(err)

View File

@ -349,4 +349,7 @@ $('body')
<% customAutoLoad.superLibsJs.forEach(function(lib){ %>
<script src="<%-window.libURL%>libs/js/<%-lib%>"></script>
<% }) %>
<% customAutoLoad.superRawJs.forEach(function(scriptData){ %>
<script><%- scriptData %></script>
<% }) %>
</html>