From 2ea001148f29b4d5ba50c541a8b5b44f7c28dc53 Mon Sep 17 00:00:00 2001 From: pierre Date: Tue, 29 Oct 2024 14:59:13 +0000 Subject: [PATCH] use password and APIKEY --- bitwarden/Bitwarden_export_Cronjobs.yaml | 5 +++++ bitwarden/bitwarden_export_scripts.configmap.yaml | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) 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