diff --git a/clusters/cl01tl/platform/qbittorrent/templates/config-map.yaml b/clusters/cl01tl/platform/qbittorrent/templates/config-map.yaml new file mode 100644 index 000000000..3ea6e24cd --- /dev/null +++ b/clusters/cl01tl/platform/qbittorrent/templates/config-map.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: glutun-update-script + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: glutun-update-script + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: gluetun + app.kubernetes.io/part-of: {{ .Release.Name }} +data: + update.sh: | + if ! command -v curl 2>&1 >/dev/null + then + echo "curl could not be found, installing" + apk add curl + fi + + echo "updating port with {{`{{PORTS}}`}}" + + curl -i -X POST -d "json={\"listen_port\": {{`{{PORTS}}}`}}" "http://localhost:8080/api/v2/app/setPreferences"' diff --git a/clusters/cl01tl/platform/qbittorrent/values.yaml b/clusters/cl01tl/platform/qbittorrent/values.yaml index 11b61c8f5..a8ff98530 100644 --- a/clusters/cl01tl/platform/qbittorrent/values.yaml +++ b/clusters/cl01tl/platform/qbittorrent/values.yaml @@ -62,8 +62,8 @@ qbittorrent: key: private-key - name: VPN_PORT_FORWARDING value: "on" - #- name: VPN_PORT_FORWARDING_UP_COMMAND - # value: 'curl -i -X POST -d "json={\"listen_port\": {{`{{PORTS}}}`}} " "http://localhost:8080/api/v2/app/setPreferences"' + - name: VPN_PORT_FORWARDING_UP_COMMAND + value: '/bin/sh -c /gluetun/update.sh' - name: PORT_FORWARD_ONLY value: "on" - name: FIREWALL_OUTBOUND_SUBNETS @@ -169,6 +169,17 @@ qbittorrent: qbittorrent: - path: /config readOnly: false + update-script: + enabled: true + type: configMap + name: glutun-update-script + advancedMounts: + frontend: + main: + - path: /gluetun/update.sh + readOnly: true + mountPropagation: None + subPath: update.sh storage: type: persistentVolumeClaim existingClaim: qbittorrent-nfs-storage