Skip to main content

Enabling GitHub Connect for GHE.com

Enable GitHub Connect to share data between GHE.com and 你的 GitHub Enterprise Server 实例.

You can access additional features and workflows on 你的 GitHub Enterprise Server 实例 by enabling GitHub Connect. See "关于 GitHub Connect."

On GHE.com, GitHub Connect features do not include any functionality that relies on resources on GitHub.com.

What happens when GitHub Connect is enabled?

When you enable GitHub Connect, you configure a connection between 你的 GitHub Enterprise Server 实例 and an enterprise account on GitHub Enterprise Cloud. 连接通过端口 443 或 80 使用 HTTPS,并受 TLS 保护。

Enabling GitHub Connect creates a GitHub App owned by the enterprise account on GitHub Enterprise Cloud. GitHub Enterprise Server uses the GitHub App's credentials to make requests to GitHub Enterprise Cloud.

GitHub Enterprise Server stores credentials from the GitHub App. The following credentials will be replicated to all nodes in a high availability or cluster environment, and stored in any backups, including snapshots created by GitHub Enterprise Server Backup Utilities.

  • An authentication token, which is valid for one hour
  • A private key, which is used to generate a new authentication token

Prerequisites

  • Administrative access: You need administrative access to both an enterprise account on GHE.com and a GitHub Enterprise Server instance.

  • Version requirement: Your GitHub Enterprise Server instance must run GitHub Enterprise Server 3.12 or later.

  • Proxy configuration: If using a proxy server, allow connectivity to the following GHE.com hostnames (replace SUBDOMAIN with your enterprise's subdomain).

    • SUBDOMAIN.ghe.com
    • api.SUBDOMAIN.ghe.com
    • uploads.SUBDOMAIN.ghe.com

    See "配置出站 Web 代理服务器."

Step 1: Enable connection to GHE.com

By default, GitHub Connect connects GitHub Enterprise Server to GitHub.com. You must enable your instance to connect to your enterprise's subdomain of GHE.com.

To enable the connection, someone with administrative SSH access to 你的 GitHub Enterprise Server 实例 must complete the following tasks.

  1. 通过 SSH 连接到 你的 GitHub Enterprise Server 实例。 如果实例包含多个节点,例如,如果配置了高可用性或异地复制,则通过 SSH 连接到主节点。 如果使用群集,则可以通过 SSH 连接到任何节点。 将 HOSTNAME 替换为实例的主机名,或节点的主机名或 IP 地址。 有关详细信息,请参阅“访问管理 shell (SSH)”。

    Shell
    ssh -p 122 admin@HOSTNAME
    
  2. To enable your instance to connect to GHE.com for GitHub Connect, run the following command. Replace SUBDOMAIN with the subdomain for your enterprise on GHE.com, for example octocorp.

    Shell
    ghe-config app.github.github-connect-ghe-com-enabled true
    ghe-config app.github.github-connect-ghe-com-subdomain "SUBDOMAIN"
    
  3. To apply the configuration, run the following command.

    Note

    During a configuration run, services on 你的 GitHub Enterprise Server 实例 may restart, which can cause brief downtime for users.

    Shell
    ghe-config-apply
    

After the run completes, you can configure GitHub Connect.

Step 2: Enable GitHub Connect

To enable GitHub Connect, you must be an enterprise owner on both GitHub Enterprise Server and GitHub Enterprise Cloud.

People with a user account in both environments can connect the accounts from 你的 GitHub Enterprise Server 实例.

  1. Sign in to 你的 GitHub Enterprise Server 实例 and GHE.com.

  2. 在 GitHub Enterprise Server 的右上角,单击你的个人资料照片,然后单击“企业设置”****。

    单击 GitHub Enterprise Server 上的个人资料照片时显示的下拉菜单的屏幕截图。 “企业设置”选项以深橙色边框突出显示。

  3. 在企业帐户边栏中,单击 GitHub Connect。

  4. 在“GitHub Connect 尚未启用”下,单击“启用 GitHub Connect”。 单击“启用 GitHub Connect”,即表示你同意“GitHub 附加产品和功能条款”。

  5. 在要连接的企业帐户右侧,单击“连接”。

  6. Choose which individual features of GitHub Connect you want to enable. See "关于 GitHub Connect."

Reenabling connections to GitHub.com

If you need to reenable GitHub Connect for GitHub.com, you must reconfigure your settings.

  1. 通过 SSH 连接到 你的 GitHub Enterprise Server 实例。 如果实例包含多个节点,例如,如果配置了高可用性或异地复制,则通过 SSH 连接到主节点。 如果使用群集,则可以通过 SSH 连接到任何节点。 将 HOSTNAME 替换为实例的主机名,或节点的主机名或 IP 地址。 有关详细信息,请参阅“访问管理 shell (SSH)”。

    Shell
    ssh -p 122 admin@HOSTNAME
    
  2. Run the following command.

    Shell
    ghe-config app.github.github-connect-ghe-com-enabled false
    
  3. To apply the configuration, run the following command.

    Note

    During a configuration run, services on 你的 GitHub Enterprise Server 实例 may restart, which can cause brief downtime for users.

    Shell
    ghe-config-apply
    
  4. Enable GitHub Connect on GitHub.com. See "Enabling GitHub Connect for GitHub.com."