Skip to content

install 幂等化:已配置直接加载,小白可整段重复粘贴 - #2

Merged
buyi06 merged 1 commit into
mainfrom
feat/idempotent-install
Aug 27, 2026
Merged

buyi06 merged 1 commit into
mainfrom
feat/idempotent-install

Conversation

@buyi06

@buyi06 buyi06 commented Aug 27, 2026

Copy link
Copy Markdown
Owner

真实用户反馈:已装过再次执行 install 直接报错退出,对小白不友好。

改动

  • install 检测到已有配置(单元文件/元数据/配置目录任一)→ 直接加载:显示现有域名、UUID、协议;服务未运行自动 enable --now 拉起;输出客户端配置与连接命令
  • 仅残缺状态(有目录但缺 systemd 单元或缺元数据)才引导 uninstall 重装
  • README/docs 安装命令改为可整段重复粘贴的 4 行:git clone ... 2>/dev/null || true + cd + git pull --ff-only + install,目录已存在/已装过都不再报错卡人
  • FAQ 新增"重复执行 install 会怎样?"

验证

本地 69/69 测试通过(新增幂等加载断言),bash -n 通过。

- 检测到已有配置时显示现有域名/UUID/协议,服务未运行自动拉起,直接输出连接命令
- 仅残缺配置(缺 systemd 单元或元数据)才提示 uninstall 后重装
- README/docs 换成可整段重复粘贴的命令:clone 失败不中断 + git pull 更新
- FAQ 新增"重复执行 install 会怎样";测试 68 -> 69 项
@buyi06
buyi06 merged commit 0837ae3 into main Aug 27, 2026
1 check passed
@buyi06
buyi06 deleted the feat/idempotent-install branch August 27, 2026 01:21

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4f84eec0d6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread README.md

```bash
git clone https://github.com/buyi06/cf-ssh-tunnel-kit.git
git clone https://github.com/buyi06/cf-ssh-tunnel-kit.git 2>/dev/null || true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Stop masking failed clones in the paste block

When git clone fails for any reason other than the directory already existing, such as a transient network error or missing git, this || true suppresses the real failure and the pasted block continues; if cd cf-ssh-tunnel-kit then fails, the following git pull/sudo bash scripts/... run from the caller's current directory. For the advertised repeat-paste install flow, guard only the already-cloned case and stop on clone/cd failures, e.g. test for the directory before cloning and use cd cf-ssh-tunnel-kit || exit.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant