derptun 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -152,37 +152,41 @@ npx -y derphole@latest open <token> 127.0.0.1:8080
152
152
 
153
153
  ### Durable SSH Tunnels with `derptun`
154
154
 
155
- `derptun` is the durable TCP tunnel companion to `derphole`. Use it when a host is behind NAT and you want a stable token you can reuse for days instead of a one-hour, session-scoped share token.
155
+ `derptun` is the durable TCP tunnel companion to `derphole`. Use it when `serverhost` is behind NAT and you want a stable server credential that can survive process restarts.
156
156
 
157
- On the target host:
157
+ On `serverhost`:
158
158
 
159
159
  ```bash
160
- npx -y derptun@latest token --days 7 > alpha.token
161
- npx -y derptun@latest serve --token "$(cat alpha.token)" --tcp 127.0.0.1:22
160
+ npx -y derptun@latest token server > server.dts
161
+ npx -y derptun@latest token client --token "$(cat server.dts)" > client.dtc
162
+ npx -y derptun@latest serve --token "$(cat server.dts)" --tcp 127.0.0.1:22
162
163
  ```
163
164
 
164
- On the client:
165
+ Copy only `client.dtc` to `clienthost`.
166
+
167
+ On `clienthost`:
165
168
 
166
169
  ```bash
167
- npx -y derptun@latest open --token "$(cat alpha.token)" --listen 127.0.0.1:2222
168
- ssh -p 2222 foo@127.0.0.1
170
+ npx -y derptun@latest open --token "$(cat client.dtc)" --listen 127.0.0.1:2222
171
+ ssh -p 2222 user@127.0.0.1
169
172
  ```
170
173
 
171
174
  For SSH without a separate local listener, use `ProxyCommand`:
172
175
 
173
176
  ```sshconfig
174
- Host alpha-derptun
175
- HostName alpha
177
+ Host serverhost-derptun
178
+ HostName serverhost
176
179
  User foo
177
- ProxyCommand derptun connect --token ~/.config/derptun/alpha.token --stdio
180
+ ProxyCommand derptun connect --token ~/.config/derptun/client.dtc --stdio
178
181
  ```
179
182
 
180
- `derptun` keeps trying when the network path drops, and it can reconnect while both `derptun` processes stay alive. If either process exits, the token can bring the tunnel back, but an already-open TCP session is gone. Use `tmux` or `screen` on the remote host when shell continuity matters.
183
+ The server token is secret serving authority. Keep it on the serving machine or in its secret manager. The client token can connect until it expires, but it cannot serve or mint more tokens.
181
184
 
182
- Tokens default to seven days. Set a relative lifetime with `--days`, or use an absolute expiry:
185
+ Server tokens default to 180 days. Client tokens default to 90 days and cannot outlive their server token. Set a relative lifetime with `--days`, or use an absolute expiry:
183
186
 
184
187
  ```bash
185
- npx -y derptun@latest token --expires 2026-05-01T00:00:00Z
188
+ npx -y derptun@latest token server --expires 2026-05-01T00:00:00Z > server.dts
189
+ npx -y derptun@latest token client --token "$(cat server.dts)" --expires 2026-04-25T00:00:00Z > client.dtc
186
190
  ```
187
191
 
188
192
  The first `derptun` release is TCP-only. UDP forwarding is planned for use cases like Minecraft Bedrock servers, but it is not part of this release.
@@ -268,7 +272,7 @@ In practice: move bytes early, keep them moving through relay if needed, then sh
268
272
 
269
273
  ## Security Model
270
274
 
271
- Tokens are **bearer capabilities**. Anyone with a token can claim the matching session or tunnel until it expires, so share tokens over a trusted channel. `derphole` session tokens expire after one hour. `derptun` tokens default to seven days and can be shortened or extended with `--days` or `--expires`.
275
+ Tokens are **bearer capabilities**. Anyone with a token can claim the matching session or tunnel until it expires, so share tokens over a trusted channel. `derphole` session tokens expire after one hour. `derptun` server tokens default to 180 days and can mint shorter-lived client tokens; client tokens default to 90 days and cannot serve.
272
276
 
273
277
  DERP relays do **not** get the secret material needed to read or impersonate the session:
274
278
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "derptun",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
4
4
  "license": "BSD-3-Clause",
5
5
  "bin": {
6
6
  "derptun": "bin/derptun.js"