Skip to content

Commit

Permalink
feat: configure qbittorrent through environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
M0NsTeRRR committed Jun 17, 2024
1 parent fd3c1fa commit 51fee86
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 7 deletions.
11 changes: 7 additions & 4 deletions ansible/group_vars/kubernetes_master/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,11 @@ vault_policies:
- path: secret/data/homelab/prod/hyperglass
capabilities:
- read
- name: gluetun
- name: qbittorrent
rules:
- path: secret/data/homelab/prod/qbittorrent
capabilities:
- read
- path: secret/data/homelab/prod/gluetun
capabilities:
- read
Expand Down Expand Up @@ -257,11 +260,11 @@ public_vault_datas:
bound_service_account_namespaces: hyperglass
policies: hyperglass
ttl: 1h
- path: auth/kubernetes/role/gluetun
- path: auth/kubernetes/role/qbittorrent
data:
bound_service_account_names: gluetun-vault
bound_service_account_names: qbittorrent-vault
bound_service_account_namespaces: qbittorrent
policies: gluetun
policies: qbittorrent
ttl: 1h
vault_datas: "{{ public_vault_datas + secret_vault_datas }}"
external_secrets_localhost_kubeconfig_path: "{{ kubernetes_localhost_kubeconfig_path }}"
Expand Down
4 changes: 4 additions & 0 deletions ansible/group_vars/kubernetes_master/secrets.example
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ secret_vault_datas:
data:
REDIS_PASSWORD:
devices.yaml: "{{ hyperglass_device_config }}"
- path: secret/data/homelab/prod/qbittorrent
data:
data:
PASSWORD_PBKF2:
- path: secret/data/homelab/prod/gluetun
data:
data:
Expand Down
28 changes: 25 additions & 3 deletions argocd/media/qbittorrent/manifests/01_external_secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: gluetun-vault
name: qbittorrent-vault
---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/external-secrets.io/secretstore_v1beta1.json
apiVersion: external-secrets.io/v1beta1
Expand All @@ -18,9 +18,9 @@ spec:
auth:
kubernetes:
mountPath: "kubernetes"
role: "gluetun"
role: "qbittorrent"
serviceAccountRef:
name: "gluetun-vault"
name: "qbittorrent-vault"
caProvider:
type: "ConfigMap"
name: "homelab-ca"
Expand All @@ -29,6 +29,28 @@ spec:
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/external-secrets.io/externalsecret_v1beta1.json
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: qbittorrent-vault
spec:
refreshInterval: "1m"
target:
creationPolicy: "Owner"
deletionPolicy: "Retain"
secretStoreRef:
kind: SecretStore
name: vault
data:
- secretKey: PASSWORD
remoteRef:
conversionStrategy: Default
decodingStrategy: None
metadataPolicy: None
key: secret/data/homelab/prod/qbittorrent
property: PASSWORD
---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/external-secrets.io/externalsecret_v1beta1.json
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: gluetun-vault
spec:
Expand Down
12 changes: 12 additions & 0 deletions argocd/media/qbittorrent/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
---
extraEnv:
- name: QBT_BitTorrent__Session__MaxActiveDownloads
value: "5"
- name: QBT_BitTorrent__Session__MaxActiveTorrents
value: "10"
- name: QBT_BitTorrent__Session__MaxActiveUploads
value: "5"
- name: QBT_Preferences__WebUI__Password_PBKDF2
valueFrom:
secretKeyRef:
key: PASSWORD_PBKF2
name: qbittorrent-vault
volumes:
- name: &volume-data data
persistentVolumeClaim:
Expand Down

0 comments on commit 51fee86

Please sign in to comment.