Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

bug: install.sh ignores XDG_CONFIG_HOME for the local gateway config

未关闭 适合新手
#4,042 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
88/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
shell
领域
devops

调研方向

从 install.sh 开始,检查当前使用本地网关配置目录的就绪检查和清理路径。运行 mise run test:install-sh,覆盖 XDG_CONFIG_HOME 未设置、为空、已设置以及设置为包含空格的值的情况。当安装程序和 CLI 使用同一目录、所列出的重新安装场景以退出码 0 退出,并且验收检查通过时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

area:cli os:linux os:macos state:validated
User Story

As someone whose shell exports XDG_CONFIG_HOME,
I want install.sh to use the same config directory as the openshell CLI,
so that installing and reinstalling OpenShell just work.

Problem Statement

The CLI keeps each gateway's entry and client certificates under $XDG_CONFIG_HOME/openshell when that variable is set. The installer always uses ~/.config/openshell instead, in two places:

  • The readiness check, which connects to the gateway with the client certificates it expects to find there.
  • The cleanup that removes an old openshell entry before adding it again.

With the variable set, the installer and the CLI look in different directories.

Impact / Why This Matters

With XDG_CONFIG_HOME pointing somewhere other than ~/.config:

  • On macOS, the install fails whenever ~/.config/openshell has no client certificates for the gateway, or has old ones. The installer waits 30s and exits 1.
  • On macOS and Linux, running the installer a second time exits 1 with "Gateway 'openshell' already exists". When the gateway is already registered, the installer removes the entry and adds it again. But it removes it from ~/.config/openshell, and the CLI's entry is under $XDG_CONFIG_HOME/openshell. That entry is still there, so adding it again fails.

The gateway itself keeps running in both cases. On Linux the first run works only because the gateway service also writes a copy of its client certificates to ~/.config/openshell when it starts, so the readiness check happens to find current ones there.

The workarounds don't really work. Unsetting XDG_CONFIG_HOME just for the install puts the gateway entry under ~/.config, so the CLI in your normal shell can't find it afterwards. Running openshell gateway remove openshell before a reinstall avoids the "already exists" error, but not the certificate check on macOS. And nothing in the installer's output mentions the variable.

Acceptance Criteria

With XDG_CONFIG_HOME set and XDG_STATE_HOME unset:

  • The installer exits 0 when ~/.config/openshell has no client certificates for the gateway, and when it has old ones.
  • After the install, openshell status in the same shell shows the gateway.
  • Running the installer a second time exits 0.

In general:

  • With XDG_CONFIG_HOME unset or empty, the installer keeps using ~/.config/openshell.
  • mise run test:install-sh covers unset, empty, set, and set-with-spaces values.

With both XDG_CONFIG_HOME and XDG_STATE_HOME set, the Linux install fails for a different reason, that maybe is not as important, and not described in this issue.

Reproduction Steps
  1. export XDG_CONFIG_HOME="$(mktemp -d)", and make sure ~/.config/openshell/gateways/openshell doesn't exist.
  2. Run curl -LsSf https://raw.githubusercontent.com/NVIDIA/OpenShell/main/install.sh | sh.
  3. On macOS it waits 30s, prints mTLS client bundle is not ready under ~/.config/..., and exits 1. On Linux it succeeds.
  4. Run it again. Both platforms stop with Gateway 'openshell' already exists.
Environment
  • OpenShell 0.1.2, installer from main at 9cb72baa2. The installer code involved is the same on current main.
  • macOS 26.2 arm64, Homebrew 7.0.7, run as the logged-in user
  • Ubuntu 26.04 x86_64, deb package, run as root, Docker 29.1.3
Logs
# macOS, no certificates under ~/.config
mTLS client bundle is not ready under ~/.config/openshell/gateways/openshell/mtls
openshell: error: local gateway listener did not become reachable at https://localhost:17670/ within 30s

# macOS, old certificates under ~/.config
curl: (60) SSL certificate problem: unable to get local issuer certificate

# macOS and Linux, second run
openshell: local gateway already exists; removing and re-adding it...
Error:   × Gateway 'openshell' already exists.
主要语言
Rust
星标
13.2k
派生
1.6k
平均合并
1 天 21 小时
30 天内合并 PR
346

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NVIDIA/OpenShell 的其他 Issue

查看 NVIDIA/OpenShell 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。