ultravisor 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ultravisor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "Cyclic process execution with ai integration.",
|
|
5
5
|
"main": "source/Ultravisor.cjs",
|
|
6
6
|
"bin": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"pict": "^1.0.359",
|
|
34
34
|
"pict-service-commandlineutility": "^1.0.19",
|
|
35
35
|
"pict-serviceproviderbase": "^1.0.4",
|
|
36
|
-
"ultravisor-beacon": "^0.0.
|
|
36
|
+
"ultravisor-beacon": "^0.0.7",
|
|
37
37
|
"ws": "^8.20.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
@@ -135,15 +135,21 @@ module.exports =
|
|
|
135
135
|
if (tmpOutputs.URL && !tmpOutputs.URL.startsWith('http'))
|
|
136
136
|
{
|
|
137
137
|
let tmpBeaconDef = tmpCoordinator.getBeacon(tmpResolved.BeaconID);
|
|
138
|
+
pTask.log.info(`Resolve Address: URL is relative, looking up BindAddresses for beacon ${tmpResolved.BeaconID}. getBeacon returned: ${tmpBeaconDef ? 'found' : 'null'}, BindAddresses: ${JSON.stringify(tmpBeaconDef && tmpBeaconDef.BindAddresses)}`);
|
|
138
139
|
let tmpBindAddresses = tmpBeaconDef && tmpBeaconDef.BindAddresses ? tmpBeaconDef.BindAddresses : [];
|
|
139
140
|
// Prefer non-loopback addresses
|
|
140
141
|
let tmpBind = tmpBindAddresses.find(function (pB) { return pB.IP !== '127.0.0.1' && pB.IP !== '::1'; }) || tmpBindAddresses[0];
|
|
141
142
|
if (tmpBind)
|
|
142
143
|
{
|
|
143
144
|
let tmpBaseURL = (tmpBind.Protocol || 'http') + '://' + tmpBind.IP + ':' + tmpBind.Port;
|
|
145
|
+
pTask.log.info(`Resolve Address: using bind address ${tmpBaseURL}`);
|
|
144
146
|
tmpOutputs.DirectURL = _buildDirectURL(tmpBaseURL);
|
|
145
147
|
tmpOutputs.URL = tmpOutputs.DirectURL;
|
|
146
148
|
}
|
|
149
|
+
else
|
|
150
|
+
{
|
|
151
|
+
pTask.log.warn(`Resolve Address: no BindAddresses available for beacon ${tmpResolved.BeaconID} — URL will remain relative`);
|
|
152
|
+
}
|
|
147
153
|
}
|
|
148
154
|
|
|
149
155
|
let tmpStateWrites = {};
|
|
@@ -211,6 +217,16 @@ module.exports =
|
|
|
211
217
|
|
|
212
218
|
pTask.log.info(`File Transfer: downloading ${tmpSourceURL} → ${tmpFilename}`);
|
|
213
219
|
|
|
220
|
+
// Validate URL before attempting request
|
|
221
|
+
if (!tmpSourceURL.startsWith('http://') && !tmpSourceURL.startsWith('https://'))
|
|
222
|
+
{
|
|
223
|
+
return fCallback(null, {
|
|
224
|
+
EventToFire: 'Error',
|
|
225
|
+
Outputs: { LocalPath: '', BytesTransferred: 0, DurationMs: 0 },
|
|
226
|
+
Log: [`File Transfer: invalid URL (no protocol): ${tmpSourceURL}`]
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
|
|
214
230
|
let tmpLib = tmpSourceURL.startsWith('https') ? libHTTPS : libHTTP;
|
|
215
231
|
let tmpRequest = tmpLib.get(tmpSourceURL, function (pResponse)
|
|
216
232
|
{
|
|
@@ -2062,7 +2062,8 @@ class UltravisorAPIServer extends libPictService
|
|
|
2062
2062
|
Operations: pData.Operations,
|
|
2063
2063
|
MaxConcurrent: pData.MaxConcurrent,
|
|
2064
2064
|
Tags: pData.Tags,
|
|
2065
|
-
Contexts: pData.Contexts
|
|
2065
|
+
Contexts: pData.Contexts,
|
|
2066
|
+
BindAddresses: pData.BindAddresses
|
|
2066
2067
|
});
|
|
2067
2068
|
|
|
2068
2069
|
pWebSocket._BeaconID = tmpBeacon.BeaconID;
|