From 3b007f9cedf233efe9f45decf8909ebea3fd3d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Flore-Th=C3=A9bault?= Date: Thu, 10 Apr 2025 14:25:44 +0200 Subject: [PATCH 1/9] RHIDP-6499 Modularize modules/customizing-the-learning-paths/proc-customize-rhdh-learning-paths.adoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabrice Flore-Thébault --- ...sembly-customizing-the-learning-paths.adoc | 15 ++++ .../proc-customize-rhdh-learning-paths.adoc | 82 ------------------- ...ng-paths-by-using-a-dedicated-service.adoc | 23 ++++++ ...ning-paths-by-using-hosted-json-files.adoc | 45 ++++++++++ titles/customizing/master.adoc | 2 +- 5 files changed, 84 insertions(+), 83 deletions(-) create mode 100644 assemblies/assembly-customizing-the-learning-paths.adoc delete mode 100644 modules/customizing-the-learning-paths/proc-customize-rhdh-learning-paths.adoc create mode 100644 modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-a-dedicated-service.adoc create mode 100644 modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc diff --git a/assemblies/assembly-customizing-the-learning-paths.adoc b/assemblies/assembly-customizing-the-learning-paths.adoc new file mode 100644 index 0000000000..d4762b93f8 --- /dev/null +++ b/assemblies/assembly-customizing-the-learning-paths.adoc @@ -0,0 +1,15 @@ +[id='proc-customize-rhdh-learning-paths_{context}'] += Customizing the Learning Paths in {product} + +In {product}, you can configure Learning Paths by hosting the required data externally, +and using the builtin proxy to deliver this data rather than the default. + +You can provide Learning Paths data from the following sources: + +* JSON files hosted on a web server, such as GitHub or GitLab. +* A dedicated service that provides the Learning Paths data in JSON format using an API. + +include::modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc[leveloffset=+1] + + +include::modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-a-dedicated-service.adoc[leveloffset=+1] diff --git a/modules/customizing-the-learning-paths/proc-customize-rhdh-learning-paths.adoc b/modules/customizing-the-learning-paths/proc-customize-rhdh-learning-paths.adoc deleted file mode 100644 index 2ae0faf956..0000000000 --- a/modules/customizing-the-learning-paths/proc-customize-rhdh-learning-paths.adoc +++ /dev/null @@ -1,82 +0,0 @@ -[id='proc-customize-rhdh-learning-paths_{context}'] -= Customizing the Learning Paths in {product} - -In {product}, you can configure Learning Paths by passing the data into the `{my-app-config-file}` file as a proxy. The base URL must include the `/developer-hub/learning-paths` proxy. - -[NOTE] -==== -Due to the use of overlapping `pathRewrites` for both the `learning-path` and `homepage` quick access proxies, you must create the `learning-paths` configuration (`^api/proxy/developer-hub/learning-paths`) before you create the `homepage` configuration (`^/api/proxy/developer-hub`). - -For more information about customizing the Home page in {product}, see xref:customizing-the-home-page[Customizing the Home page in {product}]. -==== - -You can provide data to the Learning Path from the following sources: - -* JSON files hosted on GitHub or GitLab. -* A dedicated service that provides the Learning Path data in JSON format using an API. - -== Using hosted JSON files to provide data to the Learning Paths - -.Prerequisites - -You have installed {product} by using either the Operator or Helm chart. -For more information, see xref:{installing-on-ocp-book-url}#assembly-install-rhdh-ocp[{installing-on-ocp-book-title}]. - -.Procedure - -To access the data from the JSON files, complete the following step: - -* Add the following code to the `{my-app-config-file}` file: -+ -[source,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 ----- - -== Using a dedicated service to provide data to the Learning Paths - -When using a dedicated service, you can do the following: - -* Use the same service to provide the data to all configurable {product-short} pages or use a different service for each page. -* Use the https://github.com/redhat-developer/red-hat-developer-hub-customization-provider[`red-hat-developer-hub-customization-provider`] as an example service, which provides data for both the Home and Tech Radar pages. The `red-hat-developer-hub-customization-provider` service provides the same data as default {product-short} data. You can fork the `red-hat-developer-hub-customization-provider` service repository from GitHub and modify it with your own data, if required. -* Deploy the `red-hat-developer-hub-customization-provider` service and the {product-short} Helm chart on the same cluster. - -.Prerequisites - -* You have installed the {product} using Helm chart. -For more information, see xref:{installing-on-ocp-book-url}#assembly-install-rhdh-ocp[{installing-on-ocp-book-title}]. - -.Procedure - -To use a dedicated service to provide the Learning Path data, complete the following steps: - -. Add the following code to the link:{configuring-book-url}[`{my-app-config-file}` file]: -+ -[source,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 ----- -where the `LEARNING_PATH_DATA_URL` is defined as `pass:c[http:///learning-paths]`, for example, `pass:c[http://rhdh-customization-provider/learning-paths]`. -+ -[NOTE] -==== -You can define the `LEARNING_PATH_DATA_URL` by adding it to `rhdh-secrets` or by directly replacing it with its value in your custom ConfigMap. -==== -+ -. Delete the {product-short} pod to ensure that the new configurations are loaded correctly. diff --git a/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-a-dedicated-service.adoc b/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-a-dedicated-service.adoc new file mode 100644 index 0000000000..fae345929c --- /dev/null +++ b/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-a-dedicated-service.adoc @@ -0,0 +1,23 @@ +[id='proc-customizing-the-learning-paths-by-using-a-customization-service_{context}'] += Customizing the Learning Paths by using a customization service + +For advanced scenarios, you can host your {product} customization service to provide data to all configurable {product-short} pages. +You can even use a different service for each page. + +.Procedure +. Deploy your {product-short} customization service on the same {ocp-short} cluster as your {product-short} instance. +You can find an example at link:https://github.com/redhat-developer/red-hat-developer-hub-customization-provider[`red-hat-developer-hub-customization-provider`], that provides the same data as default {product-short} data. +The customization service provides a Learning Paths data URL such as: `pass:c[http://rhdh-customization-provider/learning-paths]`. + +. Configure the {product-short} proxy to use your dedicated service to provide the Learning Path data, add the following to the link:{configuring-book-url}[`{my-app-config-file}` file]: ++ +[source,yaml,subs='+quotes'] +---- +proxy: + endpoints: + '/developer-hub/learning-paths': + target: __ + changeOrigin: true + qsecure: true # <1> +---- +<1> Change to "false" in case of using self hosted cluster with a self-signed certificate diff --git a/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc b/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc new file mode 100644 index 0000000000..567573f6f2 --- /dev/null +++ b/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc @@ -0,0 +1,45 @@ +[id='proc-customize-rhdh-learning-paths_{context}'] += Customizing the Learning Paths by using hosted JSON files + +For ease of use and simplicity, you can configure the Learning Paths by using hosted JSON files. + + +.Procedure +. Publish the JSON files containing your Learning Paths data to a web server, such as GitHub or Gitlab. You can find an example at link:https://raw.githubusercontent.com/redhat-developer/rhdh/main/packages/app/public/learning-paths/data.json[]. + +. Configure the {product-short} proxy to access the Learning Paths data from the hosted JSON files, by adding the following code to the `{my-app-config-file}` file: ++ +[source,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' + changeOrigin: true + secure: true +---- ++ +[TIP] +==== +When also configuring the home page, due to the use of overlapping `pathRewrites` for both the `learning-path` and `homepage` quick access proxies, create the `learning-paths` configuration (`^api/proxy/developer-hub/learning-paths`) before you create the `homepage` configuration (`^/api/proxy/developer-hub`). +For example: + +[source,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 +---- +==== + +.Additional resources +* xref:customizing-the-home-page[Customizing the Home page in {product}]. diff --git a/titles/customizing/master.adoc b/titles/customizing/master.adoc index 3b54976696..ec64fabc59 100644 --- a/titles/customizing/master.adoc +++ b/titles/customizing/master.adoc @@ -20,7 +20,7 @@ include::modules/customizing/proc-customizing-the-backend-secret.adoc[leveloffse include::assemblies/assembly-configuring-templates.adoc[leveloffset=+1] -include::modules/customizing-the-learning-paths/proc-customize-rhdh-learning-paths.adoc[leveloffset=+1] +include::assemblies/assembly-customizing-the-learning-paths.adoc[leveloffset=+1] include::assemblies/assembly-configuring-the-global-header.adoc[leveloffset=+1] From e37e75e70f0be82327480a785fc1ffc426d499e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Flore-Th=C3=A9bault?= Date: Thu, 10 Apr 2025 14:52:02 +0200 Subject: [PATCH 2/9] Update assemblies/assembly-customizing-the-learning-paths.adoc --- assemblies/assembly-customizing-the-learning-paths.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assemblies/assembly-customizing-the-learning-paths.adoc b/assemblies/assembly-customizing-the-learning-paths.adoc index d4762b93f8..1ffa8b8aaf 100644 --- a/assemblies/assembly-customizing-the-learning-paths.adoc +++ b/assemblies/assembly-customizing-the-learning-paths.adoc @@ -2,7 +2,7 @@ = Customizing the Learning Paths in {product} In {product}, you can configure Learning Paths by hosting the required data externally, -and using the builtin proxy to deliver this data rather than the default. +and using the built-in proxy to deliver this data rather than the default. You can provide Learning Paths data from the following sources: From c8bc3717d870b461ff7cf940f1cbc9feb4113766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Flore-Th=C3=A9bault?= Date: Thu, 10 Apr 2025 15:37:49 +0200 Subject: [PATCH 3/9] Update modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc --- ...the-learning-paths-by-using-hosted-json-files.adoc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc b/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc index 567573f6f2..b441b5d055 100644 --- a/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc +++ b/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc @@ -1,13 +1,12 @@ -[id='proc-customize-rhdh-learning-paths_{context}'] -= Customizing the Learning Paths by using hosted JSON files - -For ease of use and simplicity, you can configure the Learning Paths by using hosted JSON files. +[id='proc-customizing-the-learning-paths-by-using-a-hosted-json-file_{context}'] += Customizing the Learning Paths by using a hosted JSON file +For ease of use and simplicity, you can configure the Learning Paths by using a hosted JSON file. .Procedure -. Publish the JSON files containing your Learning Paths data to a web server, such as GitHub or Gitlab. You can find an example at link:https://raw.githubusercontent.com/redhat-developer/rhdh/main/packages/app/public/learning-paths/data.json[]. +. Publish the JSON file containing your Learning Paths data to a web server, such as GitHub or Gitlab. You can find an example at link:https://raw.githubusercontent.com/redhat-developer/rhdh/main/packages/app/public/learning-paths/data.json[]. -. Configure the {product-short} proxy to access the Learning Paths data from the hosted JSON files, by adding the following code to the `{my-app-config-file}` file: +. Configure the {product-short} proxy to access the Learning Paths data from the hosted JSON file, by adding the following code to the `{my-app-config-file}` file: + [source,yaml] ---- From f7a461a809f5a93e07b38f00f0c6607a5cd57bcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Flore-Th=C3=A9bault?= Date: Thu, 10 Apr 2025 15:38:21 +0200 Subject: [PATCH 4/9] Update assemblies/assembly-customizing-the-learning-paths.adoc --- assemblies/assembly-customizing-the-learning-paths.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assemblies/assembly-customizing-the-learning-paths.adoc b/assemblies/assembly-customizing-the-learning-paths.adoc index 1ffa8b8aaf..b70fc33aac 100644 --- a/assemblies/assembly-customizing-the-learning-paths.adoc +++ b/assemblies/assembly-customizing-the-learning-paths.adoc @@ -6,7 +6,7 @@ and using the built-in proxy to deliver this data rather than the default. You can provide Learning Paths data from the following sources: -* JSON files hosted on a web server, such as GitHub or GitLab. +* A JSON file hosted on a web server, such as GitHub or GitLab. * A dedicated service that provides the Learning Paths data in JSON format using an API. include::modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc[leveloffset=+1] From 5d683c20088ae9df6142b3188bf1e8a7fb3bd850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Flore-Th=C3=A9bault?= Date: Thu, 10 Apr 2025 15:49:54 +0200 Subject: [PATCH 5/9] Update modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc --- ...stomizing-the-learning-paths-by-using-hosted-json-files.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc b/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc index b441b5d055..359518d237 100644 --- a/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc +++ b/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc @@ -4,7 +4,7 @@ For ease of use and simplicity, you can configure the Learning Paths by using a hosted JSON file. .Procedure -. Publish the JSON file containing your Learning Paths data to a web server, such as GitHub or Gitlab. You can find an example at link:https://raw.githubusercontent.com/redhat-developer/rhdh/main/packages/app/public/learning-paths/data.json[]. +. Publish the JSON file containing your Learning Paths data to a web server, such as GitHub or Gitlab. You can find an example at link:https://raw.githubusercontent.com/redhat-developer/rhdh/release-{product-version}/packages/app/public/learning-paths/data.json[]. . Configure the {product-short} proxy to access the Learning Paths data from the hosted JSON file, by adding the following code to the `{my-app-config-file}` file: + From 57bb6410f643f942c5d2e4ddf8e8236736d766d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Flore-Th=C3=A9bault?= Date: Thu, 10 Apr 2025 15:52:39 +0200 Subject: [PATCH 6/9] Update modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc --- ...stomizing-the-learning-paths-by-using-hosted-json-files.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc b/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc index 359518d237..834b57928a 100644 --- a/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc +++ b/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc @@ -6,7 +6,7 @@ For ease of use and simplicity, you can configure the Learning Paths by using a .Procedure . Publish the JSON file containing your Learning Paths data to a web server, such as GitHub or Gitlab. You can find an example at link:https://raw.githubusercontent.com/redhat-developer/rhdh/release-{product-version}/packages/app/public/learning-paths/data.json[]. -. Configure the {product-short} proxy to access the Learning Paths data from the hosted JSON file, by adding the following code to the `{my-app-config-file}` file: +. Configure the {product-short} proxy to access the Learning Paths data from the hosted JSON file, by adding the following to the `{my-app-config-file}` file: + [source,yaml] ---- From e11c238eb01b21bf47454bfb936fde3015e931cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Flore-Th=C3=A9bault?= Date: Thu, 10 Apr 2025 16:00:04 +0200 Subject: [PATCH 7/9] Update modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc --- ...the-learning-paths-by-using-hosted-json-files.adoc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc b/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc index 834b57928a..8fdc190bdb 100644 --- a/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc +++ b/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc @@ -8,17 +8,22 @@ For ease of use and simplicity, you can configure the Learning Paths by using a . Configure the {product-short} proxy to access the Learning Paths data from the hosted JSON file, by adding the following to the `{my-app-config-file}` file: + -[source,yaml] +[source,yaml,subs='+quotes'] ---- proxy: endpoints: '/developer-hub': - target: https://raw.githubusercontent.com/ + target: __ pathRewrite: - '^/api/proxy/developer-hub/learning-paths': '/redhat-developer/rhdh/main/packages/app/public/learning-paths/data.json' + '^/api/proxy/developer-hub/learning-paths': '__' changeOrigin: true secure: true ---- + +`__`:: Enter the hosted JSON file base URL, such as `https://raw.githubusercontent.com`. + +`__`:: Enter the hosted JSON file path without the base URL, such as +`'/redhat-developer/rhdh/main/packages/app/public/learning-paths/data.json'` + [TIP] ==== From 884b75bdfe68a8e52c0ee4bd64169e29afa02046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Flore-Th=C3=A9bault?= Date: Thu, 10 Apr 2025 16:08:16 +0200 Subject: [PATCH 8/9] Update modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-a-dedicated-service.adoc --- ...omizing-the-learning-paths-by-using-a-dedicated-service.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-a-dedicated-service.adoc b/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-a-dedicated-service.adoc index fae345929c..22d6d1d593 100644 --- a/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-a-dedicated-service.adoc +++ b/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-a-dedicated-service.adoc @@ -7,7 +7,7 @@ You can even use a different service for each page. .Procedure . Deploy your {product-short} customization service on the same {ocp-short} cluster as your {product-short} instance. You can find an example at link:https://github.com/redhat-developer/red-hat-developer-hub-customization-provider[`red-hat-developer-hub-customization-provider`], that provides the same data as default {product-short} data. -The customization service provides a Learning Paths data URL such as: `pass:c[http://rhdh-customization-provider/learning-paths]`. +The customization service provides a Learning Paths data URL such as: `pass:c,a,q[http://__/learning-paths]`. . Configure the {product-short} proxy to use your dedicated service to provide the Learning Path data, add the following to the link:{configuring-book-url}[`{my-app-config-file}` file]: + From ff0bb7554429ceed87010ac9bc4077bb2ebc521c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Flore-Th=C3=A9bault?= Date: Thu, 10 Apr 2025 16:11:18 +0200 Subject: [PATCH 9/9] Update modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-a-dedicated-service.adoc --- ...omizing-the-learning-paths-by-using-a-dedicated-service.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-a-dedicated-service.adoc b/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-a-dedicated-service.adoc index 22d6d1d593..7e07c05fe7 100644 --- a/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-a-dedicated-service.adoc +++ b/modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-a-dedicated-service.adoc @@ -1,7 +1,7 @@ [id='proc-customizing-the-learning-paths-by-using-a-customization-service_{context}'] = Customizing the Learning Paths by using a customization service -For advanced scenarios, you can host your {product} customization service to provide data to all configurable {product-short} pages. +For advanced scenarios, you can host your {product} customization service to provide data to all configurable {product-short} pages, such as the Learning Paths. You can even use a different service for each page. .Procedure