Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] SSH tunnel support #205

Closed
mhammerly opened this issue Jun 7, 2024 · 10 comments · Fixed by #246 or #249
Closed

[FEATURE] SSH tunnel support #205

mhammerly opened this issue Jun 7, 2024 · 10 comments · Fixed by #246 or #249
Assignees
Labels
kind/enhancement New feature or request

Comments

@mhammerly
Copy link

Most databases I want to connect to are only reachable with an SSH tunnel through a bastion server. Some database clients (DBeaver, DataGrip, pgcli off the top of my head) support setting up tunnels in their config and it'd be nice if dblab did as well.

@mhammerly mhammerly added the kind/enhancement New feature or request label Jun 7, 2024
@drakythe
Copy link

drakythe commented Jun 7, 2024

+1 to this. I make use of SequelAce usually but I'd love to have DBLab as an alternative for when I'm in a terminal scenario and don't have a GUI. I was just reviewing all the docs to see if this was supported and can't find any mention of "proxy" "tunnel" or "ssh".

@danvergara danvergara self-assigned this Jun 7, 2024
@danvergara
Copy link
Owner

@mhammerly Thanks for bringing this to my attention. Can't promise to work on this right away, because I have other issues with higher priority, but I've been doing my best to address users' requests lately.

@mhammerly
Copy link
Author

whenever you get around to it (if you can at all), thanks! just made an issue to give myself and others a place to subscribe

dblab looks cool, may write a little wrapper script so i can try it out in the meantime!

@janpieper
Copy link

Really looking forward to have SSH tunneling built in 👍

I am not a golang developer, but I could have a look into this. Would only need to know if there is a good package for it 😉

@grindarius
Copy link

DBLAB looks really cool. I am really looking forward to have this built in as well 👍🏽

@hsanson
Copy link

hsanson commented Jul 5, 2024

This library should make it easy to add SSH tunneling to DB connections:

@danvergara danvergara mentioned this issue Dec 17, 2024
9 tasks
@danvergara
Copy link
Owner

danvergara commented Jan 4, 2025

Guys, there's a new PR addressing this issue. Please, check it out and let me know if that satisfies your requirements. Sorry if it took so long to arrive.

@mhammerly
Copy link
Author

mhammerly commented Jan 6, 2025

@danvergara thank you!

i'm able to connect to my database with this feature using the command below and it populates the list of tables, but if i try to run a query or select a table the results window shows an error: read tcp 10.1.1.1:49332->10.2.2.2:22: use of closed network connection

dblab \
    --host <redacted> --port 5432 --driver postgres --db postgres --user matt --pass '<redacted>' \
    --ssh-host <redacted> --ssh-user matt --ssh-port 22

i don't know golang but from a quick skim of the PR it looks like the SSH connection may be allowed to close after initial startup? https://github.com/danvergara/dblab/pull/246/files#r1904690197

@danvergara
Copy link
Owner

@danvergara thank you!

i'm able to connect to my database with this feature using the command below and it populates the list of tables, but if i try to run a query or select a table the results window shows an error: read tcp 10.1.1.1:49332->10.2.2.2:22: use of closed network connection

dblab \
    --host <redacted> --port 5432 --driver postgres --db postgres --user matt --pass '<redacted>' \
    --ssh-host <redacted> --ssh-user matt --ssh-port 22

i don't know golang but from a quick skim of the PR it looks like the SSH connection may be allowed to close after initial startup? https://github.com/danvergara/dblab/pull/246/files#r1904690197

Thanks @mhammerly for bringing this to my attention. I put out a new PR to address this issue.
Please, check it out.

@danvergara
Copy link
Owner

@mhammerly just merged #249 and released v0.30.1 fixing the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
6 participants