From a3aab588a0f85b60df51e73ab93db01ce5147eea Mon Sep 17 00:00:00 2001 From: kqmaverick <121722567+kqmaverick@users.noreply.github.com> Date: Sat, 16 Sep 2023 12:23:39 -0700 Subject: [PATCH] feat(qbitrr): generate config file (#12666) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** Generate config.toml when missing. ⚒️ Fixes # **⚙️ Type of change** - [X] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ 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:** I may need lots of help on this one. **✔️ 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 - [X] ⬆️ 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: kqmaverick <121722567+kqmaverick@users.noreply.github.com> Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> --- charts/incubator/qbitrr/Chart.yaml | 2 +- charts/incubator/qbitrr/questions.yaml | 4 ++-- charts/incubator/qbitrr/values.yaml | 26 +++++++++++++++++++++++++- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/charts/incubator/qbitrr/Chart.yaml b/charts/incubator/qbitrr/Chart.yaml index 79391175f44..1cb3582ae80 100644 --- a/charts/incubator/qbitrr/Chart.yaml +++ b/charts/incubator/qbitrr/Chart.yaml @@ -22,7 +22,7 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/incubator/qbitrr - https://github.com/Feramance/Qbitrr type: application -version: 0.0.3 +version: 0.0.4 annotations: truecharts.org/SCALE-support: "true" truecharts.org/catagories: | diff --git a/charts/incubator/qbitrr/questions.yaml b/charts/incubator/qbitrr/questions.yaml index 83e40095181..111363cd1e6 100644 --- a/charts/incubator/qbitrr/questions.yaml +++ b/charts/incubator/qbitrr/questions.yaml @@ -41,13 +41,13 @@ questions: description: "The UserID of the user running the application" schema: type: int - default: 568 + default: 0 - variable: runAsGroup label: "runAsGroup" description: "The groupID this App of the user running the application" schema: type: int - default: 568 + default: 0 # Include{securityContextContainer} # Include{securityContextAdvanced} # Include{securityContextPod} diff --git a/charts/incubator/qbitrr/values.yaml b/charts/incubator/qbitrr/values.yaml index da4f9f563c9..1ecc1a668b1 100644 --- a/charts/incubator/qbitrr/values.yaml +++ b/charts/incubator/qbitrr/values.yaml @@ -5,6 +5,9 @@ image: securityContext: container: readOnlyRootFilesystem: false + runAsNonRoot: false + runAsUser: 0 + runAsGroup: 0 service: main: @@ -16,6 +19,24 @@ service: workload: main: podSpec: + initContainers: + 1-create-config-file: + type: install + enabled: true + imageSelector: "image" + command: + - /bin/sh + - -c + args: + - | + conf="/config/config.toml" + example="https://raw.githubusercontent.com/Feramance/qBitrr/master/config.example.toml" + if [ -f "$conf" ]; then + echo "$conf exists. Skipping..." + else + echo "$conf does not exist... Downloading the example from upstream..." + wget "$example" -O $conf || echo "Failed to download" + fi containers: main: probes: @@ -30,6 +51,10 @@ persistence: config: enabled: true mountPath: /config + targetSelector: + main: + main: {} + 1-create-config-file: {} downloads: enabled: true mountPath: /completed_downloads @@ -37,4 +62,3 @@ persistence: portal: open: enabled: false -