posthog
posthog copied to clipboard
feat(data-warehouse): Added SSH tunnelling option for postgres syncs
Problem
- A common use case when connecting to a postgres db is to do so via a ssh tunnel, this stops the postgres db being exposed on the public internet
Changes
- Added UI to add a ssh tunnel when linking a postgres source
- Allows for either a username + password or a private key + passphrase to connect
- Adds backend ability to connect to the postgres db
- via
psycopg2when getting db schemas on the fly - and via
alchemyduring the DLT postgres source connection - Rejigs the
import_datatemporal activity slightly so that the ssh tunnel is open for the length of the data import
- via
SSHTunnelForwardercontexts deal with the opening and closing of the tunnel for us đ
TODO:
- One more UI element -
textareafor the private key - Backend unit tests for
SSHTunneland updatingexternal_data_jobtests - Security: restricting the port range of the ssh tunnel / postgres db
- Test using a private key and passphrase locally
Does this work well for both Cloud and self-hosted?
- Probably?
How did you test this code?
Unit tests and local testing
Size Change: 0 B
Total Size: 1.03 MB
âšī¸ View Unchanged
| Filename | Size |
|---|---|
frontend/dist/toolbar.js |
1.03 MB |
đ¸ UI snapshots have been updated
2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
chromium: 0 added, 2 modified, 0 deleted (diff for shard 2)webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
đ¸ UI snapshots have been updated
2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
chromium: 0 added, 2 modified, 0 deleted (diff for shard 2)webkit: 0 added, 0 modified, 0 deleted
Triggered by this commit.
Suspect Issues
This pull request was deployed and Sentry observed the following issues:
- âŧī¸ PipelineStepFailed: Pipeline execution failed at stage extract when processing package 1717667809.3704422 with except...
posthog.temporal.data_imports.pipelines.pipelin...View Issue - âŧī¸ PipelineStepFailed: Pipeline execution failed at stage extract when processing package 1717666575.3995636 with except...
posthog.temporal.data_imports.pipelines.pipelin...View Issue - âŧī¸ PipelineStepFailed: Pipeline execution failed at stage normalize when processing package 1717676644.8231242 with exce...
posthog.temporal.data_imports.pipelines.pipelin...View Issue - âŧī¸ OperationalError: SSL connection has been closed unexpectedly
posthog.warehouse.models.external_data_schema i...View Issue - âŧī¸ Exception: SSHTunnel auth is not valid
posthog.warehouse.models.ssh_tunnel in get_tunnelView Issue
Did you find this useful? React with a đ or đ