From 0d1d00050510b029f873419652194919855b332b Mon Sep 17 00:00:00 2001
From: Hleb Valoshka <375gnu@gmail.com>
Date: Wed, 30 Jan 2019 14:33:36 +0300
Subject: [PATCH] [stable/jenkins] Allow to enable OWASP Markup Formatter
Plugin (#10851)
Signed-off-by: Hleb Valoshka <375gnu@gmail.com>
---
charts/jenkins/Chart.yaml | 2 +-
charts/jenkins/README.md | 3 +++
charts/jenkins/templates/config.yaml | 6 ++++++
charts/jenkins/values.yaml | 3 +++
4 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/charts/jenkins/Chart.yaml b/charts/jenkins/Chart.yaml
index e56cf85f9be6..107dd017b0c3 100755
--- a/charts/jenkins/Chart.yaml
+++ b/charts/jenkins/Chart.yaml
@@ -1,6 +1,6 @@
name: jenkins
home: https://jenkins.io/
-version: 0.28.10
+version: 0.28.11
appVersion: lts
description: Open source continuous integration server. It supports multiple SCM tools
including CVS, Subversion and Git. It can execute Apache Ant and Apache Maven-based
diff --git a/charts/jenkins/README.md b/charts/jenkins/README.md
index e7f33788d22e..f321afdc2aad 100644
--- a/charts/jenkins/README.md
+++ b/charts/jenkins/README.md
@@ -80,6 +80,7 @@ The following tables list the configurable parameters of the Jenkins chart and t
| `Master.SecretsFilesSecret` | Kubernetes secret that contains 'secrets' files | Not set |
| `Master.Jobs` | Jenkins XML job configs | Not set |
| `Master.InstallPlugins` | List of Jenkins plugins to install | `kubernetes:1.14.0 workflow-aggregator:2.6 credentials-binding:1.17 git:3.9.1 workflow-job:2.31` |
+| `Master.EnableRawHtmlMarkupFormatter` | Enable HTML parsing using (see below) | Not set |
| `Master.ScriptApproval` | List of groovy functions to approve | Not set |
| `Master.NodeSelector` | Node labels for pod assignment | `{}` |
| `Master.Affinity` | Affinity settings | `{}` |
@@ -92,6 +93,8 @@ The following tables list the configurable parameters of the Jenkins chart and t
| `rbac.roleKind` | Role kind (`Role` or `ClusterRole`)| `ClusterRole`
| `rbac.roleBindingKind` | Role binding kind (`RoleBinding` or `ClusterRoleBinding`)| `ClusterRoleBinding` |
+Some third-party systems, e.g. GitHub, use HTML-formatted data in their payload sent to a Jenkins webhooks, e.g. URL of a pull-request being built. To display such data as processed HTML instead of raw text set `Master.EnableRawHtmlMarkupFormatter` to true. This option requires installation of OWASP Markup Formatter Plugin (antisamy-markup-formatter). The plugin is **not** installed by default, please update `Master.InstallPlugins`.
+
### Jenkins Agent
| Parameter | Description | Default |
diff --git a/charts/jenkins/templates/config.yaml b/charts/jenkins/templates/config.yaml
index ae2446974740..e67276f1ae1a 100644
--- a/charts/jenkins/templates/config.yaml
+++ b/charts/jenkins/templates/config.yaml
@@ -29,7 +29,13 @@ data:
${JENKINS_HOME}/workspace/${ITEM_FULLNAME}
${ITEM_ROOTDIR}/builds
+{{- if .Values.Master.EnableRawHtmlMarkupFormatter }}
+
+ true
+
+{{- else }}
+{{- end }}
diff --git a/charts/jenkins/values.yaml b/charts/jenkins/values.yaml
index 30d4c748bda3..4a4b87de3aa1 100644
--- a/charts/jenkins/values.yaml
+++ b/charts/jenkins/values.yaml
@@ -123,6 +123,9 @@ Master:
- workflow-aggregator:2.6
- credentials-binding:1.17
- git:3.9.1
+ # Enable HTML parsing using OWASP Markup Formatter Plugin (antisamy-markup-formatter), useful with ghprb plugin.
+ # The plugin is not installed by default, please update Master.InstallPlugins.
+ # EnableRawHtmlMarkupFormatter: true
# Used to approve a list of groovy functions in pipelines used the script-security plugin. Can be viewed under /scriptApproval
# ScriptApproval:
# - "method groovy.json.JsonSlurperClassic parseText java.lang.String"