diff --git a/bitwarden/Bitwarden_export_Cronjobs.yaml b/bitwarden/Bitwarden_export_Cronjobs.yaml index 7af67fc..302c65a 100644 --- a/bitwarden/Bitwarden_export_Cronjobs.yaml +++ b/bitwarden/Bitwarden_export_Cronjobs.yaml @@ -33,6 +33,11 @@ spec: secretKeyRef: name: bitwarden-credentials key: BW_CLIENTSECRET + - name: BW_PASSWORD + valueFrom: + secretKeyRef: + name: bitwarden-credentials + key: BW_PASSWORD volumeMounts: - name: scripts mountPath: /config diff --git a/bitwarden/bitwarden_export_scripts.configmap.yaml b/bitwarden/bitwarden_export_scripts.configmap.yaml index da3bf3c..457331d 100644 --- a/bitwarden/bitwarden_export_scripts.configmap.yaml +++ b/bitwarden/bitwarden_export_scripts.configmap.yaml @@ -4,7 +4,8 @@ data: #!/usr/bin/env bash bw config server https://bitwarden.tryton.geeraert.eu/ bw login --apikey - bw list items >> /backup/backup_$(date "+%Y-%m-%d_%Hh-%m").json + export BW_key=$(bw unlock $BW_PASSWORD --raw) + bw list items --session $BW_key >> /backup/backup_$(date "+%Y-%m-%d_%Hh-%m").json kind: ConfigMap metadata: creationTimestamp: null