This is an automated email from the ASF dual-hosted git repository.

lewismc pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tika-helm.git


The following commit(s) were added to refs/heads/main by this push:
     new 48b0b50  Allow additional configuration files in ConfigMap (#27)
48b0b50 is described below

commit 48b0b5072820046834e72deb92baf3269e97b11a
Author: Ronan Giron <[email protected]>
AuthorDate: Tue Feb 10 20:08:35 2026 +0100

    Allow additional configuration files in ConfigMap (#27)
    
    * Allow additional configuration files in ConfigMap
    
    * Revert "Allow additional configuration files in ConfigMap"
    
    This reverts commit bf98503b8fb86f2a21d6fcc84cff06dca6b0db60.
    
    * Fix README.md
    
    * Fix README.md
---
 README.md                | 17 +++++++++++++++++
 README.md.gotmpl         | 17 +++++++++++++++++
 templates/configmap.yaml |  7 ++++++-
 values.yaml              | 14 ++++++++++++++
 4 files changed, 54 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 1fd4288..d29146f 100644
--- a/README.md
+++ b/README.md
@@ -80,10 +80,14 @@ while true; do kubectl --namespace tika-test port-forward 
$POD_NAME 9998:$CONTAI
 
 To use custom [configuration]( https://tika.apache.org/2.9.1/configuring.html) 
values for apache tika, use the `tikaConfig` key in the `values.yaml`.
 Example:
+
 ```
 tikaConfig: |
   <?xml version="1.0" encoding="UTF-8"?>
   <properties>
+    <mtrandata>
+      <mime-table-path>/tika-config/custom-mimetypes.xml</mime-table-path>
+    </mtrandata>
     <parsers>
       <!-- Default Parser for most things, except for 2 mime types -->
       <parser class="org.apache.tika.parser.DefaultParser">
@@ -92,7 +96,20 @@ tikaConfig: |
       </parser>
     </parsers>
   </properties>
+
+additionalConfigs:
+  custom-mimetypes.xml: |
+    <?xml version="1.0" encoding="UTF-8"?>
+    <mime-info>
+      <mime-type type="application/pdf">
+        <magic priority="80">
+          <match value="%PDF-" type="string" offset="0:8192"/>
+        </magic>
+        <glob pattern="*.pdf"/>
+      </mime-type>
+    </mime-info>
 ```
+
 ## Upgrading
 
 Please check `artifacthub.io/changes` in `Chart.yaml` before upgrading.
diff --git a/README.md.gotmpl b/README.md.gotmpl
index d74ed6b..e8cc77f 100644
--- a/README.md.gotmpl
+++ b/README.md.gotmpl
@@ -80,10 +80,14 @@ while true; do kubectl --namespace tika-test port-forward 
$POD_NAME 9998:$CONTAI
 
 To use custom [configuration]( https://tika.apache.org/2.9.1/configuring.html) 
values for apache tika, use the `tikaConfig` key in the `values.yaml`.
 Example:
+
 ```
 tikaConfig: |
   <?xml version="1.0" encoding="UTF-8"?>
   <properties>
+    <mtrandata>
+      <mime-table-path>/tika-config/custom-mimetypes.xml</mime-table-path>
+    </mtrandata>
     <parsers>
       <!-- Default Parser for most things, except for 2 mime types -->
       <parser class="org.apache.tika.parser.DefaultParser">
@@ -92,7 +96,20 @@ tikaConfig: |
       </parser>
     </parsers>
   </properties>
+
+additionalConfigs:
+  custom-mimetypes.xml: |
+    <?xml version="1.0" encoding="UTF-8"?>
+    <mime-info>
+      <mime-type type="application/pdf">
+        <magic priority="80">
+          <match value="%PDF-" type="string" offset="0:8192"/>
+        </magic>
+        <glob pattern="*.pdf"/>
+      </mime-type>
+    </mime-info>
 ```
+
 ## Upgrading
 
 Please check `artifacthub.io/changes` in `Chart.yaml` before upgrading.
diff --git a/templates/configmap.yaml b/templates/configmap.yaml
index b588c95..830604b 100644
--- a/templates/configmap.yaml
+++ b/templates/configmap.yaml
@@ -16,13 +16,18 @@
 # under the License.
 
 ---
-{{- if .Values.tikaConfig }}
+{{- if or .Values.tikaConfig .Values.additionalConfigs }}
 apiVersion: v1
 kind: ConfigMap
 metadata:
   name: {{ .Chart.Name }}-config
   namespace: {{ include "tika-helm.namespace" . }}
 data:
+  {{- if .Values.tikaConfig }}
   tika-config.xml: |-
 {{ .Values.tikaConfig | indent 4 }}
+  {{- end }}
+  {{- if .Values.additionalConfigs }}
+{{ toYaml .Values.additionalConfigs | indent 2 }}
+  {{- end }}
 {{- end }}
\ No newline at end of file
diff --git a/values.yaml b/values.yaml
index 2f139af..d450c16 100644
--- a/values.yaml
+++ b/values.yaml
@@ -182,6 +182,9 @@ config:
 # tikaConfig: |
 #   <?xml version="1.0" encoding="UTF-8"?>
 #   <properties>
+#     <mtrandata>
+#       <mime-table-path>/tika-config/custom-mimetypes.xml</mime-table-path>
+#     </mtrandata>
 #     <parsers>
 #       <!-- Default Parser for most things, except for 2 mime
 #         types, and never use the Executable Parser -->
@@ -197,3 +200,14 @@ config:
 #       </parser>
 #     </parsers>
 #   </properties>
+# additionalConfigs:
+#   custom-mimetypes.xml: |
+#     <?xml version="1.0" encoding="UTF-8"?>
+#     <mime-info>
+#       <mime-type type="application/pdf">
+#         <magic priority="80">
+#           <match value="%PDF-" type="string" offset="0:8192"/>
+#         </magic>
+#         <glob pattern="*.pdf"/>
+#       </mime-type>
+#     </mime-info>

Reply via email to