Skip to content

Commit

Permalink
www/ajax/discoverCameras.php: set NODE_PATH for js tool cmd
Browse files Browse the repository at this point in the history
In bluecherry-node-onvif package, we bundle the dependencies necessary
to avoid relying on packaging of all of them the Debian way.

The command "node .../discovery_json/node-onvif.js" doesn't work as it
doesn't look for node_modules where we put them,
/usr/share/nodejs/onvif/node_modules .

This change passes NODE_PATH env var to `node` interpreter command,
which is handled as expected by PHP's popen().
  • Loading branch information
andrey-utkin committed Feb 27, 2024
1 parent 31fdffc commit 02ac532
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion www/ajax/discoverCameras.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function postData()
);

$tools = Array(
"node /usr/share/bluecherry/onvif/discovery_json/node-onvif.js",
"NODE_PATH=/usr/share/nodejs/onvif/node_modules node /usr/share/bluecherry/onvif/discovery_json/node-onvif.js",
"/usr/share/bluecherry/onvif/discovery_json/onvif_tool",
);
foreach ($tools as $tool) {
Expand Down

0 comments on commit 02ac532

Please sign in to comment.