build: fix build without github

script: remove infinite loop protection
This commit is contained in:
jean-emmanuel 2025-12-27 11:36:15 +01:00
parent f2189e29ce
commit 967fb3d549
4 changed files with 2430 additions and 3906 deletions

View file

@ -1,5 +1,14 @@
# Changelog
## 1.29.9
- build
- fix building from sources now that open stage control is not hosted on github
- scripting
- user scripts are longer protected against infinite loop
## 1.29.8
- bug fixes

6299
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
"name": "open-stage-control",
"productName": "Open Stage Control",
"description": "Libre and modular OSC / MIDI controller",
"version": "1.29.8",
"version": "1.29.9",
"author": {
"name": "Jean-Emmanuel Doucet",
"email": "jean-emmanuel@ammd.net"
@ -15,7 +15,7 @@
],
"repository": {
"type": "git",
"url": "https://github.com/jean-emmanuel/open-stage-control"
"url": "https://framagit.org/jean-emmanuel/open-stage-control"
},
"homepage": "http://openstagecontrol.ammd.net/",
"license": "GPL-3.0",
@ -30,7 +30,7 @@
"ansi-html": "0.0.9",
"babelify": "10.0.0",
"balanced-match": "2.0.0",
"bonjour": "github:jean-emmanuel/bonjour",
"bonjour": "git+https://framagit.org/jean-emmanuel/bonjour.git",
"browserify": "17.0.0",
"chokidar": "3.5.3",
"chroma-js": "2.4.2",
@ -51,7 +51,6 @@
"jsondiffpatch": "0.4.1",
"keyboardjs": "2.6.4",
"licensify": "3.1.3",
"loop-protect": "github:jean-emmanuel/loop-protect#v1.0.1",
"minimatch": "5.1.0",
"nanohtml": "1.10.0",
"nanoid": "3.3.4",
@ -61,7 +60,7 @@
"nodemon": "2.0.16",
"nosleep.js": "0.12.0",
"open": "8.4.0",
"osc": "github:jean-emmanuel/osc.js",
"osc": "2.4.5",
"python-shell": "3.0.1",
"qrcode": "1.5.1",
"replacestream": "4.0.3",
@ -83,7 +82,7 @@
"optionalDependencies": {
"electron": "15.1.0",
"electron-installer-debian": "3.1.0",
"electron-installer-redhat": "3.4.0"
"electron-installer-redhat": "git+https://framagit.org/jean-emmanuel/electron-installer-redhat.git"
},
"scripts": {
"postinstall": "echo '\\033[36m=> Dependencies installed successfully. Run \"npm run build\" to build the assets.\\033[0m\n'",

View file

@ -1,5 +1,4 @@
var loopProtect = require('loop-protect'),
{deepCopy} = require('../utils'),
var {deepCopy} = require('../utils'),
globals
class Vm {
@ -45,13 +44,6 @@ class Vm {
this.sandbox.contentWindow.document.write('<meta http-equiv="Content-Security-Policy" content="default-src \'none\'; script-src \'unsafe-eval\';">')
this.sandbox.contentWindow.document.close()
// init infinite loop guard
loopProtect.alias = '__protect'
loopProtect.hit = function(line){
throw 'Potential infinite loop found on line ' + line + '(script interrupted).\nAdd "// noprotect" to your code to disable loop protection.'
}
this.sandbox.contentWindow.__protect = loopProtect
// global context
this.registerGlobals()
@ -139,12 +131,7 @@ class Vm {
}
}
var compiledCode = new this.safeFunctionProto(
...contextKeys, 'locals',
loopProtect('"use strict";' + contextInit + code)
.replace(/;\n(if \(__protect.*break;)\n/g, ';$1') // prevent loop protect from breaking stack linenumber
.replace(/(VAR_[0-9]+)/g, '__VARS.$1')
)
var compiledCode = new this.safeFunctionProto(...contextKeys, 'locals', code.replace(/(VAR_[0-9]+)/g, '__VARS.$1'))
return (context, locals)=>{