【发布时间】:2014-11-09 04:25:55
【问题描述】:
一些扩展 GitHub Enterprise 的服务需要足够新的版本。但是作为 GH:E 的标准用户,我如何在不打扰管理员的情况下确定我的公司安装了哪个版本?
【问题讨论】:
一些扩展 GitHub Enterprise 的服务需要足够新的版本。但是作为 GH:E 的标准用户,我如何在不打扰管理员的情况下确定我的公司安装了哪个版本?
【问题讨论】:
作为 GHE 管理员,我认为版本不会显示给非管理员用户,即使在 API 元信息或页面源等中也是如此。
但是,对于管理员,它显示在每个页面顶部的条形图中。因此,如果您确实询问他们,如果他们已登录,他们就会在屏幕上随时查看该信息。
【讨论】:
我正在为我们的 github 企业版搜索相同的信息。 在页面源中,我发现了以下内容:
<a href="/">
<span class="octicon-mark-github" title="GitHub Enterprise Version 11.10.xxx"></span>
</a>
这是 GitHub Enterprise 页脚中的 GitHub Octocat 徽标 - 只需将鼠标悬停在其上即可获得带有版本号的工具提示。
【讨论】:
$ curl -sS https://github.corp/login | grep enterprise/2... -o 返回enterprise/2.10
<a href="https://github.dns.ad.zopa.com" aria-label="Homepage" class="site-footer-mark" title="GitHub Enterprise Version 2.11.4">...</a>
我意识到这不是非常用户友好,但即使没有登录,任何用户都可以使用它。
从 Github Enterprise v2.12 开始,您可以从服务的/meta API endpoint 获取 GitHub Enterprise 版本。返回的 JSON 将包含一个包含版本号的 installed_version 字段。
https://ghe.company.com/api/v3/meta
{
"verifiable_password_authentication": true,
"installed_version": "2.20.0"
}
如果连接到api.github.com,则从 GitHub 的 /meta API endpoint 返回的 JSON 将包含其他附加字段,但不会包含 installed_version 字段。
https://api.github.com/meta
{
"verifiable_password_authentication": true,
"ssh_key_fingerprints": { ... },
"hooks": [ ... ],
"web": [ ... ],
"api": [ ... ],
"git": [ ... ],
"pages": [ ... ],
"importer": [ ... ]
}
【讨论】: