Skip to main content

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

Configuring package ecosystem support for your enterprise

You can configure GitHub Packages for your enterprise by globally enabling or disabling individual package ecosystems on your enterprise, including Docker, and npm. Learn about other configuration requirements to support specific package ecosystems.

Enabling or disabling individual package ecosystems

To prevent new packages from being uploaded, you can set an ecosystem you previously enabled to Read-Only, while still allowing existing packages to be downloaded.

  1. 从 GitHub Enterprise Server 上的管理帐户中,在任何页面的右上角,单击

    用于访问站点管理员设置的火箭飞船图� �的屏幕截图

  2. 如果您尚未进入“站点管理员”页面,请在左上角单击 Site admin(站点管理员)

    "站点管理员" 链接的屏幕截图

  3. 在左侧边� �中,单击 管理控制台左侧边� �中的 管理控制台 选项卡

  4. 在左边� �中,单击 Packages(包)管理控制台边� �中的包选项卡

  5. Under "Ecosystem Toggles", for each package type, select Enabled, Read-Only, or Disabled. Ecosystem toggles

  6. 在左侧边� �下,单击 Save settings(保存设置)

    管理控制台 中保存设置按钮的屏幕截图

    注意: 管理控制台 中的保存设置将重新启动系统服务,这可能会导致用户可见的停机时间。

  7. 等待配置运行完毕。

    配置实例

Connecting to the official npm registry

If you've enabled npm packages on your enterprise and want to allow access to the official npm registry as well as the GitHub Packages npm registry, then you must perform some additional configuration.

GitHub Packages uses a transparent proxy for network traffic that connects to the official npm registry at registry.npmjs.com. The proxy is enabled by default and cannot be disabled.

To allow network connections to the npm registry, you will need to configure network ACLs that allow GitHub Enterprise Server to send HTTPS traffic to registry.npmjs.com over port 443:

SourceDestinationPortType
GitHub Enterprise Serverregistry.npmjs.comTCP/443HTTPS

Note that connections to registry.npmjs.com traverse through the Cloudflare network, and subsequently do not connect to a single static IP address; instead, a connection is made to an IP address within the CIDR ranges listed here: https://www.cloudflare.com/ips/.

If you wish to enable npm upstream sources, select Enabled for npm upstreaming.

Next steps

As a next step, we recommend you check if you need to update or upload a TLS certificate for your packages host URL. For more information, see "Getting started with GitHub Packages for your enterprise."