Closed abmusse closed 3 years ago
@abmusse Thank you for the information on itoolkit-utils. We will take a look at the possibility of SSH transport support.
We have reviewed the Node.js implementation for ideas. We will work on the PHP implementation of the SSH transport.
I have a private branch for this, but the ssh2 extension API is either deficient or defective; it handles stdio from the remote process very poorly. Plea of desperation to follow.
My quest of debugging ssh2 has determined:
libssh2_channel_send_eof
at all. The code in stream close when the refcount approaches zero is supposed to do this, but it calls get EOF instead, and if we could just send EOF, we can keep the stdout stream open. (Keeping the stderr stream open keeps the refcount on stdio, meaning closing it doesn't decrement the refcount to zero...)Hit enter too soon. What that basically means is we'd probably have to fix PECL ssh2 and make that new version the minimum for an SSH transport. The alternative is to use Net_SSH which is all managed PHP, but I'm not sure of the quality of that, and it's a PEAR-level dependency we'd have to worry about when the toolkit currently has none.
For this to use PECL SSH2, it blocks on php/pecl-networking-ssh2#45.
Upstream extension actually merged it! We just need to wait for them to cut a release, but it is possible to start working on it knowing that it'll be able to be used soon. Just have to check for ssh2_send_eof
.
Nice!
Currently the nodejs-itoolkit and python-itoolkit support SSH as a transport. These toolkits establish an ssh connection and call the
xmlservice-cli
program via ssh.xmlservice-cli
is provided by theitoolkit-utils
package.At first glance we could probaly make use of https://www.php.net/manual/en/function.ssh2-exec.php to call
xmlservice-cli
.Thoughts on adding an ssh transport?