Skip to content

Commit aaf2005

Browse files
author
gitlayzer
committed
feat: add guided up workflow
1 parent 3049da9 commit aaf2005

11 files changed

Lines changed: 1809 additions & 263 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
config.yaml
1919
auth.json
2020
kubeconfig
21+
.sealtun/
2122

2223
# Go
2324
vendor/

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,13 @@ sealtun init --protocol auto --json
187187
# 确认后再创建推荐隧道
188188
sealtun init --apply
189189

190+
# 日常开发推荐:自动复用当前项目隧道;没有状态时进入完整创建引导
191+
sealtun up
192+
sealtun up --guided
193+
sealtun up 3000
194+
sealtun up --target https://10.0.0.12:8443 --insecure
195+
sealtun up 3000 --rate-limit 60/m --audit
196+
190197
# 默认使用 https 协议 (兼容普通 HTTP 与 WebSocket 应用流量)
191198
sealtun expose 3000
192199

@@ -198,7 +205,7 @@ sealtun expose --target https://10.0.0.12:8443 --target-insecure-skip-verify
198205

199206
```
200207

201-
`--target` 只适用于默认 HTTPS 隧道,目标必须是运行 Sealtun CLI 的机器可访问的 `http://``https://` 地址;SSH/TCP 四层隧道仍使用本地端口和 NodePort 模型。`--target-insecure-skip-verify` 只影响 Sealtun 客户端到 HTTPS upstream 的证书校验,默认关闭,仅建议用于私有网络内的自签名证书 upstream。
208+
`sealtun up``expose` 的智能入口:它会优先复用当前目录 `.sealtun/state.json` 记录的 tunnel;没有状态且处于交互终端时,会按“登录检查 -> 选择端口 -> 选择协议 -> 是否加认证 -> 是否加限流 -> 是否加域名 -> 是否保存配置 -> 创建”的流程引导。非交互脚本或已明确端口/`--target` 时,`up` 直接调用同一套 `expose` 创建逻辑;也可以用 `--guided` 强制进入引导。`--target` 只适用于默认 HTTPS 隧道,目标必须是运行 Sealtun CLI 的机器可访问的 `http://``https://` 地址;SSH/TCP 四层隧道仍使用本地端口和 NodePort 模型。`--target-insecure-skip-verify`/`up --insecure` 只影响 Sealtun 客户端到 HTTPS upstream 的证书校验,默认关闭,仅建议用于私有网络内的自签名证书 upstream。
202209

203210
为公网业务流量启用 Basic Auth:
204211
```bash

README_EN.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,13 @@ sealtun init --protocol auto --json
187187
# Create the recommended tunnel only when you are ready
188188
sealtun init --apply
189189

190+
# Daily development shortcut: reuse the current project tunnel, or start the guided creation flow
191+
sealtun up
192+
sealtun up --guided
193+
sealtun up 3000
194+
sealtun up --target https://10.0.0.12:8443 --insecure
195+
sealtun up 3000 --rate-limit 60/m --audit
196+
190197
# Default https protocol (compatible with WebSocket)
191198
sealtun expose 3000
192199

@@ -198,7 +205,7 @@ sealtun expose --target https://10.0.0.12:8443 --target-insecure-skip-verify
198205

199206
```
200207

201-
`--target` applies only to default HTTPS tunnels. The target must be a `http://` or `https://` address reachable from the machine running the Sealtun CLI. SSH/TCP L4 tunnels continue to use the local port plus NodePort model. `--target-insecure-skip-verify` affects only the Sealtun client to HTTPS upstream TLS check, is off by default, and should be used only for private/self-signed upstreams.
208+
`sealtun up` is the smart entrypoint for `expose`: it first reuses the tunnel recorded in the current directory's `.sealtun/state.json`; without project state in an interactive terminal, it guides the user through login check, port selection, protocol, optional authentication, rate limit, domain, config save, and creation. In scripts or when a port/`--target` is already explicit, `up` directly uses the same `expose` creation engine; pass `--guided` to force the wizard. `--target` applies only to default HTTPS tunnels. The target must be a `http://` or `https://` address reachable from the machine running the Sealtun CLI. SSH/TCP L4 tunnels continue to use the local port plus NodePort model. `--target-insecure-skip-verify`/`up --insecure` affects only the Sealtun client to HTTPS upstream TLS check, is off by default, and should be used only for private/self-signed upstreams.
202209

203210
Enable Basic Auth for public application traffic:
204211
```bash

0 commit comments

Comments
 (0)