Skip to content

Commit

Permalink
refactor env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
kriegalex committed Aug 6, 2024
1 parent 874b353 commit 7d2d308
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 14 deletions.
2 changes: 1 addition & 1 deletion charts/qbittorrent-gluetun/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: "4.6.5" # this is not updated automatically
description: A Helm chart for qBittorrent with Gluetun VPN
name: qbittorrent-gluetun
version: 0.3.0
version: 0.3.1
keywords:
- qbittorrent
- torrrent
Expand Down
38 changes: 29 additions & 9 deletions charts/qbittorrent-gluetun/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,45 @@ spec:
value: {{ .Values.gluetun.env.SERVER_REGIONS | quote }}
- name: VPN_PORT_FORWARDING
value: {{ .Values.gluetun.env.VPN_PORT_FORWARDING | quote }}
- name: PORT_FORWARD_ONLY
value: {{ .Values.gluetun.env.PORT_FORWARD_ONLY | quote }}
- name: PUBLICIP_API
value: {{ .Values.gluetun.env.PUBLICIP_API | quote }}
{{- if .Values.gluetun.env.PUBLICIP_API_TOKEN }}
- name: PUBLICIP_API_TOKEN
value: {{ .Values.gluetun.env.PUBLICIP_API_TOKEN | quote }}
{{- end }}
{{- if .Values.gluetun.env.OPENVPN_USER }}
- name: OPENVPN_USER
value: {{ .Values.gluetun.env.OPENVPN_USER | quote }}
{{- end }}
{{- if .Values.gluetun.env.OPENVPN_PASSWORD }}
- name: OPENVPN_PASSWORD
value: {{ .Values.gluetun.env.OPENVPN_PASSWORD | quote }}
{{- end }}
{{- if .Values.gluetun.secret.existingSecret }}
{{- if .Values.gluetun.secret.existingKeys.openvpnUser }}
- name: OPENVPN_USER
valueFrom:
secretKeyRef:
name: {{ .Values.gluetun.secret.name }}
key: OPENVPN_USER
name: {{ .Values.gluetun.secret.existingSecret }}
key: {{ .Values.gluetun.secret.existingKeys.openvpnUser }}
{{- end }}
{{- if .Values.gluetun.secret.existingKeys.openvpnPassword }}
- name: OPENVPN_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.gluetun.secret.name }}
key: OPENVPN_PASSWORD
{{- if .Values.gluetun.env.PUBLICIP_API }}
- name: PUBLICIP_API
value: {{ .Values.gluetun.env.PUBLICIP_API | quote }}
name: {{ .Values.gluetun.secret.existingSecret }}
key: {{ .Values.gluetun.secret.existingKeys.openvpnPassword }}
{{- end }}
{{- if .Values.gluetun.secret.existingKeys.publicIpApiToken }}
- name: PUBLICIP_API_TOKEN
valueFrom:
secretKeyRef:
name: {{ .Values.gluetun.secret.name }}
key: PUBLICIP_API_TOKEN
name: {{ .Values.gluetun.secret.existingSecret }}
key: {{ .Values.gluetun.secret.existingKeys.publicIpApiToken }}
{{- end }}
{{- end }} # existingSecret
securityContext:
capabilities:
add: ["NET_ADMIN"]
Expand Down
25 changes: 21 additions & 4 deletions charts/qbittorrent-gluetun/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,28 @@ gluetun:
controlServerPort: 8000

env:
VPN_SERVICE_PROVIDER: "private internet access"
SERVER_REGIONS: "Switzerland"
VPN_PORT_FORWARDING: true
OPENVPN_USER: ""
OPENVPN_PASSWORD: ""
# Specify a supported VPN provider to use
VPN_SERVICE_PROVIDER: ""
# Comma separated list of regions
SERVER_REGIONS: ""
# Enable custom port forwarding code for supported providers
VPN_PORT_FORWARDING: off
# For private internet access, set to true to select servers with port forwarding only
PORT_FORWARD_ONLY: false
# Public IP echo service API to use
PUBLICIP_API: ipinfo
# Optional API token for the public IP echo service to increase rate limiting
PUBLICIP_API_TOKEN: ""
secret:
name: vpn-credentials
# Name of existing secret to use for OpenVPN and IP API credentials.
existingSecret: ""
# Names of keys in existing secret to use for credentials
existingKeys:
openvpnUser: ""
openvpnPassword: ""
publicIpApiToken: ""

# Persistence
persistence:
Expand Down

0 comments on commit 7d2d308

Please sign in to comment.