Add qbittorent application

This commit is contained in:
M. Rehan
2022-04-23 00:45:35 +05:00
parent 109ccdc63f
commit a56703eaee
15 changed files with 423 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
# Patterns to ignore when building packages.
*.png

View File

@@ -0,0 +1,14 @@
apiVersion: v2
appVersion: 2.3.1
icon: https://truecharts.org/_static/img/appicons/qbittorrent.png
description: Download data from qbittorent.
name: qbittorent
version: 1.0.0
dependencies:
- name: common
repository: file://../../../library/common/2112.0.0
version: 2112.0.0
home: https://www.qbittorrent.org/
keywords:
- storage
- torrent

View File

@@ -0,0 +1,3 @@
# qbittorent
[qbittorent](https://qbittorrent.com/) is a utorrent downloading client

View File

@@ -0,0 +1,3 @@
# Qbittorent
[qbittorent](https://qbittorrent.com/) is a utorrent downloading client.

Binary file not shown.

View File

@@ -0,0 +1,4 @@
image:
pullPolicy: IfNotPresent
repository: linuxserver/qbittorrent
tag: 4.4.2

View File

@@ -0,0 +1,224 @@
groups:
- name: "Configuration"
description: "Qbittorent application configuration"
- name: "Storage"
description: "Configure storage for qbittorent"
- name: "Networking"
description: "Networking Configuration for qbittorent"
- name: "Advanced DNS Settings"
description: "Configure DNS settings"
portals:
web_portal:
protocols:
- "http"
host:
- "$node_ip"
ports:
- "$variable-web_port"
path: "/"
questions:
- variable: web_port
label: "Web Port for qbittorent"
group: Networking
schema:
type: int
min: 8000
max: 65535
default: 20909
required: true
- variable: tcp_port
label: "TCP Port for qbittorent"
group: Networking
schema:
type: int
min: 8000
max: 65535
default: 20988
required: true
- variable: udp_port
label: "UDP Port for qbittorent"
group: Networking
schema:
type: int
min: 8000
max: 65535
default: 20989
required: true
- variable: dnsConfig
label: "DNS Configuration"
group: "Advanced DNS Settings"
schema:
type: dict
attrs:
- variable: options
label: "DNS Options"
schema:
type: list
items:
- variable: optionsEntry
label: "Option Entry Configuration"
schema:
type: dict
attrs:
- variable: name
label: "Option Name"
schema:
type: string
required: true
- variable: value
label: "Option Value"
schema:
type: string
required: true
- variable: ownerUID
label: "Owner User ID"
group: Configuration
schema:
type: int
default: 568
min: 1
max: 65535
- variable: ownerGID
label: "Owner Group ID"
group: Configuration
schema:
type: int
default: 568
min: 1
max: 65535
- variable: timezone
label: "Timezone"
group: "Configuration"
schema:
type: string
$ref:
- "definitions/timezone"
- variable: environmentVariables
label: "Qbittorent environment"
group: "Configuration"
schema:
type: list
default: [ ]
items:
- variable: environmentVariable
label: "Environment Variable"
schema:
type: dict
attrs:
- variable: name
label: "Name"
schema:
type: string
- variable: value
label: "Value"
schema:
type: string
- variable: appVolumeMounts
label: "Qbittorent Storage"
group: "Storage"
schema:
type: dict
attrs:
- variable: config
label: "Configuration Volume"
schema:
type: dict
attrs:
- variable: datasetName
label: "Configuration Volume Dataset Name"
schema:
type: string
hidden: true
$ref:
- "normalize/ixVolume"
show_if: [["hostPathEnabled", "=", false]]
default: "ix-qbittorent_config"
editable: false
- variable: mountPath
label: "Configuration Mount Path"
description: "Path where the volume will be mounted inside the pod"
schema:
type: path
hidden: true
editable: true
default: "/config"
- variable: hostPathEnabled
label: "Enable Custom Host Path for Qbittorent Configuration Volume"
schema:
type: boolean
default: false
show_subquestions_if: true
subquestions:
- variable: hostPath
label: "Host Path for Qbittorent Configuration Volume"
schema:
type: hostpath
required: true
- variable: downloads
label: "Downloads Volume"
schema:
type: dict
attrs:
- variable: datasetName
label: "Downloads Volume Dataset Name"
schema:
type: string
hidden: true
$ref:
- "normalize/ixVolume"
show_if: [["hostPathEnabled", "=", false]]
default: "ix-qbittorent_data"
editable: false
- variable: mountPath
label: "Downloads Mount Path"
description: "Path where the volume will be mounted inside the pod"
schema:
type: path
hidden: true
editable: true
default: "/downloads"
- variable: hostPathEnabled
label: "Enable Custom Host Path for Qbittorent Downloads Volume"
schema:
type: boolean
default: false
show_subquestions_if: true
subquestions:
- variable: hostPath
label: "Host Path for Qbittorent Downloads Volume"
schema:
type: hostpath
required: true
- variable: extraAppVolumeMounts
label: "Extra Host Path Volumes"
group: "Storage"
schema:
type: list
items:
- variable: extraAppVolume
label: "Host Path Volume"
description: "Add an extra host path volume for Qbittorent application"
schema:
type: dict
attrs:
- variable: mountPath
label: "Mount Path in Pod"
description: "Path where the volume will be mounted inside the pod"
schema:
type: path
required: true
- variable: hostPath
label: "Host Path"
description: "Host path"
schema:
type: hostpath
required: true

View File

@@ -0,0 +1,56 @@
apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ template "common.names.fullname" . }}
labels:
app: {{ template "common.names.name" . }}
chart: {{ template "common.names.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
rollme: {{ randAlphaNum 5 | quote }}
spec:
replicas: {{ (default 1 .Values.replicas) }}
strategy:
type: "Recreate"
selector:
matchLabels:
app: {{ template "common.names.name" . }}
release: {{ .Release.Name }}
template:
metadata:
name: {{ template "common.names.fullname" . }}
labels:
app: {{ template "common.names.name" . }}
release: {{ .Release.Name }}
{{- include "common.labels.selectorLabels" . | nindent 8 }}
annotations: {{ include "common.annotations" . | nindent 8 }}
spec:
hostNetwork: false
containers:
- name: {{ .Chart.Name }}
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }}
ports:
- name: web
containerPort: {{ .Values.web_port }}
- name: tcp
containerPort: {{ .Values.tcp_port }}
protocol: TCP
- name: udp
containerPort: {{ .Values.udp_port }}
protocol: UDP
env:
{{ $envList := (default list .Values.environmentVariables) }}
{{ $envList = mustAppend $envList (dict "name" "PUID" "value" (printf "%d" (.Values.ownerUID | int))) }}
{{ $envList = mustAppend $envList (dict "name" "PGID" "value" (printf "%d" (.Values.ownerGID | int))) }}
{{ $envList = mustAppend $envList (dict "name" "TZ" "value" (printf "%s" .Values.timezone)) }}
{{ $envList = mustAppend $envList (dict "name" "WEBUI_PORT" "value" (printf "%d" (.Values.web_port | int))) }}
{{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }}
{{ include "common.networking.dnsConfiguration" .Values | nindent 6 }}
volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
{{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
- name: extrappvolume-{{ $index }}
hostPath:
path: {{ $hostPathConfiguration.hostPath }}
{{ end }}

View File

@@ -0,0 +1,33 @@
apiVersion: batch/v1
kind: Job
metadata:
name: "{{ template "common.names.fullname" . }}-preinstall-job"
labels:
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
helm.sh/chart: {{ template "common.names.chart" . }}
annotations:
"helm.sh/hook": pre-install
"helm.sh/hook-delete-policy": hook-succeeded
spec:
template:
metadata:
name: "{{ template "common.names.fullname" . }}-preinstall-hook"
labels:
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: {{ template "common.names.chart" . }}
spec:
restartPolicy: Never
containers:
- name: pre-install-job
image: "alpine:latest"
command:
- "chown"
- "-R"
- "{{ .Values.ownerUID }}:{{ .Values.ownerGID }}"
- "{{ .Values.appVolumeMounts.config.mountPath }}"
- "{{ .Values.appVolumeMounts.downloads.mountPath }}"
volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }}
volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}

View File

@@ -0,0 +1,11 @@
{{ $selectors := list }}
{{ $selectors = mustAppend $selectors (dict "key" "app" "value" (include "common.names.name" .) ) }}
{{ $selectors = mustAppend $selectors (dict "key" "release" "value" .Release.Name ) }}
{{ $ports := list }}
{{ $ports = mustAppend $ports (dict "name" "web" "port" .Values.web_port "nodePort" .Values.web_port "targetPort" .Values.web_port) }}
{{ $ports = mustAppend $ports (dict "name" "tcp" "port" .Values.tcp_port "nodePort" .Values.tcp_port "targetPort" .Values.tcp_port) }}
{{ $ports = mustAppend $ports (dict "name" "udp" "port" .Values.udp_port "nodePort" .Values.udp_port "targetPort" .Values.udp_port "protocol" "UDP") }}
{{ $params := . }}
{{ $_ := set $params "commonService" (dict "type" "NodePort" "ports" $ports ) }}
{{ $_1 := set .Values "extraSelectorLabels" $selectors }}
{{ include "common.classes.service" $params }}

View File

@@ -0,0 +1,21 @@
{{- $serviceName := (include "common.names.fullname" .) -}}
apiVersion: v1
kind: Pod
metadata:
name: {{ .Release.Name }}-qbittorent
labels:
app: {{ .Release.Name }}
release: {{ .Release.Name }}
annotations:
"helm.sh/hook": test
spec:
containers:
- name: test-curl
image: alpine/curl
imagePullPolicy: "IfNotPresent"
command:
- /bin/sh
- -ec
- |
curl --connect-timeout 5 --max-time 10 --retry 5 --retry-delay 15 --retry-max-time 90 --retry-all-errors -ksf http://{{ $serviceName }}:{{.Values.web_port}}/
restartPolicy: Never

View File

@@ -0,0 +1,22 @@
image:
pullPolicy: IfNotPresent
repository: linuxserver/qbittorrent
tag: 4.4.2
ownerUID: 568
ownerGID: 568
timezone: Europe/London
environmentVariables: []
extraAppVolumeMounts: []
web_port: 32000
tcp_port: 32001
udp_port: 32002
dnsConfig:
options: []
emptyDirVolumes: true
appVolumeMounts:
config:
emptyDir: true
mountPath: /config
downloads:
emptyDir: true
mountPath: /downloads

View File

@@ -0,0 +1,4 @@
icon_url: https://truecharts.org/_static/img/appicons/qbittorrent.png
categories:
- media
- torrent

View File

@@ -0,0 +1 @@
{"filename": "ix_values.yaml", "keys": ["image"]}

View File

@@ -0,0 +1,25 @@
#!/usr/bin/python3
import json
import sys
from catalog_update.upgrade_strategy import semantic_versioning
def newer_mapping(image_tags):
key = list(image_tags.keys())[0]
tags = {t: t for t in image_tags[key]}
version = semantic_versioning(list(tags))
if not version:
return {}
return {
'tags': {key: tags[version]},
'app_version': version,
}
if __name__ == '__main__':
if len(sys.argv) != 2:
exit(1)
print(json.dumps(newer_mapping(json.loads(sys.argv[1]))))