lymperis-e / qgis_remote_db_plugin

A QGIS plugin to open SSH connections to remote database servers
https://plugins.qgis.org/plugins/remote_db/
GNU General Public License v3.0
4 stars 1 forks source link

Could you please ENABLE definition of remote bind address which now is hadcoded? #3

Closed czeslawberger closed 8 months ago

czeslawberger commented 11 months ago

Hello @lymperis-e, thanks for your plugin. I came to the conclusion that it would be extremely useful if a definition of 'remote bind address' would be enabled to edition. Now plugin helps forward only ports from the remote host to the local one avoiding situations when on the remote host (which I access via ssh user) there is a PRIVATE database... Private means here that it is not accessible as 127.0.0.1 but some other local (from the perspective of a remote host) address (i.e. IP).

https://github.com/lymperis-e/qgis_remote_db_plugin/blob/d38029f67a3678ce0503c0af74432ec30ea84312/core/Connection.py#L38C13-L38C65

    def _get_server(self):
        tunnel_server = SSHTunnelForwarder(
            self.host,
            ssh_password=self.password,
            ssh_username=self.user,
            remote_bind_address=('127.0.0.1', self.remote_port),
            local_bind_address=('0.0.0.0',self.local_port),
            ssh_port=self.ssh_port
        )
        return tunnel_server
lymperis-e commented 8 months ago

@czeslawberger thank you for noting this, and I apologise for responding so late. I recall having some issues using anything other than 127.0.0.1 as the remote bind address, but I will check it again.

Hopefully I 'll implement this within the week

lymperis-e commented 8 months ago

Fixed in 8d239ea