psequel
psequel copied to clipboard
Add SSH Tunneling Support for Database Connections
Background
Currently, our database client lacks SSH tunneling capabilities, which is essential for securely accessing remote databases that aren't directly accessible over the internet. Many production databases are only accessible from within private networks, requiring SSH tunneling as a secure method to establish connections.
Problem
Users cannot connect to databases that:
- Are behind firewalls allowing only SSH access
- Require connecting through bastion/jump hosts
- Are in private networks with restricted direct access
Proposed Solution
Implement SSH tunneling support using GIO and libssh2-vala bindings. This will allow users to:
- Create secure SSH tunnels to remote hosts
- Forward local ports to remote database ports
- Connect to databases through these tunnels
Technical Implementation
We can utilize these Vala libraries:
libssh2: Provides SSH protocol implementationGio.SocketClient: For handling network connectionsGio.TcpConnection: For managing TCP connections
Reference Projects
-
Sequeler (Database Client written in Vala):
- Has implemented SSH tunneling in Vala
- https://github.com/ellie-commons/sequeler
-
DBeaver (Java-based):
- Has robust SSH implementation
- Good reference for UX patterns
User Experience
Users should be able to configure:
- SSH host details (hostname, port)
- Authentication method (password/key-based)
- Local and remote port forwarding settings
- Save SSH configurations alongside database connections
Security Considerations
- Support for key-based authentication
- Secure storage of SSH credentials (May be ask for
.sshaccess inside flatpak is bad) - Proper tunnel shutdown on application close