|
1 | 1 | ## Datum Tunnels |
2 | 2 |
|
3 | | -This repo is broken into 3 components, a CLI, GUI app, and shared-core library that the CLI & GUI draw on. |
| 3 | +CLI, GUI app, and shared library for exposing local environments to the internet. |
4 | 4 |
|
5 | | -### Download the app |
6 | | -[](https://github.com/datum-cloud/datum-connect/releases/latest/download/Datum.dmg) |
7 | | -[](https://github.com/datum-cloud/datum-connect/releases/latest/download/Datum-setup.exe) |
8 | | -[](https://github.com/datum-cloud/datum-connect/releases/latest/download/Datum.AppImage) |
9 | | - |
10 | | -If a download fails, use the latest release page: https://github.com/datum-cloud/datum-connect/releases/latest |
11 | | - |
12 | | - |
13 | | -### Required Tools |
14 | | -* For all three crates: [`rust & cargo`](https://rust-lang.org/tools/install/) |
15 | | -* For UI: [`dioxus`](https://dioxuslabs.com/learn/0.6/getting_started/) |
16 | | - * specifically, install `dx` with `cargo install dioxus-cli` |
17 | | - * if you have [`binstall`](https://github.com/cargo-bins/cargo-binstall?tab=readme-ov-file#installation), you can skip compiling `dx` from source by running `cargo binstall dioxus-cli` |
18 | | - |
19 | | -### Running CLI commands: |
20 | | -to run without compiling, use `cargo run` in the `cli` directory: |
21 | | - |
22 | | -``` |
23 | | -cd cli |
24 | | -cargo run -- --help |
25 | | -``` |
26 | | - |
27 | | -### Local forward-proxy demo (no GUI) |
28 | | -This exercises the CONNECT-based gateway flow that Envoy will use in staging/prod. |
29 | | - |
30 | | -#### 1) Start a local DNS dev server (out-of-band) |
31 | | -Use a non-`.local` origin (e.g. `datumconnect.test`): |
32 | | - |
33 | | -``` |
34 | | -cargo run -p datum-connect -- dns-dev serve \ |
35 | | - --origin datumconnect.test \ |
36 | | - --bind 127.0.0.1:53535 \ |
37 | | - --data ./dns-dev.yml |
38 | | -``` |
39 | | - |
40 | | -#### 2) Start the listen node (connector side) |
41 | | -This prints the endpoint id and the iroh UDP bound sockets you must publish: |
42 | | - |
43 | | -``` |
44 | | -cargo run -p datum-connect -- serve |
45 | | -``` |
| 5 | +### Download |
46 | 6 |
|
47 | | -Copy the printed `dns-dev upsert` example, but run it via `cargo run -p datum-connect -- ...` |
48 | | -and make sure the origin matches `datumconnect.test`. Quote IPv6 addresses like `"[::]:1234"`. |
| 7 | +**macOS (Homebrew):** |
49 | 8 |
|
50 | | -#### 3) Verify TXT resolution |
51 | | -The `serve` command prints the z-base-32 ID and the full DNS name. Query it with: |
52 | | - |
53 | | -``` |
54 | | -dig +norecurse @127.0.0.1 -p 53535 TXT _iroh.<z32>.datumconnect.test |
| 9 | +```bash |
| 10 | +brew install datum-cloud/tap/desktop |
55 | 11 | ``` |
56 | 12 |
|
57 | | -#### 4) Start the gateway in forward mode |
| 13 | +**Direct download:** |
58 | 14 |
|
59 | | -``` |
60 | | -cargo run -p datum-connect -- gateway \ |
61 | | - --port 8080 \ |
62 | | - --metrics-addr 127.0.0.1 \ |
63 | | - --metrics-port 9090 \ |
64 | | - --mode forward \ |
65 | | - --discovery dns \ |
66 | | - --dns-origin datumconnect.test \ |
67 | | - --dns-resolver 127.0.0.1:53535 |
68 | | -
|
69 | | -Discovery modes: |
70 | | -- `default`: iroh defaults (n0 preset). |
71 | | -- `dns`: only the provided DNS origin/resolver. |
72 | | -- `hybrid`: default + custom DNS. |
73 | | -- metrics endpoint: `GET http://127.0.0.1:9090/metrics` (when `--metrics-addr` or `--metrics-port` is set) |
74 | | -``` |
75 | | - |
76 | | -#### 5) Send a CONNECT request |
77 | | -If your target TCP service is on `127.0.0.1:5173`: |
78 | | - |
79 | | -``` |
80 | | -curl --proxytunnel -x 127.0.0.1:8080 \ |
81 | | - --proxy-header "x-iroh-endpoint-id: REPLACE_WITH_ENDPOINT_ID" \ |
82 | | - "http://127.0.0.1:5173" |
83 | | -``` |
84 | | - |
85 | | -### GUI demo (browser tunnel) |
86 | | -This mirrors the same flow, but uses the GUI to create the proxy entry. |
| 15 | +[](https://github.com/datum-cloud/datum-connect/releases/latest/download/Datum.dmg) |
| 16 | +[](https://github.com/datum-cloud/datum-connect/releases/latest/download/Datum-setup.exe) |
| 17 | +[](https://github.com/datum-cloud/datum-connect/releases/latest/download/Datum.AppImage) |
87 | 18 |
|
88 | | -If you want a one-shot experience, run: |
| 19 | +[Latest release →](https://github.com/datum-cloud/datum-connect/releases/latest) |
89 | 20 |
|
90 | | -``` |
91 | | -./scripts/try-ui-demo.sh |
92 | | -``` |
| 21 | +### Development |
93 | 22 |
|
94 | | -It starts dns-dev, an HTTPS origin, the gateway, and the GUI, and waits for you to |
95 | | -create a TCP proxy in the UI before visiting `https://localhost:5173` in the browser. |
| 23 | +**Requirements:** [Rust](https://rust-lang.org/tools/install/), [Dioxus CLI](https://dioxuslabs.com/learn/0.6/getting_started/) (`cargo install dioxus-cli` or `cargo binstall dioxus-cli`) |
96 | 24 |
|
97 | | -#### 1) Start `dns-dev` |
98 | | -``` |
99 | | -cargo run -p datum-connect -- dns-dev serve \ |
100 | | - --origin datumconnect.test \ |
101 | | - --bind 127.0.0.1:53535 \ |
102 | | - --data ./dns-dev.yml |
103 | | -``` |
| 25 | +**Run the GUI:** |
104 | 26 |
|
105 | | -#### 2) Start a local HTTPS origin (so the browser uses CONNECT) |
106 | | -``` |
107 | | -openssl req -x509 -nodes -newkey rsa:2048 -days 1 \ |
108 | | - -keyout /tmp/iroh-dev.key -out /tmp/iroh-dev.crt \ |
109 | | - -subj "/CN=localhost" |
110 | | -openssl s_server -accept 5173 -cert /tmp/iroh-dev.crt -key /tmp/iroh-dev.key -www |
111 | | -``` |
112 | | - |
113 | | -#### 3) Run the GUI (share the repo with CLI) |
114 | | -``` |
115 | | -export DATUM_CONNECT_REPO=$(pwd)/.datum-connect-dev |
| 27 | +```bash |
116 | 28 | cd ui |
117 | 29 | dx serve --platform desktop |
118 | 30 | ``` |
119 | 31 |
|
120 | | -#### 4) Create a proxy in the GUI |
121 | | -Add a TCP proxy for `127.0.0.1:5173`. |
122 | | - |
123 | | -#### 5) Start the listen node (uses the same repo) |
124 | | -``` |
125 | | -cd .. |
126 | | -export DATUM_CONNECT_REPO=$(pwd)/.datum-connect-dev |
127 | | -cargo run -p datum-connect -- serve |
128 | | -``` |
129 | | -Copy the printed `dns-dev upsert` example, but change the origin to `datumconnect.test` |
130 | | -and run it via `cargo run -p datum-connect -- ...` (quote IPv6 addresses). |
| 32 | +**Run the CLI:** |
131 | 33 |
|
132 | | -#### 6) Start the gateway in forward mode |
133 | | -``` |
134 | | -export DATUM_CONNECT_REPO=$(pwd)/.datum-connect-dev |
135 | | -cargo run -p datum-connect -- gateway \ |
136 | | - --port 8080 \ |
137 | | - --metrics-addr 127.0.0.1 \ |
138 | | - --metrics-port 9090 \ |
139 | | - --mode forward \ |
140 | | - --discovery dns \ |
141 | | - --dns-origin datumconnect.test \ |
142 | | - --dns-resolver 127.0.0.1:53535 |
143 | | -``` |
144 | | - |
145 | | -#### 7) Start a local entrypoint that always tunnels through the gateway |
146 | | -This avoids any browser proxy configuration. It listens on `127.0.0.1:8888` and |
147 | | -uses CONNECT under the hood to reach the target: |
148 | | -``` |
149 | | -cargo run -p datum-connect -- tunnel-dev \ |
150 | | - --gateway 127.0.0.1:8080 \ |
151 | | - --node-id REPLACE_WITH_ENDPOINT_ID \ |
152 | | - --target-host 127.0.0.1 \ |
153 | | - --target-port 5173 |
154 | | -``` |
155 | | -Now visit: |
156 | | -``` |
157 | | -https://localhost:8888 |
158 | | -``` |
159 | | -You should see the `openssl s_server` status page (cipher list + handshake info). |
160 | | -That output is expected and means the CONNECT request tunneled through the gateway |
161 | | -to the local origin. |
162 | | - |
163 | | -### Running the UI: |
164 | | - |
165 | | -to run the UI, make sure you have rust, cargo, and dioxus installed: |
166 | | - |
167 | | -``` |
168 | | -cd ui |
169 | | -dx serve |
| 34 | +```bash |
| 35 | +cd cli |
| 36 | +cargo run -- --help |
170 | 37 | ``` |
0 commit comments