Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .tabularium
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"mongodb",
"mongodb+srv"
],
"socks5_proxy": true,
"identifier_quote": "`",
"alter_primary_key": false
},
Expand Down
58 changes: 52 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
mongodb = "3"
mongodb = { version = "3", features = ["socks5-proxy"] }
bson = "2"
tokio = { version = "1", features = ["rt", "rt-multi-thread"] }
futures = "0.3"
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ This plugin enables Tabularis to connect to any MongoDB instance and provides co

- [Features](#features)
- [Connection Configuration](#connection-configuration)
- [SSH tunnels](#ssh-tunnels)
- [Supported MongoDB Data Types](#supported-mongodb-data-types)
- [Installation](#installation)
- [Automatic (via Tabularis)](#automatic-via-tabularis)
Expand Down Expand Up @@ -67,6 +68,15 @@ The selected database can be supplied by the request `schema`, by the connection

Sending `connection_uri` requires the Tabularis host support introduced by [TabularisDB/tabularis#495](https://github.com/TabularisDB/tabularis/pull/495). Older Tabularis versions can continue to use the legacy connection fields.

### SSH tunnels

The manifest declares the `socks5_proxy` capability, so when SSH is enabled for a connection, Tabularis opens a SOCKS5 proxy over the SSH connection and passes it to the plugin as `socks5_proxy_host` and `socks5_proxy_port`, plus `socks5_proxy_username` and `socks5_proxy_password` when the proxy requires authentication. The plugin adds these to the URI as `proxyHost`, `proxyPort`, `proxyUsername` and `proxyPassword`. Every node the driver connects to, including replica-set members it discovers, then goes through the tunnel, and the SSH server resolves node hostnames. This requires a Tabularis version with SOCKS5 tunnel support ([TabularisDB/tabularis#1449](https://github.com/TabularisDB/tabularis/issues/1449)).

Limitations:

- **SRV and TXT lookups stay local.** For `mongodb+srv://`, the driver resolves the SRV and TXT records with the local DNS resolver before it connects. If those records are only published inside the private network, discovery fails; use a `mongodb://` seed list instead.
- **Proxy options in the URI conflict with SSH.** If the URI already sets `proxyHost`, `proxyPort`, `proxyUsername` or `proxyPassword` while SSH is enabled, the connection fails with an error instead of bypassing the tunnel. Remove the proxy options or disable SSH.

## Supported MongoDB Data Types

| Category | Types |
Expand Down
Loading