BREAKING CHANGES: (for SeCuRiTy):
By default: - `ssid_sessions[socket.ssid]` is now `session_data` - `require` is no longer allowed in user scripts To access global `socket_sessions` and `ssid_sessions`, as well as `require` additional modules, you must set `privileged: true` for the specific service. See `config.json`.
This commit is contained in:
@@ -38,6 +38,36 @@ class WTVShared {
|
||||
}
|
||||
}
|
||||
}
|
||||
getServiceString(service, overrides = {}) {
|
||||
// used externally by service scripts
|
||||
if (service === "all") {
|
||||
var out = "";
|
||||
Object.keys(minisrv_config.services).forEach(function (k) {
|
||||
if (overrides.exceptions) {
|
||||
Object.keys(overrides.exceptions).forEach(function (j) {
|
||||
if (k != overrides.exceptions[j]) out += minisrv_config.services[k].toString(overrides) + "\n";
|
||||
});
|
||||
} else {
|
||||
out += minisrv_config.services[k].toString(overrides) + "\n";
|
||||
}
|
||||
});
|
||||
return out;
|
||||
} else {
|
||||
if (!minisrv_config.services[service]) {
|
||||
throw ("SERVICE ERROR: Attempted to provision unconfigured service: " + service)
|
||||
} else {
|
||||
return minisrv_config.services[service].toString(overrides);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parseBool(val) {
|
||||
if (typeof val === 'string')
|
||||
val = val.toLowerCase();
|
||||
|
||||
return val === true || val === "true" || val === 1;
|
||||
}
|
||||
|
||||
|
||||
getQueryString(query) {
|
||||
// for easy retrofitting old code to work with the webtvism of allowing multiple of the same query name
|
||||
|
||||
Reference in New Issue
Block a user