Red Hat Developer Hub 入门


Red Hat Developer Hub 1.3

Red Hat Customer Content Services

摘要

Red Hat Developer Hub 是一个用于构建开发人员门户的企业级平台。您可以配置和自定义 Developer Hub 实例,以满足您的需要和首选项。

前言

作为开发者,您可以使用 Red Hat Developer Hub 体验简化的开发环境。Red Hat Developer Hub 由集中软件目录驱动,为您的微服务和基础架构提供效率。它使您的产品团队能够在没有任何影响的情况下提供质量代码。

第 1 章 Red Hat Developer Hub 支持的配置

本节论述了访问 Red Hat Developer Hub 所需的配置,包括:

  • 自定义应用程序配置
  • Developer Hub Catalog 的源控制配置

要访问 Red Hat Developer Hub,您必须在 Red Hat OpenShift Container Platform 中添加自定义应用程序配置文件。在 OpenShift Container Platform 中,您可以使用以下内容作为基础模板,创建一个名为 app-config-rhdh 的 ConfigMap:

kind: ConfigMap
apiVersion: v1
metadata:
  name: app-config-rhdh
data:
  app-config-rhdh.yaml: |
    app:
      title: Red Hat Developer Hub

您可以使用以下方法之一将自定义应用程序配置文件添加到 OpenShift Container Platform 中:

  • Red Hat Developer Hub Operator
  • Red Hat Developer Hub Helm chart

您可以使用 Red Hat Developer Hub Helm Chart 将自定义应用程序配置文件添加到 OpenShift Container Platform 实例中。

先决条件

  • 您已创建了 Red Hat OpenShift Container Platform 帐户。

流程

  1. 在 OpenShift Container Platform Web 控制台中选择 ConfigMaps 选项卡。
  2. Create ConfigMap
  3. Create ConfigMap 页面中,选择 Configure via 中的 YAML view 选项,并根据需要更改该文件。
  4. Create
  5. 进入 Helm 选项卡查看 Helm 发行版本列表。
  6. 点击您要使用的 Helm 发行版本上的 overflow 菜单,然后选择 Upgrade
  7. 使用 Form viewYAML 视图来 编辑 Helm 配置。

    • 使用 Form view

      1. 展开 Root Schema → Backstage chart 模式 → Backstage parameters → Extra app 配置文件到内联命令参数
      2. Add Extra app 配置文件到 inline 到 command 参数 链接。
      3. 在以下字段中输入值:

        • configMapRef: app-config-rhdh
        • 文件名:app-config-rhdh.yaml
      4. 单击 Upgrade
    • 使用 YAML 视图

      1. 设置 upstream.backstage.extraAppConfig.configMapRefupstream.backstage.extraAppConfig.filename 参数的值,如下所示:

        # ... other Red Hat Developer Hub Helm Chart configurations
        upstream:
          backstage:
            extraAppConfig:
              - configMapRef: app-config-rhdh
                filename: app-config-rhdh.yaml
        # ... other Red Hat Developer Hub Helm Chart configurations
      2. 单击 Upgrade

自定义应用程序配置文件是一个 ConfigMap 对象,可用于更改 Red Hat Developer Hub 实例的配置。如果要在 Red Hat OpenShift Container Platform 上部署 Developer Hub 实例,您可以使用 Red Hat Developer Hub Operator 将自定义应用程序配置文件添加到 OpenShift Container Platform 实例中,方法是创建 ConfigMap 对象并在 Developer Hub 自定义资源(CR)中引用它。

自定义应用配置文件包含名为 BACKEND_SECRET 的敏感环境变量。此变量包含一个强制后端身份验证密钥,Developer Hub 用来引用 OpenShift Container Platform secret 中定义的环境变量。您必须创建一个名为 'secrets-rhdh' 的 secret,并在 Developer Hub CR 中引用它。

注意

您需要从外部和未经授权的访问保护 Red Hat Developer Hub 安装。像管理任何其他 secret 一样管理后端身份验证密钥。满足强密码要求,不要将其公开在任何配置文件中,而是仅将其作为环境变量注入配置文件中。

先决条件

  • 您有一个活跃的 Red Hat OpenShift Container Platform 帐户。
  • 您的管理员已在 OpenShift Container Platform 中安装了 Red Hat Developer Hub Operator。如需更多信息,请参阅安装 Red Hat Developer Hub Operator
  • 您已在 OpenShift Container Platform 中创建 Red Hat Developer Hub CR。

流程

  1. 从 OpenShift Container Platform Web 控制台中的 Developer 视角,选择 Topology 视图,然后点击 Developer Hub pod 上的 Open URL 图标来识别 Developer Hub 外部 URL: < RHDH_URL>
  2. 从 OpenShift Container Platform Web 控制台中的 Developer 视角,选择 ConfigMaps 视图。
  3. Create ConfigMap
  4. 选择 Configure via 中的 YAML view 选项,并使用以下示例创建 ConfigMap 对象,如 app-config-rhdh.yaml

    kind: ConfigMap
    apiVersion: v1
    metadata:
      name: app-config-rhdh
    data:
      "app-config-rhdh.yaml": |
        app:
          title: Red Hat Developer Hub
          baseUrl: <RHDH_URL> 
    1
    
        backend:
          auth:
            externalAccess:
                - type: legacy
                  options:
                    subject: legacy-default-config
                    secret: "${BACKEND_SECRET}" 
    2
    
          baseUrl: <RHDH_URL> 
    3
    
          cors:
            origin: <RHDH_URL> 
    4
    1
    设置 Red Hat Developer Hub 实例的外部 URL。
    2
    使用环境变量公开 OpenShift Container Platform secret,以定义强制的 Developer Hub 后端身份验证密钥。
    3
    设置 Red Hat Developer Hub 实例的外部 URL。
    4
    设置 Red Hat Developer Hub 实例的外部 URL。
  5. Create
  6. 选择 Secrets 视图。
  7. Create Key/value Secret
  8. 创建名为 secrets-rhdh 的机密。
  9. 添加名为 BACKEND_SECRET 的键,以及一个 base64 编码字符串作为值。为每个 Red Hat Developer Hub 实例使用唯一值。例如,您可以使用以下命令从终端生成密钥:

    node -p 'require("crypto").randomBytes(24).toString("base64")'
  10. Create
  11. 选择 Topology 视图。
  12. 点要使用的 Red Hat Developer Hub 实例的溢出菜单,然后选择 Edit Backstage 以加载 Red Hat Developer Hub 实例的 YAML 视图。

    Operator 安装 2
  13. 在 CR 中,输入自定义应用程序配置配置映射的名称作为 spec.application.appConfig.configMaps 字段的值,并输入您的 secret 名称作为 spec.application.extraEnvs.secrets 字段的值。例如:

    apiVersion: rhdh.redhat.com/v1alpha1
    kind: Backstage
    metadata:
      name: developer-hub
    spec:
      application:
        appConfig:
          mountPath: /opt/app-root/src
          configMaps:
             - name: app-config-rhdh
        extraEnvs:
          secrets:
             - name: secrets-rhdh
        extraFiles:
          mountPath: /opt/app-root/src
        replicas: 1
        route:
          enabled: true
      database:
        enableLocalDb: true
  14. 点击 Save
  15. 返回到 Topology 视图并等待 Red Hat Developer Hub pod 启动。
  16. Open URL 图标使用 Red Hat Developer Hub 平台配置更改。

其他资源

第 2 章 批量导入 GitHub 仓库

重要

这些功能仅用于技术预览。红帽产品服务级别协议(SLA)不支持技术预览功能,且其功能可能并不完善,因此红帽不建议在生产环境中使用它们。这些技术预览功能可以使用户提早试用新的功能,并有机会在开发阶段提供反馈意见。

有关红帽技术预览功能支持范围的更多信息,请参阅技术预览功能支持范围

Red Hat Developer Hub 可以自动加入 GitHub 存储库并跟踪它们的导入状态。

2.1. 启用并授予 Bulk Import 功能的访问权限

您可以为用户启用 Bulk Import 功能,并授予他们访问它所需的权限。

流程

  1. Bulk Import 插件已安装,但默认禁用。要启用 ./dynamic-plugins/dist/janus-idp-backstage-plugin-bulk-import-backend-dynamic./dynamic-plugins/dist/janus-idp-backstage-plugin-bulk-import 插件,请使用以下内容编辑 dynamic-plugins.yaml

    dynamic-plugins.yaml 片段

    plugins:
      - package: ./dynamic-plugins/dist/janus-idp-backstage-plugin-bulk-import-backend-dynamic
        disabled: false
      - package: ./dynamic-plugins/dist/janus-idp-backstage-plugin-bulk-import
        disabled: false

    请参阅 安装和查看动态插件

  2. 为不是管理员的用户配置所需的 bulk.import RBAC 权限,如下所示:

    rbac-policy.csv fragment

    p, role:default/bulk-import, bulk.import, use, allow
    g, user:default/<your_user>, role:default/bulk-import

    请注意,只有 Developer Hub 管理员或具有 bulk.import 权限的用户才能使用 Bulk Import 功能。请参阅 Red Hat Developer Hub 中的权限策略

验证

  • 侧边栏会显示一个 Bulk Import 选项。
  • Bulk Import 页面显示 Added Repositories 列表。

2.2. 导入多个 GitHub 仓库

在 Red Hat Developer Hub 中,您可以选择 GitHub 存储库,并将其载入到 Developer Hub 目录。

流程

  1. 单击左侧栏中的 Bulk Import
  2. 点右上角的 Add 按钮,查看从配置的 GitHub 集成访问的所有存储库的列表。

    1. Repositories 视图中,您可以选择任何存储库,或搜索任何可访问的存储库。对于每个选择的软件仓库,都会生成一个 catalog-info.yaml
    2. Organizations 视图中,您可以通过单击第三列中的 Select 来选择任何机构。这个选项允许您从所选机构中选择一个或多个软件仓库。
  3. Preview file 查看或编辑每个存储库的拉取请求详情。

    1. 查看拉取请求描述和 catalog-info.yaml 文件内容。
    2. 可选:当仓库有 .github/CODEOWNERS 文件时,您可以选择 Use CODEOWNERS 文件作为实体 Owner 复选框来使用它,而不是 content-info.yaml 包含特定的实体所有者。
    3. 点击 Save
  4. 单击 Create pull requests。此时,对所选存储库运行一组空运行检查,以确保它们满足导入的要求,例如:

    1. 使用存储库 catalog-info.yaml中指定的名称验证 Developer Hub 目录中没有实体
    2. 验证存储库是否不为空
    3. 如果 Use CODEOWNERS 文件为那个仓库选择了 Entity Owner 复选框,则验证仓库是否包含 .github/CODEOWNERS 文件

      • 如果发生错误,则不会创建拉取请求,您会看到 Failed to create PR 错误消息详细描述了这个问题。要查看有关原因的更多详细信息,请点 编辑
      • 如果没有错误,则创建拉取请求,并将您重定向到添加的存储库列表。
  5. 检查并合并创建 catalog-info.yml 文件的每个拉取请求。

验证

  • Added repositories 列表显示您导入的存储库,每个软件仓库都有一个适当的状态: Waiting for approvalAdded
  • 对于列出 批准作业的每个 Waiting,在对应的仓库中添加 catalog-info.yaml 文件对应的拉取请求。

2.3. 管理添加的软件仓库

您可以仔细阅读并管理导入到 Developer Hub 的存储库。

先决条件

流程

  1. 单击左侧栏中的 Bulk Import,以显示所有正在跟踪为 Import jobs 的存储库,以及它们的状态。

    已添加
    在导入拉取请求被合并后,仓库会添加到 Developer Hub 目录中,或者仓库已在批量导入过程中包含 catalog-info.yaml 文件。请注意,可能需要过几分钟后,实体才会在目录中可用。
    等待批准

    有一个打开的拉取请求,将 catalog-info.yaml 文件添加到存储库中。您可以:

    • 右侧的铅笔图标 查看拉取请求的详情,或编辑 Developer Hub 中的拉取请求内容。
    • 删除 Import 作业,此操作也会关闭导入 PR。
    • 要将 Import 任务转换为 Added 状态,请从 Git 存储库合并导入拉取请求。
    Developer Hub 无法决定导入作业状态,因为存储库会从其他源导入,但没有 catalog-info.yaml 文件,且缺少任何导入拉取请求来添加它。
注意
  • 合并导入拉取请求后,导入状态会在 Added Repositories 列表中被标记为 Added,但可能需要几秒钟才能出现在 Developer Hub Catalog 中。
  • 如果满足以下条件,通过其他源添加的位置(例如,在 app-config.yaml 文件中静态添加)、在启用 GitHub 发现 时动态添加的位置,或者在满足以下条件时在 Added Repositories 的 Bulk Import 列表中手动注册:

    • 目标存储库可从配置的 GitHub 集成访问。
    • 位置 URL 指向存储库默认分支根目录下的 catalog-info.yaml 文件。

2.4. 了解 Bulk Import audit Logs

Bulk Import backend 插件将以下事件添加到 Developer Hub 审计日志中。有关如何配置 和查看审计日志的更多信息,请参阅 Red Hat Developer Hub 中的审计日志。

批量导入事件

BulkImportUnknownEndpoint
跟踪对未知端点的请求。
BulkImportPing
跟踪对 /ping 端点的 GET 请求,这允许我们确保批量导入后端已启动并在运行。
BulkImportFindAllOrganizations
跟踪 GET 请求到 /organizations 端点,该端点返回所有配置的 GitHub 集成可访问的机构列表。
BulkImportFindRepositoriesByOrganization
跟踪对 /organizations/:orgName/repositories 端点的 GET 请求,该端点返回指定机构的存储库列表(可以从任何配置的 GitHub 集成访问)。
BulkImportFindAllRepositories
跟踪 GET 请求到 /repositories 端点,该端点返回可从所有配置的 GitHub 集成访问的存储库列表。
BulkImportFindAllImports
跟踪 GET 请求到 /imports 端点,该端点返回现有导入作业的列表及其状态。
BulkImportCreateImportJobs
通过最终在目标仓库中创建导入拉取请求,将 POST 请求跟踪到 /imports 端点,允许向 Developer Hub 目录提交对一个或多个存储库的请求。
BulkImportFindImportStatusByRepo
跟踪对 /import/by-repo 端点的 GET 请求,该端点获取指定存储库导入作业的详情。
BulkImportDeleteImportByRepo
通过关闭任何可以创建的开放导入拉取请求,将跟踪对 /import/by-repo 端点的 DELETE 请求,该端点会删除指定存储库的任何现有导入作业。

批量导入审计日志示例

{
  "actor": {
    "actorId": "user:default/myuser",
    "hostname": "localhost",
    "ip": "::1",
    "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
  },
  "eventName": "BulkImportFindAllOrganizations",
  "isAuditLog": true,
  "level": "info",
  "message": "'get /organizations' endpoint hit by user:default/myuser",
  "meta": {},
  "plugin": "bulk-import",
  "request": {
    "body": {},
    "method": "GET",
    "params": {},
    "query": {
      "pagePerIntegration": "1",
      "sizePerIntegration": "5"
    },
    "url": "/api/bulk-import/organizations?pagePerIntegration=1&sizePerIntegration=5"
  },
  "response": {
    "status": 200
  },
  "service": "backstage",
  "stage": "completion",
  "status": "succeeded",
  "timestamp": "2024-08-26 16:41:02"
}

使用 app-config 时,您可以执行以下操作:

  • 根据您安装并启用的插件,使用显示的额外卡自定义并扩展默认的 Home 页面布局。
  • 更改快速访问链接。
  • 添加、重新组织和删除以下可用卡:

    • 搜索栏
    • 快速访问
    • 标题
    • Markdown
    • 占位符
    • 目录不足实体
    • 特性文档

3.1. 自定义主页卡

管理员可以改变位于 12 个列网中的固定卡高度。

默认 Home 页面如以下 app-config 文件配置所示:

dynamicPlugins:
  frontend:
    janus-idp.backstage-plugin-dynamic-home-page:
      dynamicRoutes:
        - path: /
          importName: DynamicHomePage
      mountPoints:
        - mountPoint: home.page/cards
          importName: SearchBar
          config:
            layouts:
              xl: { w: 10, h: 1, x: 1 }
              lg: { w: 10, h: 1, x: 1 }
              md: { w: 10, h: 1, x: 1 }
              sm: { w: 10, h: 1, x: 1 }
              xs: { w: 12, h: 1 }
              xxs: { w: 12, h: 1 }
        - mountPoint: home.page/cards
          importName: QuickAccessCard
          config:
            layouts:
              xl: { w: 7, h: 8 }
              lg: { w: 7, h: 8 }
              md: { w: 7, h: 8 }
              sm: { w: 12, h: 8 }
              xs: { w: 12, h: 8 }
              xxs: { w: 12, h: 8 }
        - mountPoint: home.page/cards
          importName: CatalogStarredEntitiesCard
          config:
            layouts:
              xl: { w: 5, h: 4, x: 7 }
              lg: { w: 5, h: 4, x: 7 }
              md: { w: 5, h: 4, x: 7 }
              sm: { w: 12, h: 4 }
              xs: { w: 12, h: 4 }
              xxs: { w: 12, h: 4 }

先决条件

  • 您有管理访问权限,并可修改动态插件配置的 app-config.yaml 文件。

流程

  • 在 Red Hat Developer Hub 中为 Home 页面配置不同的卡,如下所示:

    搜索
    dynamicPlugins:
      frontend:
        janus-idp.backstage-plugin-dynamic-home-page:
          mountPoints:
            - mountPoint: home.page/cards
              importName: SearchBar
              config:
                layouts:
                  xl: { w: 10, h: 1, x: 1 }
                  lg: { w: 10, h: 1, x: 1 }
                  md: { w: 10, h: 1, x: 1 }
                  sm: { w: 10, h: 1, x: 1 }
                  xs: { w: 12, h: 1 }
                  xxs: { w: 12, h: 1 }
    Expand
    表 3.1. 可用的 props
    propdefault描述

    path

    /search

    如果需要,覆盖链接的搜索路径

    queryParam

    query

    如果需要,覆盖搜索查询参数名称

    快速访问
    dynamicPlugins:
      frontend:
        janus-idp.backstage-plugin-dynamic-home-page:
          mountPoints:
            - mountPoint: home.page/cards
              importName: QuickAccessCard
              config:
                layouts:
                  xl: { h: 8 }
                  lg: { h: 8 }
                  md: { h: 8 }
                  sm: { h: 8 }
                  xs: { h: 8 }
                  xxs: { h: 8 }
    Expand
    表 3.2. 可用的 props
    propdefault描述

    title

    快速访问

    如果需要,覆盖链接的搜索路径

    path

    none

    如果需要,覆盖搜索查询参数名称

    标题
    dynamicPlugins:
      frontend:
        janus-idp.backstage-plugin-dynamic-home-page:
          mountPoints:
            - mountPoint: home.page/cards
              importName: Headline
              config:
                layouts:
                  xl: { h: 1 }
                  lg: { h: 1 }
                  md: { h: 1 }
                  sm: { h: 1 }
                  xs: { h: 1 }
                  xxs: { h: 1 }
                props:
                  title: Important info
    Expand
    表 3.3. 可用的 props
    propdefault描述

    title

    none

    标题

    Markdown
    dynamicPlugins:
      frontend:
        janus-idp.backstage-plugin-dynamic-home-page:
          mountPoints:
            - mountPoint: home.page/cards
              importName: MarkdownCard
              config:
                layouts:
                  xl: { w: 6, h: 4 }
                  lg: { w: 6, h: 4 }
                  md: { w: 6, h: 4 }
                  sm: { w: 6, h: 4 }
                  xs: { w: 6, h: 4 }
                  xxs: { w: 6, h: 4 }
                props:
                  title: Company links
                  content: |
                    ### RHDH
                    * [Website](https://developers.redhat.com/rhdh/overview)
                    * [Documentation](https://docs.redhat.com/en/documentation/red_hat_developer_hub/)
                    * [GitHub Showcase](https://github.com/redhat-developer/rhdh)
                    * [GitHub Plugins](https://github.com/janus-idp/backstage-plugins)
            - mountPoint: home.page/cards
              importName: Markdown
              config:
                layouts:
                  xl: { w: 6, h: 4, x: 6 }
                  lg: { w: 6, h: 4, x: 6 }
                  md: { w: 6, h: 4, x: 6 }
                  sm: { w: 6, h: 4, x: 6 }
                  xs: { w: 6, h: 4, x: 6 }
                  xxs: { w: 6, h: 4, x: 6 }
                props:
                  title: Important company links
                  content: |
                    ### RHDH
                    * [Website](https://developers.redhat.com/rhdh/overview)
                    * [Documentation](https://docs.redhat.com/en/documentation/red_hat_developer_hub/)
                    * [GitHub Showcase](https://github.com/redhat-developer/rhdh)
                    * [GitHub Plugins](https://github.com/janus-idp/backstage-plugins)
    占位符
    dynamicPlugins:
      frontend:
        janus-idp.backstage-plugin-dynamic-home-page:
          mountPoints:
            - mountPoint: home.page/cards
              importName: Placeholder
              config:
                layouts:
                  xl: { w: 1, h: 1 }
                  lg: { w: 1, h: 1 }
                  md: { w: 1, h: 1 }
                  sm: { w: 1, h: 1 }
                  xs: { w: 1, h: 1 }
                  xxs: { w: 1, h: 1 }
                props:
                  showBorder: true
                  debugContent: '1'
    目录不足实体
    dynamicPlugins:
      frontend:
        janus-idp.backstage-plugin-dynamic-home-page:
          mountPoints:
            - mountPoint: home.page/cards
              importName: CatalogStarredEntitiesCard
    特性文档
    dynamicPlugins:
      frontend:
        janus-idp.backstage-plugin-dynamic-home-page:
          mountPoints:
            - mountPoint: home.page/cards
              importName: FeaturedDocsCard

3.2. 定义 Red Hat Developer Hub Home 页面的布局

先决条件

  • 在每个断点中包括以下最佳参数:

    • 宽度(w)
    • 高度(h)
    • 位置(x 和 y)

流程

  • 通过选择以下选项之一来配置 Developer Hub app-config.yaml 配置文件:

    • 在较小的窗口上使用所有空间,并在大型窗口中使用一半的空间,如下所示:
dynamicPlugins:
  frontend:
    janus-idp.backstage-plugin-dynamic-home-page:
      mountPoints:
        - mountPoint: home.page/cards
          importName: Placeholder
          config:
            layouts:
              xl: { w: 6, h: 2 }
              lg: { w: 6, h: 2 }
              md: { w: 6, h: 2 }
              sm: { w: 12, h: 2 }
              xs: { w: 12, h: 2 }
              xxs: { w: 12, h: 2 }
            props:
              showBorder: true
              debugContent: a placeholder
  • 通过定义 x 参数来排显示卡,如下所示:
dynamicPlugins:
  frontend:
    janus-idp.backstage-plugin-dynamic-home-page:
      mountPoints:
        - mountPoint: home.page/cards
          importName: Placeholder
          config:
            layouts:
              xl: { w: 6, h: 2 }
              lg: { w: 6, h: 2 }
              md: { w: 6, h: 2 }
              sm: { w: 12, h: 2 }
              xs: { w: 12, h: 2 }
              xxs: { w: 12, h: 2 }
            props:
              showBorder: true
              debugContent: left
        - mountPoint: home.page/cards
          importName: Placeholder
          config:
            layouts:
              xl: { w: 6, h: 2, x: 6 }
              lg: { w: 6, h: 2, x: 6 }
              md: { w: 6, h: 2, x: 6 }
              sm: { w: 12, h: 2, x: 0 }
              xs: { w: 12, h: 2, x: 0 }
              xxs: { w: 12, h: 2, x: 0 }
            props:
              showBorder: true
              debugContent: right

但是,默认情况下您可以在这个卡中看到第二个卡。

  • 通过定义 x 参数来显示三列中的卡,如下所示:
dynamicPlugins:
  frontend:
    janus-idp.backstage-plugin-dynamic-home-page:
      mountPoints:
        - mountPoint: home.page/cards
          importName: Placeholder
          config:
            layouts:
              xl: { w: 4, h: 2 }
              lg: { w: 4, h: 2 }
              md: { w: 4, h: 2 }
              sm: { w: 6, h: 2 }
              xs: { w: 12, h: 2 }
              xxs: { w: 12, h: 2 }
            props:
              showBorder: true
              debugContent: left
        - mountPoint: home.page/cards
          importName: Placeholder
          config:
            layouts:
              xl: { w: 4, h: 2, x: 4 }
              lg: { w: 4, h: 2, x: 4 }
              md: { w: 4, h: 2, x: 4 }
              sm: { w: 6, h: 2, x: 6 }
              xs: { w: 12, h: 2 }
              xxs: { w: 12, h: 2 }
            props:
              showBorder: true
              debugContent: center
        - mountPoint: home.page/cards
          importName: Placeholder
          config:
            layouts:
              xl: { w: 4, h: 2, x: 8 }
              lg: { w: 4, h: 2, x: 8 }
              md: { w: 4, h: 2, x: 8 }
              sm: { w: 6, h: 2 }
              xs: { w: 12, h: 2 }
              xxs: { w: 12, h: 2 }
            props:
              showBorder: true
              debugContent: right

要访问 Red Hat Developer Hub 中的 Home 页面,基本 URL 必须包含 /developer-hub 代理。您可以通过将数据作为代理传递给 app-config.yaml 文件来配置 Home 页面。您可以在以下源的 Home 页面中提供数据:

  • 托管在 GitHub 或 GitLab 上的 JSON 文件。
  • 使用 API 以 JSON 格式提供 Home 页面数据的专用服务。

4.1. 使用托管 JSON 文件向快速访问卡提供数据

先决条件

流程

  • 要从 JSON 文件访问数据,请在 Developer Hub app-config.yaml 配置文件中添加以下代码:
  • 将以下代码添加到 app-config.yaml 文件中:

    proxy:
      endpoints:
        # Other Proxies
        # customize developer hub instance
        '/developer-hub':
          target: <DOMAIN_URL> # i.e https://raw.githubusercontent.com/
          pathRewrite:
            '^/api/proxy/developer-hub': <path to json file> # i.e /redhat-developer/rhdh/main/packages/app/public/homepage/data.json
          changeOrigin: true
          secure: true
          # Change to "false" in case of using self hosted cluster with a self-signed certificate
          headers:
    	<HEADER_KEY>: <HEADER_VALUE> # optional and can be passed as needed i.e Authorization can be passed for private GitHub repo and PRIVATE-TOKEN can be passed for private GitLab repo

4.2. 使用专用服务向 Quick 访问卡提供数据

在使用专用服务时,您可以执行以下操作:

  • 使用相同的服务向所有可配置的 Developer Hub 页面提供数据,或者为每个页面使用不同的服务。
  • 使用 red-hat-developer-hub-customization-provider 作为示例服务,它为 Home 和 Tech Radar 页面提供数据。red-hat-developer-hub-customization-provider 服务提供与默认 Developer Hub 数据相同的数据。您可以从 GitHub 分叉 red-hat-developer-hub-customization-provider 服务存储库,并根据需要使用自己的数据进行修改。
  • 在同一集群中部署 red-hat-developer-hub-customization-provider 服务和 Developer Hub Helm Chart。

先决条件

  • 已使用 Helm Chart 安装 Red Hat Developer Hub。

如需更多信息,请参阅使用 Helm Chart 在 OpenShift Container Platform 上安装 Red Hat Developer Hub

流程

要使用单独的服务提供 Home 页面数据,请完成以下步骤:

  1. 从 Red Hat OpenShift Container Platform Web 控制台中的 Developer 视角,点 +Add > Import from Git
  2. Git Repo URL 字段中输入 Git 存储库的 URL。

    要使用 red-hat-developer-hub-customization-provider 服务,请添加 red-hat-developer-hub-customization-provider 存储库的 URL 或包含您的自定义的存储库分叉。

  3. General 选项卡中,在 Name 字段中输入 red-hat-developer-hub-customization-provider,然后单击 Create
  4. Advanced Options 选项卡中,从 Target Port 复制值。

    注意

    Target Port 会自动生成 Kubernetes 或 OpenShift Container Platform 服务以与之通信。

  5. 将以下代码添加到 app-config-rhdh.yaml 文件中:

    proxy:
      endpoints:
        # Other Proxies
        # customize developer hub instance
        '/developer-hub':
          target: ${HOMEPAGE_DATA_URL}
          changeOrigin: true
          # Change to "false" in case of using self-hosted cluster with a self-signed certificate
          secure: true

    其中 HOMEPAGE_DATA_URL 定义为 http://<SERVICE_NAME>:8080,例如 http://rhdh-customization-provider:8080

    注意

    red-hat-developer-hub-customization-provider 服务默认包含 8080 端口。如果使用自定义端口,您可以使用 app-config-rhdh.yaml 文件中的 'PORT' 环境变量指定它。

  6. 将 URL 添加到 rhdh-secrets 或直接在自定义 ConfigMap 中替换它,替换 HOMEPAGE_DATA_URL
  7. 删除 Developer Hub pod,以确保正确载入新配置。

验证

  • 要查看该服务,请导航到 OpenShift Container Platform Web 控制台中的 Administrator 视角,然后点 Networking > Service

    注意

    您还可以在 Topology 视图中查看 Service Resources

  • 确保 Home 页面提供的 API URL 以 JSON 格式返回数据,如下例所示:

    [
      {
        "title": "Dropdown 1",
        "isExpanded": false,
        "links": [
          {
            "iconUrl": "https://imagehost.com/image.png",
            "label": "Dropdown 1 Item 1",
            "url": "https://example.com/"
          },
          {
            "iconUrl": "https://imagehost2.org/icon.png",
            "label": "Dropdown 1 Item 2",
            "url": ""
          }
        ]
      },
      {
        "title": "Dropdown 2",
        "isExpanded": true,
        "links": [
          {
            "iconUrl": "http://imagehost3.edu/img.jpg",
            "label": "Dropdown 2 Item 1",
            "url": "http://example.com"
          }
        ]
      }
    ]
    注意

    如果请求调用失败或未配置,Developer Hub 实例会返回默认的本地数据。

  • 如果镜像或图标没有加载,那么通过将您的镜像或图标主机 URL 添加到自定义 ConfigMap 中的内容安全策略(csp) img-src 来列出它们,如下所示:
kind: ConfigMap
apiVersion: v1
metadata:
  name: app-config-rhdh
data:
  app-config-rhdh.yaml: |
    app:
      title: Red Hat Developer Hub
    backend:
      csp:
        connect-src:
          - "'self'"
          - 'http:'
          - 'https:'
        img-src:
          - "'self'"
          - 'data:'
          - <image host url 1>
          - <image host url 2>
          - <image host url 3>
    # Other Configurations

在 Red Hat Developer Hub 中,技术 Radar 页面由 tech-radar 动态插件提供,该插件默认为禁用。有关在 Red Hat Developer Hub 中启用动态插件的详情,请参考 在 Red Hat Developer Hub 中配置插件

在 Red Hat Developer Hub 中,您可以通过将数据作为代理传递给 app-config.yaml 文件来配置学习路径。基础技术 Radar URL 必须包含 /developer-hub/tech-radar 代理。

注意

由于将重叠的 pathRewrite 用于 tech-radar homepage 快速访问代理,因此您必须在创建 主页 配置(^api/proxy/developer-hub/tech-radar)前创建 tech-radar 配置(^/api/proxy/developer-hub)。

有关在 Red Hat Developer Hub 中自定义 Home 页面的更多信息,请参阅 Red Hat Developer Hub 中的自定义 Home 页面

您可以从以下源向 Tech Radar 页面提供数据:

  • 托管在 GitHub 或 GitLab 上的 JSON 文件。
  • 使用 API 以 JSON 格式提供 Tech Radar 数据的专用服务。

先决条件

已使用 Operator 或 Helm Chart 安装 Red Hat Developer Hub。

如需更多信息,请参阅在 OpenShift Container Platform 上安装 Red Hat Developer Hub

流程

要从 JSON 文件中访问数据,请完成以下步骤:

  • 将以下代码添加到 app-config.yaml 文件中:

    proxy:
      endpoints:
        # Other Proxies
        # customize developer hub instance
        '/developer-hub':
          target: <DOMAIN_URL> # i.e https://raw.githubusercontent.com/
          pathRewrite:
            '^/api/proxy/developer-hub/tech-radar': <path to json file> # i.e /redhat-developer/rhdh/main/packages/app/public/tech-radar/data-default.json
    	 '^/api/proxy/developer-hub': <path to json file> # i.e /redhat-developer/rhdh/main/packages/app/public/homepage/data.json
          changeOrigin: true
          secure: true
    
          # Change to "false" in case of using self hosted cluster with a self-signed certificate
          headers:
    	<HEADER_KEY>: <HEADER_VALUE> # optional and can be passed as needed i.e Authorization can be passed for private GitHub repo and PRIVATE-TOKEN can be passed for private GitLab repo

5.2. 使用专用服务向 Tech Radar 页面提供数据

在使用专用服务时,您可以执行以下操作:

  • 使用相同的服务向所有可配置的 Developer Hub 页面提供数据,或者为每个页面使用不同的服务。
  • 使用 red-hat-developer-hub-customization-provider 作为示例服务,它为 Home 和 Tech Radar 页面提供数据。red-hat-developer-hub-customization-provider 服务提供与默认 Developer Hub 数据相同的数据。您可以从 GitHub 分叉 red-hat-developer-hub-customization-provider 服务存储库,并根据需要使用自己的数据进行修改。
  • 在同一集群中部署 red-hat-developer-hub-customization-provider 服务和 Developer Hub Helm Chart。

先决条件

  • 已使用 Helm Chart 安装 Red Hat Developer Hub。

如需更多信息,请参阅使用 Helm Chart 在 OpenShift Container Platform 上安装 Red Hat Developer Hub

流程

要使用单独的服务来提供 Tech Radar 数据,请完成以下步骤:

  1. 将以下代码添加到 app-config-rhdh.yaml 文件中:

    proxy:
      endpoints:
        # Other Proxies
        '/developer-hub/tech-radar':
          target: ${TECHRADAR_DATA_URL}
          changeOrigin: true
          # Change to "false" in case of using self hosted cluster with a self-signed certificate
          secure: true

    其中 TECHRADAR_DATA_URL 定义为 http://<SERVICE_NAME>/tech-radar,例如 http://rhdh-customization-provider/tech-radar

    注意

    您可以通过将其添加到 rhdh-secrets 或直接将其替换为自定义 ConfigMap 中的值来定义 TECHRADAR_DATA_URL

  2. 删除 Developer Hub pod,以确保正确载入新配置。

在 Red Hat Developer Hub 中,您可以通过将数据作为代理传递给 app-config.yaml 文件来配置学习路径。基本 URL 必须包含 /developer-hub/learning-paths 代理。

注意

由于对 learning-path主页快速访问代理使用重叠的 pathRewrites,因此您必须在创建主页 配置(^api/proxy/developer-hub)之前创建 learning-paths 配置(^api/proxy/developer-hub)。

有关在 Red Hat Developer Hub 中自定义 Home 页面的更多信息,请参阅 Red Hat Developer Hub 中的自定义 Home 页面

您可以将数据提供给以下源的学习路径:

  • 托管在 GitHub 或 GitLab 上的 JSON 文件。
  • 使用 API 以 JSON 格式提供学习路径数据的专用服务。

6.1. 使用托管的 JSON 文件向学习路径提供数据

先决条件

已使用 Operator 或 Helm Chart 安装 Red Hat Developer Hub。

如需更多信息,请参阅在 OpenShift Container Platform 上安装 Red Hat Developer Hub

流程

要从 JSON 文件中访问数据,请完成以下步骤:

  • 将以下代码添加到 app-config.yaml 文件中:

    proxy:
      endpoints:
        '/developer-hub':
          target: https://raw.githubusercontent.com/
          pathRewrite:
            '^/api/proxy/developer-hub/learning-paths': '/redhat-developer/rhdh/main/packages/app/public/learning-paths/data.json'
            '^/api/proxy/developer-hub/tech-radar': '/redhat-developer/rhdh/main/packages/app/public/tech-radar/data-default.json'
            '^/api/proxy/developer-hub': '/redhat-developer/rhdh/main/packages/app/public/homepage/data.json'
          changeOrigin: true
          secure: true

6.2. 使用专用服务向学习路径提供数据

在使用专用服务时,您可以执行以下操作:

  • 使用相同的服务向所有可配置的 Developer Hub 页面提供数据,或者为每个页面使用不同的服务。
  • 使用 red-hat-developer-hub-customization-provider 作为示例服务,它为 Home 和 Tech Radar 页面提供数据。red-hat-developer-hub-customization-provider 服务提供与默认 Developer Hub 数据相同的数据。您可以从 GitHub 分叉 red-hat-developer-hub-customization-provider 服务存储库,并根据需要使用自己的数据进行修改。
  • 在同一集群中部署 red-hat-developer-hub-customization-provider 服务和 Developer Hub Helm Chart。

先决条件

  • 已使用 Helm Chart 安装 Red Hat Developer Hub。

如需更多信息,请参阅在 OpenShift Container Platform 上安装 Red Hat Developer Hub

流程

要使用专用服务来提供学习路径数据,请完成以下步骤:

  1. 将以下代码添加到 app-config-rhdh.yaml 文件中:

       proxy:
          endpoints:
            # Other Proxies
            '/developer-hub/learning-paths':
              target: ${LEARNING_PATH_DATA_URL}
              changeOrigin: true
              # Change to "false" in case of using self hosted cluster with a self-signed certificate
              secure: true

    其中 LEARNING_PATH_DATA_URL 定义为 http://<SERVICE_NAME>/learning-paths,例如 http://rhdh-customization-provider/learning-paths

    注意

    您可以通过将 LEARNING_PATH_DATA_URL 添加到 rhdh-secrets,或将其替换为自定义 ConfigMap 中的值来定义 LEARNING_PATH_DATA_URL。

  2. 删除 Developer Hub pod,以确保正确载入新配置。

第 7 章 自定义 Red Hat Developer Hub 实例的外观

Red Hat Developer Hub 有以下默认主题配置:

Red Hat Developer Hub 主题
默认主题配置使开发人员门户像一个标准的 Red Hat Developer Hub 实例。如需更多信息,请参阅 第 7.8 节 “默认 Red Hat Developer Hub 主题”
Backstage 主题
使开发人员门户成为标准 Backstage 实例的默认主题配置。如需更多信息,请参阅 第 7.9 节 “默认阶段主题”

您可以通过修改 app-config-rhdh.yaml 文件来更改或禁用特定参数。在 app-config-rhdh.yaml 文件中,您可以自定义常见的主题组件,包括:

  • 公司名称和徽标
  • 字体颜色、大小和样式,以段落、标题、标头和按钮形式
  • 标头颜色、科学和形成
  • 按钮颜色
  • 导航指示器颜色

您还可以从 Developer Hub GUI 自定义一些组件,如主题模式(Light Theme,Dark Theme, 或 Auto)。

7.1. 为 Developer Hub 实例自定义主题模式

注意

在 Developer Hub 中,使用主题配置来更改不同 UI 组件的外观和感觉。因此,您可能会注意到不同 UI 组件的更改,如按钮、标签页、侧边栏、卡和表,以及背景颜色和 RHDH 页面上所使用的字体。

您可以为 Developer Hub 实例选择以下主题模式之一:

  • 辅助主题
  • dark theme
  • auto

默认主题模式是 Auto,它会根据您的系统首选项自动设置 light 或 dark 主题。

先决条件

  • 已登陆到 Developer Hub web 控制台。

流程

  1. 在 Developer Hub web 控制台中点 Settings
  2. Appearance 面板中,单击 LIGHT THEMEDARK THEMEAUTO 以更改主题模式。

    自定义主题模式 1

7.2. 自定义 Developer Hub 实例的品牌徽标

您可以通过配置 app-config-rhdh.yaml 文件 的品牌 部分来自定义 Developer Hub 实例的品牌徽标,如下例所示:

app:
  branding:
    fullLogo: ${BASE64_EMBEDDED_FULL_LOGO} 
1

    iconLogo: ${BASE64_EMBEDDED_ICON_LOGO} 
2

其中:

1
fullLogo 是展开的(固定)侧栏上的徽标,需要采用 base64 编码的图像。
2
iconLogo 是折叠(未固定)边栏上的徽标,需要一个 base64 编码的图像。

您还可以通过为品牌部分中的 fullLogoWidth 字段设置值来自定义 品牌 徽标的宽度,如下例所示:

app:
  branding:
    fullLogoWidth: 110px 
1

# ...
1
徽标宽度的默认值为 110px。支持以下单位: 整数,px,em,rem, , percentage.

7.3. 为 Developer Hub 实例自定义侧边栏菜单项

Red Hat Developer Hub 中的侧边栏菜单由两个主要部分组成:

  • 主菜单项 :这些项目是组成侧边栏核心导航结构的静态菜单项。这些菜单项保持一致,并且是预定义的。
  • 动态插件菜单项 :这些项目显示在主菜单下,并可以根据安装的插件进行自定义。主菜单项部分是动态的,可以根据您的首选项和已安装的插件进行更改。

流程

  1. 使用以下步骤自定义主菜单项:

    1. 打开 app-config-rhdh.yaml 文件。
    2. 要自定义主菜单项的顺序和父子关系,请使用 dynamicPlugins.frontend.default.main-menu-items.menuItems 字段。
    3. 对于动态插件菜单项,请使用 dynamicPlugins.frontend.<package_name>.menuItems 字段。

    app-config-rhdh.yaml 文件示例

    dynamicPlugins:
      frontend:
        <package_name>: # same as `scalprum.name` key in plugin's `package.json`
          menuItems: # optional, allows you to configure plugin menu items in the main sidebar navigation
            <menu_item_name>: # unique name in the plugin menu items list 
    1
    
              icon: home | group | category | extension | school | _<your_icon>_  
    2
    
              title: My Plugin Page # optional, same as `menuItem.text` in `dynamicRoutes` 
    3
    
              priority: 10 # optional, defines the order of menu items in the sidebar 
    4
    
              parent: favorites # optional, defines parent-child relationships for nested menu items 
    5

    您可以修改上例中的字段,以配置侧边栏菜单项所需的订购和父子关系。

    1
    此属性代表主边栏导航中的唯一名称。它可以表示独立菜单项或父菜单项。如果此属性代表插件菜单项,则属性的名称必须与 dynamicRoutes 中的对应路径匹配。例如,如果 dynamicRoutes 定义 path: /my-plugin,则 menu_item_name 必须定义为 my-plugin

    对于更复杂的多网段路径,如 path: /metrics/users/infomenu_item_name 必须使用点标记来代表完整路径,如 metrics.users.info。路径中的尾随和前导斜杠将被忽略。例如,path: /docs results in menu_item_name: docs, and path: /metrics/users 结果为 menu_item_name: metrics.users

    2
    此可选属性指定菜单项的图标。您可以使用默认图标或使用动态插件扩展图标。Developer Hub 还在其内部库中提供额外的图标,例如:

    内部库中的主页图标

    dynamicPlugins:
      frontend:
        <package_name>:
          menuItems:
            <menu_item_name>:
              icon: home

    类似地,内部库包含 类别扩展和 学会 的图标。如果图标已在 menuItem.icondynamicRoutes 配置中定义,则可以从 menuItems 配置中删除。另外,支持 SVG 和 HTML 镜像图标。例如:

    SVG 图标示例

    icon: <svg width="20px" height="20px" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill="#ffffff">...</svg>

    镜像图标示例

    icon: https://img.icons8.com/ios-glyphs/20/FFFFFF/shop.png

    3
    此可选属性指定菜单项的标题。如果标题已在 menuItem.text 下的 dynamicRoutes 配置中指定了,可以被删除。
    4
    此可选属性设置菜单项在侧边栏中显示的顺序。默认优先级是 0,它将项目放在列表的底部。较高的优先级值会将项目更高的位置放在边栏中。您可以为每个部分定义此属性。
    5
    此可选属性指定当前项目嵌套在下的父菜单项。如果使用此属性,则必须在任何已启用插件的 menuItem 配置中定义 父菜单项。您可以为每个部分定义此属性。

    menuItems 配置示例

    dynamicPlugins:
      frontend:
        <package_name>:
          dynamicRoutes:
            - path: /my-plugin
              module: CustomModule
              importName: FooPluginPage
              menuItem:
                icon: fooIcon
                text: Foo Plugin Page
          menuItems:
            my-plugin: # matches `path` in `dynamicRoutes`
              priority: 10 # controls order of plugins under the parent menu item
              parent: favorites # nests this plugin under the `favorites` parent menu item
            favorites: # configuration for the parent menu item
              icon: favorite # icon from RHDH system icons
              title: Favorites # title for the parent menu item
              priority: 100 # controls the order of this top-level menu item

  2. 要确保菜单项被识别为主菜单项,您必须在其键中添加 default. 前缀。例如:

    侧边栏中导航中主菜单项配置示例

    dynamicPlugins:
      frontend:
        default.main-menu-items: # key for configuring static main menu items
          menuItems:
            default.<menu_item_name>: # key of the menu item configuration. `default.` prefix is required for a main menu item key 
    1
    
              parent: my_menu_group # optional, specifies the parent menu item for this item
              priority: 10 # optional, specifies the order of this menu item within its menu level
            default.<menu_group_parent_item_name>: # must be configured if it is specified as the parent of any menu items. `default.` prefix is required for a main group parent item key 
    2
    
              icon: my_menu_group_icon # required for parent menu items, defines the icon for the menu group
              title: my_menu_group_title # required for parent menu items, defines the icon for the menu group
              priority: 100 # optional, specifies the order of the parent menu item in the sidebar

    1 2
    default. 前缀标识项目作为主菜单项。您可以在单独的菜单项或父菜单组配置中添加 default. 前缀,如上例中的 default.<menu_group_parent_item_name >。
    注意

    主菜单项的默认优先级决定了它们在边栏中的顺序。您可以通过调整其优先级值来自定义静态主菜单项的顺序。确保每个项目的优先级和标题很明确,以方便轻松重新排序。

7.4. 为 Developer Hub 实例自定义应用程序标题

您可以通过为 title 字段设置值来自定义应用程序 标题 文本,如下例所示:

app:
  title: My custom developer hub
# ...

您可以通过配置 app-config-rhdh.yaml 文件的 branding.palette 部分的 light.palettedark.palette 参数来自定义 Developer Hub 实例中 light 和 dark theme 模式的颜色面板,如下例所示:

app:
  branding:
    theme:
      light:
        palette:
          primary:
            main: <light_primary_color> 
1

          navigation:
            indicator: <light_indicator_color> 
2

        pageTheme:
          default:
            backgroundColor: [<light_background_color_1>, <light_background_color_2>] 
3

      dark:
        palette:
          primary:
            main: <dark_primary_color> 
4

          navigation:
            indicator: <dark_indicator_color> 
5

        pageTheme:
          default:
            backgroundColor: [<dark_background_color_1>, <dark_background_color_2>] 
6

# ...
1
light color palette 的主要颜色,例如:": ffffffwhite
2
light color palette 的导航指示符颜色,它是一个垂直栏,它表示导航面板中的所选标签页,如 #FF0000red
3
light color palette 的默认页面主题的背景颜色,例如:": ffffffwhite
4
dark color palette 的主要颜色,例如: #000000black
5
dark color palette 的导航指示符颜色,它是一个垂直栏,代表导航面板中的所选标签页,例如 #FF0000red
6
dark color palette 的默认页面主题的背景颜色,例如 #000000black

7.6. 为 Developer Hub 实例自定义页面主题标头

您可以通过修改 app-config-rhdh.yaml 文件的 branding.theme 部分来自定义 Developer Hub 实例中 light 和 dark 的标头颜色。您还可以为其他 Developer Hub 页面自定义页面标头,如 HomeCatalogAPI 页面。

app:
  branding:
    theme:
      light: 
1

        palette: {}
        pageTheme:
          default: 
2

            backgroundColor: "<default_light_background_color>" 
3

            fontColor: "<default_light_font_color>" 
4

            shape: none 
5

          apis: 
6

            backgroundColor: "<apis_light_background_color>"
            fontColor: "<apis_light_font_color>"
            shape: none
      dark:
        palette: {}
        pageTheme:
          default:
            backgroundColor: "<default_dark_background_color>"
            fontColor: "<default_dark_font_color>"
            shape: none
# ...
1
me 模式,如 lightdark
2
主题配置的默认页面的 yaml 标头
3
页面标头背景的颜色,如 #ffffffwhite
4
页面标头中文本颜色,如 #000000black
5
页面标头中的模式,如 waveround、或 none
6
特定页面主题配置的 yaml 标头,如 apishome

7.7. 为 Developer Hub 实例自定义字体

您可以配置 app-config-rhdh.yaml 文件的 typography 部分,以更改页面文本的默认字体系列和大小,以及每个标题级别的字体系列和大小,如下例所示:

app:
  branding:
    theme:
      light:
        typography:
          fontFamily: "Times New Roman"
          htmlFontSize: 11 # smaller is bigger
          h1:
            fontFamily: "Times New Roman"
            fontSize: 40
          h2:
            fontFamily: "Times New Roman"
            fontSize: 30
          h3:
            fontFamily: "Times New Roman"
            fontSize: 30
          h4:
            fontFamily: "Times New Roman"
            fontSize: 30
          h5:
            fontFamily: "Times New Roman"
            fontSize: 30
          h6:
            fontFamily: "Times New Roman"
            fontSize: 30
      dark:
        typography:
          fontFamily: "Times New Roman"
          htmlFontSize: 11 # smaller is bigger
          h1:
            fontFamily: "Times New Roman"
            fontSize: 40
          h2:
            fontFamily: "Times New Roman"
            fontSize: 30
          h3:
            fontFamily: "Times New Roman"
            fontSize: 30
          h4:
            fontFamily: "Times New Roman"
            fontSize: 30
          h5:
            fontFamily: "Times New Roman"
            fontSize: 30
          h6:
            fontFamily: "Times New Roman"
            fontSize: 30
# ...

7.8. 默认 Red Hat Developer Hub 主题

您可以使用默认的 Red Hat Developer Hub 主题配置使 Developer Hub 实例类似于标准的 Red Hat Developer Hub 实例。您还可以修改 app-config-rhdh.yaml 文件以自定义或禁用特定参数。

7.8.1. 默认 Red Hat Developer Hub 主题颜色面板

app-config-rhdh.yaml 文件对默认的 Red Hat Developer Hub 颜色面板使用以下配置:

app:
  branding:
    theme:
      light:
        variant: "rhdh"
        mode: "light"
        palette:
          background:
            default: "#F8F8F8"
            paper: "#FFFFFF"
          banner:
            closeButtonColor: "#FFFFFF"
            error: "#E22134"
            info: "#2E77D0"
            link: "#000000"
            text: "#FFFFFF"
            warning: "#FF9800"
          border: "#E6E6E6"
          bursts:
            backgroundColor:
              default: "#7C3699"
            fontColor: "#FEFEFE"
            gradient:
              linear: "linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"
            slackChannelText: "#ddd"
          errorBackground: "#FFEBEE"
          errorText: "#CA001B"
          gold: "#FFD600"
          highlight: "#FFFBCC"
          infoBackground: "#ebf5ff"
          infoText: "#004e8a"
          link: "#0A6EBE"
          linkHover: "#2196F3"
          mode: "light"
          navigation:
            background: "#222427"
            indicator: "#0066CC"
            color: "#ffffff"
            selectedColor: "#ffffff"
            navItem:
              hoverBackground: "#3c3f42"
            submenu:
              background: "#222427"
          pinSidebarButton:
            background: "#BDBDBD"
            icon: "#181818"
          primary:
            main: "#0066CC"
          secondary:
            main: "#8476D1"
          status:
            aborted: "#757575"
            error: "#E22134"
            ok: "#1DB954"
            pending: "#FFED51"
            running: "#1F5493"
            warning: "#FF9800"
          tabbar:
            indicator: "#9BF0E1"
          textContrast: "#000000"
          textSubtle: "#6E6E6E"
          textVerySubtle: "#DDD"
          warningBackground: "#F59B23"
          warningText: "#000000"
          text:
            primary: "#151515"
            secondary: "#757575"
          rhdh:
            general:
              disabledBackground: "#D2D2D2"
              disabled: "#6A6E73"
              searchBarBorderColor: "#E4E4E4"
              formControlBackgroundColor: "#FFF"
              mainSectionBackgroundColor: "#FFF"
              headerBottomBorderColor: "#C7C7C7"
              cardBackgroundColor: "#FFF"
              sideBarBackgroundColor: "#212427"
              cardBorderColor: "#C7C7C7"
              tableTitleColor: "#181818"
              tableSubtitleColor: "#616161"
              tableColumnTitleColor: "#151515"
              tableRowHover: "#F5F5F5"
              tableBorderColor: "#E0E0E0"
              tableBackgroundColor: "#FFF"
              tabsBottomBorderColor: "#D2D2D2"
              contrastText: "#FFF"
            primary:
              main: "#0066CC"
              focusVisibleBorder: "#0066CC"
            secondary:
              main: "#8476D1"
              focusVisibleBorder: "#8476D1"
            cards:
              headerTextColor: "#151515"
              headerBackgroundColor: "#FFF"
              headerBackgroundImage: "none"

      dark:
        variant: "rhdh"
        mode: "dark"
        palette:
          background:
            default: "#333333"
            paper: "#424242"
          banner:
            closeButtonColor: "#FFFFFF"
            error: "#E22134"
            info: "#2E77D0"
            link: "#000000"
            text: "#FFFFFF"
            warning: "#FF9800"
          border: "#E6E6E6"
          bursts:
            backgroundColor:
              default: "#7C3699"
            fontColor: "#FEFEFE"
            gradient:
              linear: "linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"
            slackChannelText: "#ddd"
          errorBackground: "#FFEBEE"
          errorText: "#CA001B"
          gold: "#FFD600"
          highlight: "#FFFBCC"
          infoBackground: "#ebf5ff"
          infoText: "#004e8a"
          link: "#9CC9FF"
          linkHover: "#82BAFD"
          mode: "dark"
          navigation:
            background: "#0f1214"
            indicator: "#0066CC"
            color: "#ffffff"
            selectedColor: "#ffffff"
            navItem:
              hoverBackground: "#3c3f42"
            submenu:
              background: "#0f1214"
          pinSidebarButton:
            background: "#BDBDBD"
            icon: "#404040"
          primary:
            main: "#1FA7F8"
          secondary:
            main: "#B2A3FF"
          status:
            aborted: "#9E9E9E"
            error: "#F84C55"
            ok: "#71CF88"
            pending: "#FEF071"
            running: "#3488E3"
            warning: "#FFB84D"
          tabbar:
            indicator: "#9BF0E1"
          textContrast: "#FFFFFF"
          textSubtle: "#CCCCCC"
          textVerySubtle: "#727272"
          warningBackground: "#F59B23"
          warningText: "#000000"

          rhdh:
            general:
              disabledBackground: "#444548"
              disabled: "#AAABAC"
              searchBarBorderColor: "#57585a"
              formControlBackgroundColor: "#36373A"
              mainSectionBackgroundColor: "#0f1214"
              headerBottomBorderColor: "#A3A3A3"
              cardBackgroundColor: "#292929"
              sideBarBackgroundColor: "#1b1d21"
              cardBorderColor: "#A3A3A3"
              tableTitleColor: "#E0E0E0"
              tableSubtitleColor: "#E0E0E0"
              tableColumnTitleColor: "#E0E0E0"
              tableRowHover: "#0f1214"
              tableBorderColor: "#515151"
              tableBackgroundColor: "#1b1d21"
              tabsBottomBorderColor: "#444548"
              contrastText: "#FFF"
            primary:
              main: "#1FA7F8"
              focusVisibleBorder: "#ADD6FF"
            secondary:
              main: "#B2A3FF"
              focusVisibleBorder: "#D0C7FF"
            cards:
              headerTextColor: "#FFF"
              headerBackgroundColor: "#0f1214"
              headerBackgroundImage: "none"

另外,您可以使用 app-config-rhdh.yaml 文件中的以下 变体 和模式 值应用以前的默认配置:

app:
  branding:
    theme:
      light:
        variant: "rhdh"
        mode: "light"
      dark:
        variant: "rhdh"
        mode: "dark"

7.8.2. 默认 Red Hat Developer Hub 页主题

默认 Developer Hub 标头颜色在 light mode 和 black in dark 模式中是白色的,如以下 app-config-rhdh.yaml 文件配置中所示:

app:
  branding:
    theme:
      light:
        palette: {}
        defaultPageTheme: default
        pageTheme:
          default:
            backgroundColor: "#ffffff"
      dark:
        palette: {}
        defaultPageTheme: default
        pageTheme:
          default:
            backgroundColor: "#0f1214"

7.9. 默认阶段主题

您可以使用默认的 Backstage 主题配置使 Developer Hub 实例类似于标准 Backstage 实例。您还可以修改 app-config-rhdh.yaml 文件以自定义或禁用特定参数。

7.9.1. 默认回阶段主题颜色面板

app-config-rhdh.yaml 文件对默认的 Backstage color palette 使用以下配置:

app:
  branding:
    theme:
      light:
        variant: "backstage"
        mode: "light"
        palette:
          background:
            default: "#F8F8F8"
            paper: "#FFFFFF"
          banner:
            closeButtonColor: "#FFFFFF"
            error: "#E22134"
            info: "#2E77D0"
            link: "#000000"
            text: "#FFFFFF"
            warning: "#FF9800"
          border: "#E6E6E6"
          bursts:
            backgroundColor:
              default: "#7C3699"
            fontColor: "#FEFEFE"
            gradient:
              linear: "linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"
            slackChannelText: "#ddd"
          errorBackground: "#FFEBEE"
          errorText: "#CA001B"
          gold: "#FFD600"
          highlight: "#FFFBCC"
          infoBackground: "#ebf5ff"
          infoText: "#004e8a"
          link: "#0A6EBE"
          linkHover: "#2196F3"
          navigation:
            background: "#171717"
            color: "#b5b5b5"
            indicator: "#9BF0E1"
            navItem:
              hoverBackground: "#404040"
            selectedColor: "#FFF"
            submenu:
              background: "#404040"
          pinSidebarButton:
            background: "#BDBDBD"
            icon: "#181818"
          primary:
            main: "#1F5493"
          status:
            aborted: "#757575"
            error: "#E22134"
            ok: "#1DB954"
            pending: "#FFED51"
            running: "#1F5493"
            warning: "#FF9800"
          tabbar:
            indicator: "#9BF0E1"
          textContrast: "#000000"
          textSubtle: "#6E6E6E"
          textVerySubtle: "#DDD"
          warningBackground: "#F59B23"
          warningText: "#000000"

      dark:
        variant: "backstage"
        mode: "dark"
        palette:
          background:
            default: "#333333"
            paper: "#424242"
          banner:
            closeButtonColor: "#FFFFFF"
            error: "#E22134"
            info: "#2E77D0"
            link: "#000000"
            text: "#FFFFFF"
            warning: "#FF9800"
          border: "#E6E6E6"
          bursts:
            backgroundColor:
              default: "#7C3699"
            fontColor: "#FEFEFE"
            gradient:
              linear: "linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"
            slackChannelText: "#ddd"
          errorBackground: "#FFEBEE"
          errorText: "#CA001B"
          gold: "#FFD600"
          highlight: "#FFFBCC"
          infoBackground: "#ebf5ff"
          infoText: "#004e8a"
          link: "#9CC9FF"
          linkHover: "#82BAFD"
          mode: "dark"
          navigation:
            background: "#424242"
            color: "#b5b5b5"
            indicator: "#9BF0E1"
            navItem:
              hoverBackground: "#404040"
            selectedColor: "#FFF"
            submenu:
              background: "#404040"
          pinSidebarButton:
            background: "#BDBDBD"
            icon: "#404040"
          primary:
            dark: "#82BAFD"
            main: "#9CC9FF"
          secondary:
            main: "#FF88B2"
          status:
            aborted: "#9E9E9E"
            error: "#F84C55"
            ok: "#71CF88"
            pending: "#FEF071"
            running: "#3488E3"
            warning: "#FFB84D"
          tabbar:
            indicator: "#9BF0E1"
          textContrast: "#FFFFFF"
          textSubtle: "#CCCCCC"
          textVerySubtle: "#727272"
          warningBackground: "#F59B23"
          warningText: "#000000"

另外,您可以使用 app-config-rhdh.yaml 文件中的以下 变体 和模式 值应用以前的默认配置:

app:
  branding:
    theme:
      light:
        variant: "backstage"
        mode: "light"
      dark:
        variant: "backstage"
        mode: "dark"

7.9.2. 默认 Backstage 页主题

默认的 Backstage 标头颜色在 light mode 和 black in dark 模式中是白色的,如以下 app-config-rhdh.yaml 文件配置中所示:

app:
  branding:
    theme:
      light:
        palette: {}
        defaultPageTheme: default
        pageTheme:
          default:
            backgroundColor: ['#005B4B'] # teal
            fontColor: '#ffffff'
            shape: wave
          documentation:
            backgroundColor: ['#C8077A', '#C2297D'] # pinkSea
            fontColor: '#ffffff'
            shape: wave2
          tool:
            backgroundColor: ['#8912CA', '#3E00EA'] # purpleSky
            fontColor: '#ffffff'
            shape: round
          service:
            backgroundColor: ['#006D8F', '#0049A1'] # marineBlue
            fontColor: '#ffffff'
            shape: wave
          website:
            backgroundColor: ['#0027AF', '#270094'] # veryBlue
            fontColor: '#ffffff'
            shape: wave
          library:
            backgroundColor: ['#98002B', '#8D1134'] # rubyRed
            fontColor: '#ffffff'
            shape: wave
          other:
            backgroundColor: ['#171717', '#383838'] # darkGrey
            fontColor: '#ffffff'
            shape: wave
          app:
            backgroundColor: ['#BE2200', '#A41D00'] # toastyOrange
            fontColor: '#ffffff'
            shape: shapes.wave
          apis:
            backgroundColor: ['#005B4B'] # teal
            fontColor: '#ffffff'
            shape: wave2
          card:
            backgroundColor: ['#4BB8A5', '#187656'] # greens
            fontColor: '#ffffff'
            shape: wave

      dark:
        palette: {}
        defaultPageTheme: default
        pageTheme:
          default:
            backgroundColor: ['#005B4B'] # teal
            fontColor: '#ffffff'
            shape: wave
          documentation:
            backgroundColor: ['#C8077A', '#C2297D'] # pinkSea
            fontColor: '#ffffff'
            shape: wave2
          tool:
            backgroundColor: ['#8912CA', '#3E00EA'] # purpleSky
            fontColor: '#ffffff'
            shape: round
          service:
            backgroundColor: ['#006D8F', '#0049A1'] # marineBlue
            fontColor: '#ffffff'
            shape: wave
          website:
            backgroundColor: ['#0027AF', '#270094'] # veryBlue
            fontColor: '#ffffff'
            shape: wave
          library:
            backgroundColor: ['#98002B', '#8D1134'] # rubyRed
            fontColor: '#ffffff'
            shape: wave
          other:
            backgroundColor: ['#171717', '#383838'] # darkGrey
            fontColor: '#ffffff'
            shape: wave
          app:
            backgroundColor: ['#BE2200', '#A41D00'] # toastyOrange
            fontColor: '#ffffff'
            shape: shapes.wave
          apis:
            backgroundColor: ['#005B4B'] # teal
            fontColor: '#ffffff'
            shape: wave2
          card:
            backgroundColor: ['#4BB8A5', '#187656'] # greens
            fontColor: '#ffffff'
            shape: wave

7.10. Developer Hub 实例的自定义组件选项

您可以使用两个组件变体来自定义 Developer Hub 的不同组件:

  • PatternFly
  • MUI

除了在 light 或dark theme 模式配置中为每个参数分配组件变体外,您还可以切换 rippleEffectoff

以下代码显示了您可以在 app-config-rhdh.yaml 文件中使用的选项来为 Developer Hub 实例配置主题组件:

app:
  branding:
    theme:
      light:
        options:
          rippleEffect: off / on
          paper: patternfly / mui
          buttons: patternfly / mui
          inputs: patternfly / mui
          accordions: patternfly / mui
          sidebars: patternfly / mui
          pages: patternfly / mui
          headers: patternfly / mui
          toolbars: patternfly / mui
          dialogs: patternfly / mui
          cards: patternfly / mui
          tables: patternfly / mui
          tabs: patternfly / mui
      dark:
        options:
          rippleEffect: off / on
          paper: patternfly / mui
          buttons: patternfly / mui
          inputs: patternfly / mui
          accordions: patternfly / mui
          sidebars: patternfly / mui
          pages: patternfly / mui
          headers: patternfly / mui
          toolbars: patternfly / mui
          dialogs: patternfly / mui
          cards: patternfly / mui
          tables: patternfly / mui
          tabs: patternfly / mui
重要

这些功能仅用于技术预览。红帽产品服务级别协议(SLA)不支持技术预览功能,且其功能可能并不完善,因此红帽不建议在生产环境中使用它们。这些技术预览功能可以使用户提早试用新的功能,并有机会在开发阶段提供反馈意见。

有关红帽技术预览功能支持范围的更多信息,请参阅技术预览功能支持范围

在 Red Hat Developer Hub 中,您可以访问 ServiceNow 自定义操作(自定义操作)以便在目录中获取和注册资源。

Developer Hub 中的自定义操作允许您促进和自动管理记录。使用自定义操作,您可以执行以下操作:

  • 创建、更新或删除记录
  • 检索有关单个记录或多个记录的信息

在 Red Hat Developer Hub 中,ServiceNow 自定义操作作为预加载插件提供,该插件默认是禁用的。您可以按照以下流程启用自定义操作插件。

先决条件

  • Red Hat Developer Hub 已安装并运行。

有关安装 Developer Hub 的更多信息,请参阅使用 Helm Chart 在 OpenShift Container Platform 上安装 Red Hat Developer Hub

  • 您已在 Developer Hub 中创建了一个项目。

流程

  1. 要激活自定义操作插件,请添加带有 插件名称的软件包,并更新 Helm Chart 中的 disabled 字段,如下所示:

    global:
      dynamic:
        includes:
          - dynamic-plugins.default.yaml
        plugins:
          - package: ./dynamic-plugins/dist/janus-idp-backstage-scaffolder-backend-module-servicenow-dynamic
            disabled: false
    注意

    插件的默认配置是从 dynamic-plugins.default.yaml 文件中提取的,但您可以使用 pluginConfig 条目来覆盖默认配置。

  2. 在 Helm Chart 中设置以下变量以访问自定义操作:

    servicenow:
      # The base url of the ServiceNow instance.
      baseUrl: ${SERVICENOW_BASE_URL}
      # The username to use for authentication.
      username: ${SERVICENOW_USERNAME}
      # The password to use for authentication.
      password: ${SERVICENOW_PASSWORD}

ServiceNow 自定义操作允许您管理 Red Hat Developer Hub 中的记录。自定义操作支持以下 API 请求的 HTTP 方法:

  • GET :从指定的资源端点检索指定信息
  • POST :创建或更新资源
  • PUT :修改资源
  • PATCH: 更新资源
  • DELETE :删除资源

8.2.1. ServiceNow 自定义操作

[GET] servicenow:now:table:retrieveRecord

从 Developer Hub 中的表检索指定记录的信息。

Expand
表 8.1. 输入参数
Name类型要求描述

tableName

string

必填

从中检索记录的表的名称

sysId

string

必填

要检索的记录的唯一标识符

sysparmDisplayValue

enum("true", "false", "all")

选填

返回字段显示值,如 true,实际值为 false,或两者。默认值为 false

sysparmExcludeReferenceLink

布尔值

选填

设置为 true 以排除参考字段的 Table API 链接。默认值为 false

sysparmFields

string[]

选填

要在响应中返回的字段数组

sysparmView

string

选填

根据指定的 UI 视图呈现响应。您可以使用 sysparm_fields 覆盖此参数。

sysparmQueryNoDomain

布尔值

选填

将 设置为 true,以在域间访问数据(如果授权)。默认值为 false

Expand
表 8.2. 输出参数
Name类型描述

result

record<PropertyKey, unknown>

请求的响应正文

[GET] servicenow:now:table:retrieveRecords

从 Developer Hub 中的表检索有关多个记录的信息。

Expand
表 8.3. 输入参数
Name类型要求描述

tableName

string

必填

从中检索记录的表的名称

sysparamQuery

string

选填

用于过滤结果的编码查询字符串

sysparmDisplayValue

enum("true", "false", "all")

选填

返回字段显示值,如 true,实际值为 false,或两者。默认值为 false

sysparmExcludeReferenceLink

布尔值

选填

设置为 true 以排除参考字段的 Table API 链接。默认值为 false

sysparmSuppressPaginationHeader

布尔值

选填

设置为 true 以阻止分页标头。默认值为 false

sysparmFields

string[]

选填

要在响应中返回的字段数组

sysparmLimit

int

选填

每个页面返回的最大结果数。默认值为 10,000

sysparmView

string

选填

根据指定的 UI 视图呈现响应。您可以使用 sysparm_fields 覆盖此参数。

sysparmQueryCategory

string

选填

用于查询的查询类别的名称

sysparmQueryNoDomain

布尔值

选填

将 设置为 true,以在域间访问数据(如果授权)。默认值为 false

sysparmNoCount

布尔值

选填

不要在表中执行所选 countrolebinding。默认值为 false

Expand
表 8.4. 输出参数
Name类型描述

result

record<PropertyKey, unknown>

请求的响应正文

[POST] servicenow:now:table:createRecord

在 Developer Hub 的表中创建记录。

Expand
表 8.5. 输入参数
Name类型要求描述

tableName

string

必填

保存记录的表的名称

requestBody

record<PropertyKey, unknown>

选填

在指定记录中定义的每个参数的字段名称和关联值

sysparmDisplayValue

enum("true", "false", "all")

选填

返回字段显示值,如 true,实际值为 false,或两者。默认值为 false

sysparmExcludeReferenceLink

布尔值

选填

设置为 true 以排除参考字段的 Table API 链接。默认值为 false

sysparmFields

string[]

选填

要在响应中返回的字段数组

sysparmInputDisplayValue

布尔值

选填

使用其显示值(如 true 或实际值)设置字段值,如 false。默认值为 false

sysparmSuppressAutoSysField

布尔值

选填

设置为 true 以禁止自动生成系统字段。默认值为 false

sysparmView

string

选填

根据指定的 UI 视图呈现响应。您可以使用 sysparm_fields 覆盖此参数。

Expand
表 8.6. 输出参数
Name类型描述

result

record<PropertyKey, unknown>

请求的响应正文

[PUT] servicenow:now:table:modifyRecord

修改 Developer Hub 中的表中的记录。

Expand
表 8.7. 输入参数
Name类型要求描述

tableName

string

必填

修改记录的表的名称

sysId

string

必填

要修改的记录的唯一标识符

requestBody

record<PropertyKey, unknown>

选填

在指定记录中定义的每个参数的字段名称和关联值

sysparmDisplayValue

enum("true", "false", "all")

选填

返回字段显示值,如 true,实际值为 false,或两者。默认值为 false

sysparmExcludeReferenceLink

布尔值

选填

设置为 true 以排除参考字段的 Table API 链接。默认值为 false

sysparmFields

string[]

选填

要在响应中返回的字段数组

sysparmInputDisplayValue

布尔值

选填

使用其显示值(如 true 或实际值)设置字段值,如 false。默认值为 false

sysparmSuppressAutoSysField

布尔值

选填

设置为 true 以禁止自动生成系统字段。默认值为 false

sysparmView

string

选填

根据指定的 UI 视图呈现响应。您可以使用 sysparm_fields 覆盖此参数。

sysparmQueryNoDomain

布尔值

选填

将 设置为 true,以在域间访问数据(如果授权)。默认值为 false

Expand
表 8.8. 输出参数
Name类型描述

result

record<PropertyKey, unknown>

请求的响应正文

[PATCH] servicenow:now:table:updateRecord

更新 Developer Hub 中的表中的记录。

Expand
表 8.9. 输入参数
Name类型要求描述

tableName

string

必填

更新记录的表的名称

sysId

string

必填

要更新记录的唯一标识符

requestBody

record<PropertyKey, unknown>

选填

在指定记录中定义的每个参数的字段名称和关联值

sysparmDisplayValue

enum("true", "false", "all")

选填

返回字段显示值,如 true,实际值为 false,或两者。默认值为 false

sysparmExcludeReferenceLink

布尔值

选填

设置为 true 以排除参考字段的 Table API 链接。默认值为 false

sysparmFields

string[]

选填

要在响应中返回的字段数组

sysparmInputDisplayValue

布尔值

选填

使用其显示值(如 true 或实际值)设置字段值,如 false。默认值为 false

sysparmSuppressAutoSysField

布尔值

选填

设置为 true 以禁止自动生成系统字段。默认值为 false

sysparmView

string

选填

根据指定的 UI 视图呈现响应。您可以使用 sysparm_fields 覆盖此参数。

sysparmQueryNoDomain

布尔值

选填

将 设置为 true,以在域间访问数据(如果授权)。默认值为 false

Expand
表 8.10. 输出参数
Name类型描述

result

record<PropertyKey, unknown>

请求的响应正文

[DELETE] servicenow:now:table:deleteRecord

从 Developer Hub 中的表中删除记录。

Expand
表 8.11. 输入参数
Name类型要求描述

tableName

string

必填

从中删除记录的表的名称

sysId

string

必填

要删除记录的唯一标识符

sysparmQueryNoDomain

布尔值

选填

将 设置为 true,以在域间访问数据(如果授权)。默认值为 false

法律通告

Copyright © 2025 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部