mirror of
https://github.com/vale981/rmview
synced 2025-03-06 01:31:39 -05:00
Make sshtunnel
optional
This commit is contained in:
parent
b872a37789
commit
455398faa0
3 changed files with 22 additions and 15 deletions
|
@ -42,6 +42,9 @@ The easiest installation method is by using `pip`, from the root folder of this
|
|||
|
||||
(please note the command ends with a dot)
|
||||
which will install all required dependencies and install a new `rmview` command.
|
||||
If you want to use the SSH tunnel feature, install with
|
||||
|
||||
pip install ".[tunnel]"
|
||||
|
||||
Then, from anywhere, you can execute `rmview` from the command line.
|
||||
The tool will ask for the connection parameters and then ask permission to install the VNC server on the tablet.
|
||||
|
@ -54,7 +57,8 @@ If you plan to modify the source code, use `pip install -e .` so that when execu
|
|||
Install the dependencies ([PyQt5][pyqt5], [Paramiko][paramiko], [Twisted][twisted]) with `pip` or `conda` manually:
|
||||
|
||||
# install dependencies
|
||||
pip install pyqt5 paramiko twisted sshtunnel
|
||||
pip install pyqt5 paramiko twisted
|
||||
pip install sshtunnel # optional
|
||||
# build resources file
|
||||
pyrcc5 -o src/rmview/resources.py resources.qrc
|
||||
|
||||
|
|
3
setup.py
3
setup.py
|
@ -41,7 +41,8 @@ setup(
|
|||
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
|
||||
],
|
||||
packages=['rmview'],
|
||||
install_requires=['pyqt5', 'paramiko', 'twisted', 'sshtunnel'],
|
||||
install_requires=['pyqt5', 'paramiko', 'twisted'],
|
||||
extras_require = { 'tunnel': ['sshtunnel'] },
|
||||
entry_points={
|
||||
'console_scripts':['rmview = rmview.rmview:rmViewMain']
|
||||
},
|
||||
|
|
|
@ -7,7 +7,6 @@ from PyQt5.QtCore import *
|
|||
from .rmparams import *
|
||||
|
||||
import paramiko
|
||||
import sshtunnel
|
||||
import struct
|
||||
import time
|
||||
|
||||
|
@ -85,7 +84,7 @@ class RFBFactory(RFBFactory):
|
|||
return self.instance
|
||||
|
||||
def clientConnectionLost(self, connector, reason):
|
||||
log.warning("Connection lost: %s", reason.getErrorMessage())
|
||||
log.warning("Disconnected: %s", reason.getErrorMessage())
|
||||
reactor.callFromThread(reactor.stop)
|
||||
|
||||
def clientConnectionFailed(self, connector, reason):
|
||||
|
@ -240,7 +239,6 @@ class FrameBufferWorker(QRunnable):
|
|||
if self.use_ssh_tunnel:
|
||||
tunnel = self._get_ssh_tunnel()
|
||||
tunnel.start()
|
||||
|
||||
self.sshTunnel = tunnel
|
||||
|
||||
log.info("Setting up SSH tunnel %s:%s (rm) <-> %s:%s (localhost)" % ("127.0.0.1", 5900,
|
||||
|
@ -269,6 +267,10 @@ class FrameBufferWorker(QRunnable):
|
|||
else:
|
||||
open_tunnel_kwargs["ssh_password"] = self.ssh_config["password"]
|
||||
|
||||
try:
|
||||
import sshtunnel
|
||||
except ModuleNotFoundError:
|
||||
raise Exception("You need to install `sshtunnel` to use the tunnel feature")
|
||||
tunnel = sshtunnel.open_tunnel(
|
||||
(self.ssh.hostname, 22),
|
||||
remote_bind_address=("127.0.0.1", 5900),
|
||||
|
|
Loading…
Add table
Reference in a new issue