From c69017bdb7016bd245d7a766983734d19dff271c Mon Sep 17 00:00:00 2001 From: StevenMcElligott <89483932+StevenMcElligott@users.noreply.github.com> Date: Fri, 28 Jul 2023 18:25:58 -0400 Subject: [PATCH] migrate(searxng): Migrate to New Common (#10851) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** Another one ⚒️ Fixes # **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [X] 🪛 Bugfix - [X] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** **📃 Notes:** **✔️ Checklist:** - [ ] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [ ] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --------- Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> --- charts/incubator/searxng/Chart.yaml | 4 +- charts/incubator/searxng/questions.yaml | 78 +++++++++---------- charts/incubator/searxng/templates/NOTES.txt | 1 + .../incubator/searxng/templates/common.yaml | 2 +- charts/incubator/searxng/values.yaml | 43 +++++++--- 5 files changed, 74 insertions(+), 54 deletions(-) create mode 100644 charts/incubator/searxng/templates/NOTES.txt diff --git a/charts/incubator/searxng/Chart.yaml b/charts/incubator/searxng/Chart.yaml index a037f724391..8dbc1b4ce82 100644 --- a/charts/incubator/searxng/Chart.yaml +++ b/charts/incubator/searxng/Chart.yaml @@ -3,7 +3,7 @@ appVersion: "latest" dependencies: - name: common repository: https://library-charts.truecharts.org - version: 11.1.2 + version: 13.2.1 deprecated: false description: Meta search engine which aggregates results from more than 70 search services. home: https://truecharts.org/charts/incubator/searxng @@ -22,7 +22,7 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/incubator/searxng - https://github.com/searxng/searxng type: application -version: 2.0.21 +version: 3.0.0 annotations: truecharts.org/catagories: | - Productivity diff --git a/charts/incubator/searxng/questions.yaml b/charts/incubator/searxng/questions.yaml index 2e2c522af38..55b25f18024 100644 --- a/charts/incubator/searxng/questions.yaml +++ b/charts/incubator/searxng/questions.yaml @@ -13,25 +13,25 @@ questions: # Include{containerBasic} # Include{containerAdvanced} - - variable: env - group: App Configuration - label: Image Environment - schema: - additional_attrs: true - type: dict - attrs: - - variable: INSTANCE_NAME - label: Instance Name - description: Your SearXNG instance name - schema: - type: string - default: SearXng - - variable: BASE_URL - label: Base URL - description: Set base url like so https://search.mydomain.com - schema: - type: string - default: "" + - variable: env + group: App Configuration + label: Image Environment + schema: + additional_attrs: true + type: dict + attrs: + - variable: INSTANCE_NAME + label: Instance Name + description: Your SearXNG instance name + schema: + type: string + default: SearXng + - variable: BASE_URL + label: Base URL + description: Set base url like so https://search.mydomain.com + schema: + type: string + default: "" # Include{containerConfig} # Include{serviceRoot} - variable: main @@ -71,7 +71,7 @@ questions: # Include{persistenceList} # Include{ingressRoot} - variable: main - label: Main Ingress + label: "Main Ingress" schema: additional_attrs: true type: dict @@ -81,29 +81,29 @@ questions: # Include{ingressTraefik} # Include{ingressAdvanced} # Include{ingressList} +# Include{securityContextRoot} -# Include{podSecurityContextRoot} - - variable: runAsUser - label: runAsUser - description: The UserID of the user running the application - schema: - type: int - default: 0 - - variable: runAsGroup - label: runAsGroup - description: The groupID this App of the user running the application - schema: - type: int - default: 0 + - variable: runAsUser + label: "runAsUser" + description: "The UserID this App of the user running the application" + schema: + type: int + default: 0 + - variable: runAsGroup + label: "runAsGroup" + description: "The groupID this App of the user running the application" + schema: + type: int + default: 0 # Include{securityContextContainer} # Include{securityContextAdvanced} # Include{securityContextPod} - - variable: fsGroup - label: fsGroup - description: The group that should own ALL storage. - schema: - type: int - default: 568 + - variable: fsGroup + label: "fsGroup" + description: "The group that should own ALL storage." + schema: + type: int + default: 568 # Include{resources} # Include{advanced} diff --git a/charts/incubator/searxng/templates/NOTES.txt b/charts/incubator/searxng/templates/NOTES.txt new file mode 100644 index 00000000000..efcb74cb772 --- /dev/null +++ b/charts/incubator/searxng/templates/NOTES.txt @@ -0,0 +1 @@ +{{- include "tc.v1.common.lib.chart.notes" $ -}} diff --git a/charts/incubator/searxng/templates/common.yaml b/charts/incubator/searxng/templates/common.yaml index cbf66c20818..78d963fb168 100644 --- a/charts/incubator/searxng/templates/common.yaml +++ b/charts/incubator/searxng/templates/common.yaml @@ -1,2 +1,2 @@ {{/* Render the templates */}} -{{ include "tc.common.loader.all" . }} +{{ include "tc.v1.common.loader.all" . }} diff --git a/charts/incubator/searxng/values.yaml b/charts/incubator/searxng/values.yaml index 43da7bdd162..a1fb1421f72 100644 --- a/charts/incubator/searxng/values.yaml +++ b/charts/incubator/searxng/values.yaml @@ -3,25 +3,43 @@ image: repository: tccr.io/truecharts/searxng tag: latest@sha256:1a312a8c4f11a203edd2b5f41eb13d0faeda00aa3c40e2e833be47b6ea9659ea -env: - BASE_URL: "" - INSTANCE_NAME: SearXng - -podSecurityContext: - runAsGroup: 0 - runAsUser: 0 +workload: + main: + podSpec: + containers: + main: + env: + BIND_ADDRESS: '{{ printf "0.0.0.0:%v" .Values.service.main.ports.main.port }}' + INSTANCE_NAME: SearXng + BASE_URL: "" + probes: + liveness: + path: /healthz + port: '{{ .Values.service.main.ports.main.port }}' + readiness: + path: /healthz + port: '{{ .Values.service.main.ports.main.port }}' + startup: + type: tcp + port: '{{ .Values.service.main.ports.main.port }}' securityContext: - readOnlyRootFilesystem: false - runAsNonRoot: false + container: + runAsGroup: 0 + runAsUser: 0 + capabilities: + disableS6Caps: true + + add: + - SETUID + - SETGID service: main: ports: main: port: 8080 - protocol: TCP - targetPort: 8080 + protocol: http persistence: config: @@ -29,4 +47,5 @@ persistence: mountPath: /etc/searxng portal: - enabled: true + open: + enabled: true