packages/shinobi: new patchset

This commit is contained in:
Max Headroom 2022-03-17 23:35:45 +01:00
parent 0e881a0697
commit e11fee895d
11 changed files with 80 additions and 56 deletions

View file

@ -17,8 +17,8 @@
./shinobi/0005-use-packageDirectory-for-definitions.patch ./shinobi/0005-use-packageDirectory-for-definitions.patch
./shinobi/0006-use-packageDirectory-for-web-server-paths.patch ./shinobi/0006-use-packageDirectory-for-web-server-paths.patch
./shinobi/0007-remove-terminalCommands.patch ./shinobi/0007-remove-terminalCommands.patch
./shinobi/0008-use-__dirname-in-ejs.patch ./shinobi/0008-disable-subscription-bullshit.patch
./shinobi/0009-disable-subscription-bullshit.patch ./shinobi/0009-remove-updater-logic.patch
]; ];
}; };
} }

View file

@ -1,4 +1,4 @@
From e30bec29ad5d960d8fe0e6d3427601d49d0746ea Mon Sep 17 00:00:00 2001 From 033c0a2889ec62ffbb3c489676fb315b3780ba60 Mon Sep 17 00:00:00 2001
From: Max <max@privatevoid.net> From: Max <max@privatevoid.net>
Date: Tue, 15 Mar 2022 18:15:23 +0100 Date: Tue, 15 Mar 2022 18:15:23 +0100
Subject: [PATCH 1/9] packageDirectory Subject: [PATCH 1/9] packageDirectory

View file

@ -1,4 +1,4 @@
From 28e6412cc76855bacc63a92e019fb2cb35cba259 Mon Sep 17 00:00:00 2001 From 955e63a2f2cd13b84fb8de1c379b5a7dc98c3dc4 Mon Sep 17 00:00:00 2001
From: Max <max@privatevoid.net> From: Max <max@privatevoid.net>
Date: Tue, 15 Mar 2022 18:19:58 +0100 Date: Tue, 15 Mar 2022 18:19:58 +0100
Subject: [PATCH 2/9] use packageDirectory for languages Subject: [PATCH 2/9] use packageDirectory for languages
@ -8,7 +8,7 @@ Subject: [PATCH 2/9] use packageDirectory for languages
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/config.js b/libs/config.js diff --git a/libs/config.js b/libs/config.js
index 65ed5ff..d20c05b 100644 index 27dae08..e2c8dae 100644
--- a/libs/config.js --- a/libs/config.js
+++ b/libs/config.js +++ b/libs/config.js
@@ -2,7 +2,7 @@ module.exports = function(s){ @@ -2,7 +2,7 @@ module.exports = function(s){

View file

@ -1,4 +1,4 @@
From 5de02cbd463bcc936907ed9af9dc13e4bd3e4f26 Mon Sep 17 00:00:00 2001 From 585c3b05855e4bf3e2bf059d0fda0a893700d3a0 Mon Sep 17 00:00:00 2001
From: Max <max@privatevoid.net> From: Max <max@privatevoid.net>
Date: Tue, 15 Mar 2022 18:26:44 +0100 Date: Tue, 15 Mar 2022 18:26:44 +0100
Subject: [PATCH 3/9] use s.location.languages Subject: [PATCH 3/9] use s.location.languages
@ -8,11 +8,11 @@ Subject: [PATCH 3/9] use s.location.languages
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/language.js b/libs/language.js diff --git a/libs/language.js b/libs/language.js
index ced395a..593321e 100644 index 285d514..3f964b6 100644
--- a/libs/language.js --- a/libs/language.js
+++ b/libs/language.js +++ b/libs/language.js
@@ -16,7 +16,7 @@ module.exports = function(s,config){ @@ -16,7 +16,7 @@ module.exports = function(s,config){
return Object.assign(lang,{}) return Object.assign({},lang)
} }
s.listOfPossibleLanguages = [] s.listOfPossibleLanguages = []
- fs.readdirSync(s.mainDirectory + '/languages').forEach(function(filename){ - fs.readdirSync(s.mainDirectory + '/languages').forEach(function(filename){

View file

@ -1,4 +1,4 @@
From b7f4ce7fc6ee30499a26a74c25a7a580a5ba4368 Mon Sep 17 00:00:00 2001 From 1f2260eae4be7084e209f07c2316328ed221433e Mon Sep 17 00:00:00 2001
From: Max <max@privatevoid.net> From: Max <max@privatevoid.net>
Date: Tue, 15 Mar 2022 18:28:48 +0100 Date: Tue, 15 Mar 2022 18:28:48 +0100
Subject: [PATCH 4/9] use packageDirectory for folders Subject: [PATCH 4/9] use packageDirectory for folders

View file

@ -1,4 +1,4 @@
From 77d75251a0e1e3a39d0131ef0b353f36bdf4e7b2 Mon Sep 17 00:00:00 2001 From 48b276736cf7fbd721dad40b5cabca1fb094b5d9 Mon Sep 17 00:00:00 2001
From: Max <max@privatevoid.net> From: Max <max@privatevoid.net>
Date: Tue, 15 Mar 2022 18:35:04 +0100 Date: Tue, 15 Mar 2022 18:35:04 +0100
Subject: [PATCH 5/9] use packageDirectory for definitions Subject: [PATCH 5/9] use packageDirectory for definitions

View file

@ -1,32 +1,35 @@
From fc54751d467c214c33178b04c128a13148c54ccb Mon Sep 17 00:00:00 2001 From c700ec6a01cfc99a639484e9045fc4492466c6ee Mon Sep 17 00:00:00 2001
From: Max <max@privatevoid.net> From: Max <max@privatevoid.net>
Date: Tue, 15 Mar 2022 18:48:34 +0100 Date: Tue, 15 Mar 2022 18:48:34 +0100
Subject: [PATCH 6/9] use packageDirectory for web server paths Subject: [PATCH 6/9] use packageDirectory for web server paths
--- ---
libs/webServerPaths.js | 16 ++++++++-------- libs/webServerPaths.js | 12 ++++++------
1 file changed, 8 insertions(+), 8 deletions(-) 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/libs/webServerPaths.js b/libs/webServerPaths.js diff --git a/libs/webServerPaths.js b/libs/webServerPaths.js
index 8e5b29e..56ef9f6 100644 index fba78ba..b72aff6 100644
--- a/libs/webServerPaths.js --- a/libs/webServerPaths.js
+++ b/libs/webServerPaths.js +++ b/libs/webServerPaths.js
@@ -73,21 +73,21 @@ module.exports = function(s,config,lang,app,io){ @@ -77,7 +77,7 @@ module.exports = function(s,config,lang,app,io){
////Pages ////Pages
app.enable('trust proxy'); app.enable('trust proxy');
if(config.webPaths.home !== '/'){ if(config.webPaths.home !== '/'){
- app.use('/libs',express.static(s.mainDirectory + '/web/libs')) - app.use('/libs',express.static(s.mainDirectory + '/web/libs'))
+ app.use('/libs',express.static(s.packageDirectory + '/web/libs')) + app.use('/libs',express.static(s.packageDirectory + '/web/libs'))
} }
- app.use(s.checkCorrectPathEnding(config.webPaths.home)+'libs',express.static(s.mainDirectory + '/web/libs')) [
- app.use(s.checkCorrectPathEnding(config.webPaths.admin)+'libs',express.static(s.mainDirectory + '/web/libs')) [config.webPaths.home,'libs','/web/libs'],
- app.use(s.checkCorrectPathEnding(config.webPaths.super)+'libs',express.static(s.mainDirectory + '/web/libs')) @@ -87,7 +87,7 @@ module.exports = function(s,config,lang,app,io){
+ app.use(s.checkCorrectPathEnding(config.webPaths.home)+'libs',express.static(s.packageDirectory + '/web/libs')) [config.webPaths.admin,'assets','/web/assets'],
+ app.use(s.checkCorrectPathEnding(config.webPaths.admin)+'libs',express.static(s.packageDirectory + '/web/libs')) [config.webPaths.super,'assets','/web/assets'],
+ app.use(s.checkCorrectPathEnding(config.webPaths.super)+'libs',express.static(s.packageDirectory + '/web/libs')) ].forEach((piece) => {
- app.use(s.checkCorrectPathEnding(piece[0])+piece[1],express.static(s.mainDirectory + piece[2]))
+ app.use(s.checkCorrectPathEnding(piece[0])+piece[1],express.static(s.packageDirectory + piece[2]))
})
app.use(bodyParser.json()); app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true})); app.use(bodyParser.urlencoded({extended: true}));
app.use(function (req,res,next){ @@ -95,10 +95,10 @@ module.exports = function(s,config,lang,app,io){
res.header("Access-Control-Allow-Origin",'*'); res.header("Access-Control-Allow-Origin",'*');
next() next()
}) })
@ -39,7 +42,7 @@ index 8e5b29e..56ef9f6 100644
/** /**
* API : Logout * API : Logout
@@ -328,7 +328,7 @@ module.exports = function(s,config,lang,app,io){ @@ -339,7 +339,7 @@ module.exports = function(s,config,lang,app,io){
define: s.getDefinitonFile(userInfo.details.lang), define: s.getDefinitonFile(userInfo.details.lang),
addStorage: s.dir.addStorage, addStorage: s.dir.addStorage,
fs: fs, fs: fs,
@ -48,7 +51,7 @@ index 8e5b29e..56ef9f6 100644
customAutoLoad: s.customAutoLoadTree customAutoLoad: s.customAutoLoadTree
}) })
break; break;
@@ -1771,6 +1771,6 @@ module.exports = function(s,config,lang,app,io){ @@ -1850,6 +1850,6 @@ module.exports = function(s,config,lang,app,io){
res.on('finish',function(){ res.on('finish',function(){
res.end() res.end()
}) })

View file

@ -1,4 +1,4 @@
From 9ea5979b0c2731604c0b2d519a929b5b920f9eb4 Mon Sep 17 00:00:00 2001 From a2a0608c4844520b0660bdf48b5376ed0a42e7af Mon Sep 17 00:00:00 2001
From: Max <max@privatevoid.net> From: Max <max@privatevoid.net>
Date: Tue, 15 Mar 2022 18:51:47 +0100 Date: Tue, 15 Mar 2022 18:51:47 +0100
Subject: [PATCH 7/9] remove terminalCommands Subject: [PATCH 7/9] remove terminalCommands
@ -8,10 +8,10 @@ Subject: [PATCH 7/9] remove terminalCommands
1 file changed, 1 insertion(+), 13 deletions(-) 1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/libs/startup.js b/libs/startup.js diff --git a/libs/startup.js b/libs/startup.js
index 47d338b..b67ecb9 100644 index b1c8e56..247eeee 100644
--- a/libs/startup.js --- a/libs/startup.js
+++ b/libs/startup.js +++ b/libs/startup.js
@@ -29,19 +29,7 @@ module.exports = function(s,config,lang,io){ @@ -32,19 +32,7 @@ module.exports = function(s,config,lang,io){
var next = function(){ var next = function(){
if(callback)callback() if(callback)callback()
} }

View file

@ -1,7 +1,7 @@
From 780f773004680b633cfc5c5f59cb320c58676947 Mon Sep 17 00:00:00 2001 From adb23ffced5408cc010b3863ba88fe81e39f17ce Mon Sep 17 00:00:00 2001
From: Max <max@privatevoid.net> From: Max <max@privatevoid.net>
Date: Tue, 15 Mar 2022 21:38:42 +0100 Date: Tue, 15 Mar 2022 21:38:42 +0100
Subject: [PATCH 9/9] disable subscription bullshit Subject: [PATCH 8/9] disable subscription bullshit
--- ---
libs/startup.js | 4 ++-- libs/startup.js | 4 ++--
@ -9,10 +9,10 @@ Subject: [PATCH 9/9] disable subscription bullshit
2 files changed, 3 insertions(+), 3 deletions(-) 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libs/startup.js b/libs/startup.js diff --git a/libs/startup.js b/libs/startup.js
index b67ecb9..b06abb1 100644 index 247eeee..a810171 100644
--- a/libs/startup.js --- a/libs/startup.js
+++ b/libs/startup.js +++ b/libs/startup.js
@@ -380,7 +380,7 @@ module.exports = function(s,config,lang,io){ @@ -383,7 +383,7 @@ module.exports = function(s,config,lang,io){
} }
}) })
} }
@ -21,8 +21,8 @@ index b67ecb9..b06abb1 100644
//check disk space every 20 minutes //check disk space every 20 minutes
if(config.autoDropCache===true){ if(config.autoDropCache===true){
setInterval(function(){ setInterval(function(){
@@ -400,7 +400,7 @@ module.exports = function(s,config,lang,io){ @@ -404,7 +404,7 @@ module.exports = function(s,config,lang,io){
setTimeout(() => { await checkForStaticUsers()
//check for subscription //check for subscription
checkSubscription(config.subscriptionId,function(hasSubcribed){ checkSubscription(config.subscriptionId,function(hasSubcribed){
- config.userHasSubscribed = hasSubcribed - config.userHasSubscribed = hasSubcribed

View file

@ -1,23 +0,0 @@
From 978dd533a08cc1155819be65598055f7232ad8c8 Mon Sep 17 00:00:00 2001
From: Max <max@privatevoid.net>
Date: Tue, 15 Mar 2022 19:18:02 +0100
Subject: [PATCH 8/9] use __dirname in ejs
---
web/pages/blocks/settings.ejs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web/pages/blocks/settings.ejs b/web/pages/blocks/settings.ejs
index 39d1b9b..7baed45 100644
--- a/web/pages/blocks/settings.ejs
+++ b/web/pages/blocks/settings.ejs
@@ -1,5 +1,5 @@
<!--Settings Window-->
-<% var audioFiles = fs.readdirSync('./web/libs/audio') %>
+<% var audioFiles = fs.readdirSync(__dirname + '/web/libs/audio') %>
<div class="modal fade medium dark" id="settings" tabindex="-1" role="dialog" aria-labelledby="settingsLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<form class="modal-content">
--
2.35.1

View file

@ -0,0 +1,44 @@
From 78e72ba70ddbe690720fd7351934481534fed6c2 Mon Sep 17 00:00:00 2001
From: Max <max@privatevoid.net>
Date: Thu, 17 Mar 2022 23:28:40 +0100
Subject: [PATCH 9/9] remove updater logic
---
libs/system/utils.js | 21 +--------------------
1 file changed, 1 insertion(+), 20 deletions(-)
diff --git a/libs/system/utils.js b/libs/system/utils.js
index c41c4f6..d045bac 100644
--- a/libs/system/utils.js
+++ b/libs/system/utils.js
@@ -46,26 +46,7 @@ module.exports = (config) => {
},
updateSystem: () => {
return new Promise((resolve,reject) => {
- if(!config.thisIsDocker){
- if(currentlyUpdating){
- resolve(true)
- return
- };
- currentlyUpdating = true
- const updateProcess = spawn('sh',[s.mainDirectory + '/UPDATE.sh'])
- updateProcess.stderr.on('data',(data) => {
- s.systemLog('UPDATE.sh',data.toString())
- })
- updateProcess.stdout.on('data',(data) => {
- s.systemLog('UPDATE.sh',data.toString())
- })
- updateProcess.on('exit',(data) => {
- resolve(true)
- currentlyUpdating = false
- })
- }else{
- resolve(false)
- }
+ resolve(false)
})
}
}
--
2.35.1