Skip to content

Commit a6e7051

Browse files
author
gitlayzer
committed
feat: harden target tunnels and release readiness
1 parent a290cbf commit a6e7051

33 files changed

Lines changed: 1140 additions & 241 deletions

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,12 @@ sealtun expose 3000
190190
# 也可以把公网 HTTPS 入口转发到当前机器可访问的 HTTP upstream
191191
sealtun expose --target http://10.0.0.12:8080
192192

193+
# 私有 HTTPS upstream 使用自签名证书时,显式关闭 upstream 证书校验
194+
sealtun expose --target https://10.0.0.12:8443 --target-insecure-skip-verify
195+
193196
```
194197

195-
`--target` 只适用于默认 HTTPS 隧道,目标必须是运行 Sealtun CLI 的机器可访问的 `http://``https://` 地址;SSH/TCP 四层隧道仍使用本地端口和 NodePort 模型。
198+
`--target` 只适用于默认 HTTPS 隧道,目标必须是运行 Sealtun CLI 的机器可访问的 `http://``https://` 地址;SSH/TCP 四层隧道仍使用本地端口和 NodePort 模型。`--target-insecure-skip-verify` 只影响 Sealtun 客户端到 HTTPS upstream 的证书校验,默认关闭,仅建议用于私有网络内的自签名证书 upstream。
196199

197200
为公网业务流量启用 Basic Auth:
198201
```bash
@@ -523,6 +526,17 @@ tunnels:
523526
protocol: https
524527
```
525528

529+
私有 HTTPS upstream 使用自签名证书时:
530+
```yaml
531+
version: v1
532+
tunnels:
533+
- name: upstream-api
534+
target: https://10.0.0.12:8443
535+
protocol: https
536+
targetTls:
537+
insecureSkipVerify: true
538+
```
539+
526540
应用配置:
527541
```bash
528542
# 离线校验和预览,不需要登录
@@ -563,7 +577,7 @@ basicAuth:
563577
passwordEnv: SEALTUN_BASIC_AUTH_PASSWORD
564578
```
565579

566-
`name` 会作为稳定 tunnel ID 使用,因此重复执行 `apply` 会更新同一个 `sealtun-<name>` 资源。`tunnels` 支持一次声明多条隧道;`target` 只支持 HTTPS 隧道,目标必须是 `http://` 或 `https://` URL,如果同时写 `localPort`,端口必须和 `target` 端口一致。`ttl` 会写入本地 session 的 `expiresAt`,本地 daemon 发现过期后会自动删除远端资源和本地记录。自定义域名仍然遵循 CNAME 先验证再绑定的规则;新隧道如果 CNAME 未就绪,`apply` 会先保留 Sealos 官方域名并输出后续 `domain set` 指令;已有隧道则会拒绝未验证的自定义域名变更,避免误清理或覆盖正在使用的域名配置。
580+
`name` 会作为稳定 tunnel ID 使用,因此重复执行 `apply` 会更新同一个 `sealtun-<name>` 资源。`tunnels` 支持一次声明多条隧道;`target` 只支持 HTTPS 隧道,目标必须是 `http://` 或 `https://` URL,如果同时写 `localPort`,端口必须和 `target` 端口一致。`targetTls.insecureSkipVerify` 仅适用于 `https://` target,用于私有 upstream 自签名证书场景。`ttl` 会写入本地 session 的 `expiresAt`,本地 daemon 发现过期后会自动删除远端资源和本地记录。自定义域名仍然遵循 CNAME 先验证再绑定的规则;新隧道如果 CNAME 未就绪,`apply` 会先保留 Sealos 官方域名并输出后续 `domain set` 指令;已有隧道则会拒绝未验证的自定义域名变更,避免误清理或覆盖正在使用的域名配置。
567581

568582
## 📄 许可证
569583

README_EN.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,12 @@ sealtun expose 3000
190190
# Or forward the public HTTPS entry to an HTTP upstream reachable from this machine
191191
sealtun expose --target http://10.0.0.12:8080
192192

193+
# Private HTTPS upstreams with self-signed certificates can explicitly skip upstream certificate verification
194+
sealtun expose --target https://10.0.0.12:8443 --target-insecure-skip-verify
195+
193196
```
194197

195-
`--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.
198+
`--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.
196199

197200
Enable Basic Auth for public application traffic:
198201
```bash
@@ -523,6 +526,17 @@ tunnels:
523526
protocol: https
524527
```
525528

529+
For a private HTTPS upstream with a self-signed certificate:
530+
```yaml
531+
version: v1
532+
tunnels:
533+
- name: upstream-api
534+
target: https://10.0.0.12:8443
535+
protocol: https
536+
targetTls:
537+
insecureSkipVerify: true
538+
```
539+
526540
Apply it:
527541
```bash
528542
# Offline validation and preview; no login required
@@ -563,7 +577,7 @@ basicAuth:
563577
passwordEnv: SEALTUN_BASIC_AUTH_PASSWORD
564578
```
565579

566-
`name` is used as the stable tunnel ID, so repeated `apply` runs update the same `sealtun-<name>` resources. `tunnels` can declare multiple tunnels in one file. `target` is HTTPS-only and must be a `http://` or `https://` URL; if `localPort` is also set, it must match the target port. `ttl` is persisted as `expiresAt` in the local session; the local daemon automatically removes expired remote resources and session records. Custom domains still require verified CNAME ownership before attachment; for a new tunnel, `apply` keeps the Sealos-managed host and prints the follow-up `domain set` command when DNS is not ready. For an existing tunnel, `apply` rejects unverified custom-domain changes so it does not accidentally clear or overwrite a working domain configuration.
580+
`name` is used as the stable tunnel ID, so repeated `apply` runs update the same `sealtun-<name>` resources. `tunnels` can declare multiple tunnels in one file. `target` is HTTPS-only and must be a `http://` or `https://` URL; if `localPort` is also set, it must match the target port. `targetTls.insecureSkipVerify` applies only to `https://` targets and is intended for private upstreams with self-signed certificates. `ttl` is persisted as `expiresAt` in the local session; the local daemon automatically removes expired remote resources and session records. Custom domains still require verified CNAME ownership before attachment; for a new tunnel, `apply` keeps the Sealos-managed host and prints the follow-up `domain set` command when DNS is not ready. For an existing tunnel, `apply` rejects unverified custom-domain changes so it does not accidentally clear or overwrite a working domain configuration.
567581

568582
## License
569583

0 commit comments

Comments
 (0)