feat(qbittorrent): add port forward sidecar (#14577)

**Description**
Adds an automatic port forward sidecar script.

⚒️ 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:**

**✔️ 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: Xstar97TheNoob <9399967+xstar97@users.noreply.github.com>
Signed-off-by: kqmaverick <121722567+kqmaverick@users.noreply.github.com>
Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
Co-authored-by: Xstar97TheNoob <9399967+xstar97@users.noreply.github.com>
Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
This commit is contained in:
kqmaverick
2023-11-19 20:39:34 +02:00
committed by GitHub
co-authored by Xstar97TheNoob Stavros Kois
parent c3c56cf5a3
commit c5760a5864
4 changed files with 74 additions and 18 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ sources:
- https://github.com/truecharts/charts/tree/master/charts/stable/qbittorrent
- https://github.com/qbittorrent/qBittorrent
type: application
version: 16.0.12
version: 16.1.0
annotations:
truecharts.org/category: media
truecharts.org/SCALE-support: "true"
+28
View File
@@ -16,6 +16,34 @@ questions:
# Include{containerAdvanced}
# Include{containerConfig}
- variable: qbitportforward
group: App Configuration
label: Gluetun Port Forwarding
schema:
additional_attrs: true
type: dict
attrs:
- variable: enabled
label: Enable Gluetun Port Forwarding Automation
description: Enable and configure Gluetun Port Forwarding Automation.
schema:
type: boolean
default: false
show_subquestions_if: true
subquestions:
- variable: QBT_USERNAME
label: qBittorrent Username
description: qBittorrent WebUI Username
schema:
type: string
default: "admin"
- variable: QBT_PASSWORD
label: qBittorrent Password
description: qBittorrent WebUI Password
schema:
type: string
default: "adminadmin"
# Include{podOptions}
# Include{serviceRoot}
# Include{serviceMain}
@@ -1,13 +1,10 @@
{{/* Make sure all variables are set properly */}}
{{- include "tc.v1.common.loader.init" . }}
{{/* Set it to the same port as "torrent" service/port */}}
{{- $_ := set $.Values.service.torrent.ports.torrentudp "port" .Values.service.torrent.ports.torrent.port -}}
{{/* Render configmap for vaultwarden */}}
{{- $configmap := include "qbittorrent.configmap" . | fromYaml -}}
{{- if $configmap -}}
{{- $_ := set .Values.configmap "qbittorrent-scripts" $configmap -}}
{{/* Disable [qbitportforward] if requested */}}
{{- if not .Values.qbitportforward.enabled -}}
{{- $_ := set .Values.workload.qbitportforward "enabled" false -}}
{{- $_ := set .Values.service.gluetun "enabled" false -}}
{{- end -}}
{{/* Render the templates */}}
+41 -10
View File
@@ -2,6 +2,14 @@ image:
repository: ghcr.io/onedr0p/qbittorrent
pullPolicy: IfNotPresent
tag: 4.6.0@sha256:cb6259df3be61a5108bc4f85b09a523fc4b250589ca9b315ef927cbdf779afb6
qbitportforwardImage:
repository: mjmeli/qbittorrent-port-forward-gluetun-server
pullPolicy: IfNotPresent
tag: latest@sha256:67d0d21ed792cf80716d4211e7162b6d375af5c12f3cf096c9032ad705dddaa8
qbitportforward:
enabled: false
QBT_USERNAME: "admin"
QBT_PASSWORD: "adminadmin"
service:
main:
ports:
@@ -19,20 +27,43 @@ service:
enabled: true
port: 6881
protocol: udp
gluetun:
enabled: true
type: ClusterIP
ports:
gluetun:
enabled: true
port: 8000
targetPort: 8000
protocol: http
workload:
qbitportforward:
enabled: true
type: Deployment
strategy: RollingUpdate
replicas: 1
podSpec:
containers:
qbitportforward:
primary: true
enabled: true
imageSelector: qbitportforwardImage
probes:
liveness:
enabled: false
readiness:
enabled: false
startup:
enabled: false
env:
QBT_USERNAME: "{{ .Values.qbitportforward.QBT_USERNAME }}"
QBT_PASSWORD: "{{ .Values.qbitportforward.QBT_PASSWORD }}"
QBT_ADDR: '{{ printf "http://%v:%v" (include "tc.v1.common.lib.chart.names.fullname" $) .Values.service.main.ports.main.port }}'
GTN_ADDR: '{{ printf "http://%v-gluetun:8000" (include "tc.v1.common.lib.chart.names.fullname" $) }}'
persistence:
config:
enabled: true
mountPath: "/config"
additionalVolumes:
- name: qbittorrent-scripts
emptyDir: {}
## When you want to enable automatic port configuration at startup, adjust this to:
# configMap:
# name: <RELEASENAME>-scripts
# defaultMode: "511"
additionalVolumeMounts:
- mountPath: "/config/custom-cont-init.d"
name: qbittorrent-scripts
portal:
open:
enabled: true