feat(qbitrr): generate config file (#12666)

**Description**
Generate config.toml when missing.

⚒️ Fixes  # <!--(issue)-->

**⚙️ 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>
This commit is contained in:
kqmaverick
2023-09-16 12:23:39 -07:00
committed by GitHub
parent 2ae61fff30
commit a3aab588a0
3 changed files with 28 additions and 4 deletions

View File

@@ -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: |

View File

@@ -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}

View File

@@ -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