我们经常发布文档更新,此页面的翻译可能仍在进行中。有关最新信息,请访问英文文档。如果此页面上的翻译有问题,请告诉我们

此版本的 GitHub Enterprise 将停止服务 此版本的 GitHub Enterprise 已停止服务 2020-01-22. 即使针对重大安全问题,也不会发布补丁。 要获得更好的性能、改进的安全性和新功能,请升级到 GitHub Enterprise 的最新版本。 如需升级方面的帮助,请联系 GitHub Enterprise 支持

Installing GitHub Insights

You can install GitHub Insights and connect the standalone application to GitHub Enterprise.

Organization owners in GitHub Enterprise can install GitHub Insights.

GitHub Insights 可用于 GitHub One。 更多信息请参阅“GitHub 的产品”。

本文内容

基本要求

  • You must have a GitHub Enterprise license file that has been updated to include GitHub Insights. GitHub will provide the license file when you purchase GitHub Insights.
  • GitHub Insights requires a minimum of two machines hosted either in the cloud or locally. For more information, see "System overview for GitHub Insights."

创建 GitHub 应用程序

To connect GitHub Insights to GitHub Enterprise, you must create a GitHub 应用程序 in an organization on GitHub Enterprise. A slugged version of your app's name will be shown on GitHub Enterprise when your integration takes an action.

  1. 登录到 http(s)://HOSTNAME/login 上的 您的 GitHub Enterprise Server 实例。

  2. Navigate to the organization you'd like to connect to GitHub Insights.

  3. 在组织名称下,单击 Settings(设置)

    组织设置按钮

  4. 在左侧边栏中,单击 GitHub 应用程序

    GitHub 应用程序 设置

  5. Click New GitHub 应用程序.

    New GitHub App button

  6. Under "GitHub 应用程序 name", type a name for the app. Your app cannot have the same name as an existing user or organization, unless the name is your own user or organization name.

    GitHub App name field

  7. Under "Homepage URL", type the URL of the machine you will use as the application server for GitHub Insights. For more information, see "System overview for GitHub Insights."

    Homepage URL field

  8. Under "User authorization callback URL", type the following, replacing <application-server-url> with the URL of the machine you will use as the application server for GitHub Insights and <company-name> with the name of your company.

    <application-server-url>/public/applogin/<company-name>
    

    User authorization callback field

  9. Under "Webhook URL", type <application-server-url>/webhooks/<company-name>.

    Webhook URL field

  10. Under "Webhook secret", type a secret, then record the secret for later reference.

    Webhook secret field

  11. Under "Permissions", use the drop-down menus and configure the following permissions for the app.

    • Repository contents: Read-only
    • Repository metadata: Read-only
    • Pull requests: Read-only
    • Commit statuses: Read-only
    • Organization members: Read-only
    • Organization projects: Read-only
      Permissions drop-down menus
  12. Under "Subscribe to events", select:

    • 拉取请求
    • 推送
    • Repository
      Subscribe to events checkboxes
  13. To enable the GitHub 应用程序 to access data from any user or organization in 您的 GitHub Enterprise Server 实例, under "Where can this GitHub 应用程序 be installed?", select Any account.

    Radio buttons to enable access to any account

  14. Click Create GitHub 应用程序.

    Create GitHub App button

  15. Review your app's configuration.

  16. Under "Private keys", click Generate a private key.

    Generate a private key button

  17. Save the resulting PEM file for later reference.

  18. Make note of the following information about your app for later reference.

    • App ID
    • Client ID
    • Client secret
    • Private key
    • Webhook secret

安装 GitHub Insights

Installing GitHub Insights requires Docker. 安装脚本将安装 Docker(如果能安装)。 如果脚本无法安装 Docker,脚本将尝试使用 Docker 的现有安装。 如果主机上没有安装 Docker,安装将失败。

  1. github/insights-releases发行版页面上,找到 GitHub Insights 的最新版本。

  2. 要下载最新版本,请在“Assets(资产)”下单击 installation.tgz

    安装资产

  3. 解压缩目录。

  4. To configure the installation, run the shell script configure.sh. The script can be run from any machine that can SSH into the application and import servers and does not need to be run from either host machine.

  5. Enter the same URL you used for the application server when creating the GitHub 应用程序.

  6. Enter the SSH user for connecting to the application server.

  7. Enter the URL for the machine you will use as the import server for GitHub Insights. For more information, see "System overview for GitHub Insights."

  8. Enter the SSH user for connecting to the import server.

  9. Enter the path to the PEM key for SSH authentication with the application server.

  10. If you want to use a different PEM key for SSH authentication to the import server, enter the path to the PEM key. Otherwise, leave blank.

  11. If using a bastion host, enter the path to the public key (.pub). Otherwise, leave blank.

  12. To enable SSL, enter the SSL Cert (.crt). If you don't want to enable SSL, leave blank.

  13. If you chose to enable SSL, enter the SSL Key (.key). Otherwise, leave blank.

  14. If using a bastion host, enter the user and URL in the form of user@my.bastion.address. Otherwise, leave blank.

  15. If users will access GitHub Insights through a gateway or proxy, enter the base URL including the protocol in the form of protocol://host.

  16. The installation configuration is now saved. You will see a message printed to the terminal.

    Saving configured settings to /Users/octocat/Projects/insights/install/0.2.9/install_data/.env
    
  17. 要开始安装,请运行 shell 脚本 release-assets/insights.sh

  18. 安装的运行需要几分钟。 完成后,您将看到终端上显示一条消息。

    PLAY RECAP ********************************************
    application: ok=20   changed=7    unreachable=0    failed=0   
    import : ok=29   changed=9    unreachable=0    failed=0
    

配置 GitHub Insights

To configure GitHub Insights to connect to GitHub Enterprise Server, you must provide the information you recorded in previous steps.

  1. In your browser, navigate to <application-server-url>/setup.

  2. Under "Company Name", type the same company name you used when creating the GitHub 应用程序.

    Company Name field

  3. 在“GitHub API URL”下,输入 用来访问 GitHub Enterprise 的 URL。

    GitHub Enterprise API URL 字段

  4. 在 "GitHub Insights 许可"下,单击"Choose Files(选择文件)",然后上传您的 GitHub Enterprise 许可文件。

    选择文件按钮

  5. 在“App ID(应用程序 ID)”下,输入您在创建应用程序时记录的 GitHub 应用程序 应用程序 ID。

    应用程序 ID 字段

  6. 在“Client ID(客户端 ID)”下,输入您在创建应用程序时记录的 GitHub 应用程序 客户端 ID。

    客户端 ID 字段

  7. 在“Client Secret(客户端密码)”下,输入您在创建应用程序时记录的 GitHub 应用程序 客户端密码。

    客户端密码字段

  8. 在“Private Key(私钥)”下,输入用于 GitHub 应用程序 的私钥,它包含在您创建应用程序时下载的 PEM 文件中。

    私钥字段

  9. 在“Webhook Secret(web 挂钩密码)”下,输入您在创建应用程序时记录的 GitHub 应用程序 web 挂钩密码。

    Web 挂钩密码字段

  10. 如果在安装过程中无法提供 SSL 证书,请选择 Skip SSL Certificate Check(跳过 SSL 证书检查)

    用于跳过 SSL 证书检查的复选框

  11. 单击 Submit(提交)

  12. Click Log in with GitHub.

  13. To authorize the GitHub 应用程序 and access GitHub Insights, click Authorize GitHub 应用程序.

延伸阅读

问问别人

找不到要找的内容?

联系我们