Skip to content

Add SSH tunnel for Postgres connections - #16

Merged
pavi2410 merged 1 commit into
mainfrom
feat/ssh-tunnel
Aug 19, 2026
Merged

Add SSH tunnel for Postgres connections#16
pavi2410 merged 1 commit into
mainfrom
feat/ssh-tunnel

Conversation

@pavi2410

Copy link
Copy Markdown
Owner

Summary

  • Add a one-hop SSH tunnel (bastion) so Postgres can reach private hosts via russh, with key file or ssh-agent and strict ~/.ssh/known_hosts.
  • Persist an optional [ssh] table on connection files and expose the same fields in the Postgres wizard.
  • Keep saved host/port as the address seen from the bastion; rewrite to 127.0.0.1 only at connect/test time.

Test plan

  • Create a Postgres connection with SSH tunnel on: bastion host/user, optional key path (empty → agent), Test then Connect.
  • Confirm ~/.ssh/known_hosts is required (unknown host fails with an SSH error, not “cannot reach database”).
  • Save the connection; reopen the file and confirm [ssh] is written and secrets stay in .env.
  • Edit SSH fields on a live connection and confirm it reconnects.
  • Verify CA / Verify Full through SSH is rejected with the hostname-verify message; Require still works.

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
based 357bdca Commit Preview URL

Branch Preview URL
Aug 19 2026, 05:46 AM

@pavi2410
pavi2410 marked this pull request as ready for review August 19, 2026 05:51
@pavi2410
pavi2410 merged commit 0d388d6 into main Aug 19, 2026
2 checks passed
@pavi2410
pavi2410 deleted the feat/ssh-tunnel branch August 19, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant