From 2583236f6d9d69f50124a659ffbed67d0f1029f2 Mon Sep 17 00:00:00 2001 From: Aleksandr Bogomiakov Date: Sat, 1 Aug 2026 13:24:23 +0100 Subject: [PATCH] Enabled auto sync openbanking --- k8s/apps/firefly-iii/data-importer-sync.yaml | 96 ++++++++++++++++++++ k8s/apps/firefly-iii/external-secrets.yaml | 20 ++++ k8s/apps/firefly-iii/kustomization.yaml | 1 + k8s/apps/firefly-iii/network-policy.yaml | 3 + 4 files changed, 120 insertions(+) create mode 100644 k8s/apps/firefly-iii/data-importer-sync.yaml diff --git a/k8s/apps/firefly-iii/data-importer-sync.yaml b/k8s/apps/firefly-iii/data-importer-sync.yaml new file mode 100644 index 0000000..538fd39 --- /dev/null +++ b/k8s/apps/firefly-iii/data-importer-sync.yaml @@ -0,0 +1,96 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + name: firefly-data-importer-sync + labels: + app.kubernetes.io/name: firefly-data-importer-sync +spec: + schedule: "17 */6 * * *" + timeZone: Europe/London + concurrencyPolicy: Forbid + startingDeadlineSeconds: 1800 + successfulJobsHistoryLimit: 2 + failedJobsHistoryLimit: 5 + jobTemplate: + spec: + backoffLimit: 1 + activeDeadlineSeconds: 1200 + template: + metadata: + labels: + app.kubernetes.io/name: firefly-data-importer-sync + spec: + automountServiceAccountToken: false + restartPolicy: Never + nodeSelector: + kubernetes.io/hostname: ai.tail2fe2d.ts.net + tolerations: + - key: workload + operator: Equal + value: ai + effect: NoSchedule + containers: + - name: data-importer-sync + image: fireflyiii/data-importer:version-2.3.4 + imagePullPolicy: IfNotPresent + command: + - php + - artisan + - importer:import + - /import/import.json + env: + - name: FIREFLY_III_URL + value: http://firefly-iii + - name: VANITY_URL + value: http://ff.lan + - name: FIREFLY_III_ACCESS_TOKEN + valueFrom: + secretKeyRef: + name: firefly-data-importer-secrets + key: FIREFLY_III_ACCESS_TOKEN + - name: ENABLE_BANKING_APP_ID + valueFrom: + secretKeyRef: + name: firefly-data-importer-secrets + key: ENABLE_BANKING_APP_ID + - name: ENABLE_BANKING_PRIVATE_KEY + valueFrom: + secretKeyRef: + name: firefly-data-importer-secrets + key: ENABLE_BANKING_PRIVATE_KEY + - name: IMPORT_DIR_ALLOWLIST + value: /import + - name: TZ + value: Europe/London + - name: APP_ENV + value: production + - name: APP_DEBUG + value: "false" + - name: LOG_LEVEL + value: notice + volumeMounts: + - name: import-config + mountPath: /import + readOnly: true + resources: + requests: + cpu: 50m + memory: 128Mi + limits: + cpu: "1" + memory: 512Mi + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + volumes: + - name: import-config + secret: + secretName: firefly-data-importer-secrets + items: + - key: import.json + path: import.json + securityContext: + seccompProfile: + type: RuntimeDefault diff --git a/k8s/apps/firefly-iii/external-secrets.yaml b/k8s/apps/firefly-iii/external-secrets.yaml index cbef4a8..b994d97 100644 --- a/k8s/apps/firefly-iii/external-secrets.yaml +++ b/k8s/apps/firefly-iii/external-secrets.yaml @@ -66,6 +66,10 @@ spec: -----BEGIN PRIVATE KEY----- {{ .private_key | replace "-----BEGIN PRIVATE KEY-----" "" | replace "-----END PRIVATE KEY-----" "" | replace " " "" | trim }} -----END PRIVATE KEY----- + FIREFLY_III_ACCESS_TOKEN: |- + {{ .firefly_access_token }} + import.json: |- + {{ .import_config }} data: - secretKey: app_id sourceRef: @@ -83,3 +87,19 @@ spec: remoteRef: key: a1867c81-715c-47cd-978d-14ea5bcedea9 property: fields[4].value + - secretKey: firefly_access_token + sourceRef: + storeRef: + name: vaultwarden-login + kind: ClusterSecretStore + remoteRef: + key: a1867c81-715c-47cd-978d-14ea5bcedea9 + property: fields[5].value + - secretKey: import_config + sourceRef: + storeRef: + name: vaultwarden-login + kind: ClusterSecretStore + remoteRef: + key: a1867c81-715c-47cd-978d-14ea5bcedea9 + property: fields[6].value diff --git a/k8s/apps/firefly-iii/kustomization.yaml b/k8s/apps/firefly-iii/kustomization.yaml index 9614d5d..6e5b89a 100644 --- a/k8s/apps/firefly-iii/kustomization.yaml +++ b/k8s/apps/firefly-iii/kustomization.yaml @@ -4,6 +4,7 @@ kind: Kustomization resources: - app.yaml - data-importer.yaml + - data-importer-sync.yaml - data-importer-ingress.yaml - external-secrets.yaml - postgres.yaml diff --git a/k8s/apps/firefly-iii/network-policy.yaml b/k8s/apps/firefly-iii/network-policy.yaml index a48ab87..cd894cf 100644 --- a/k8s/apps/firefly-iii/network-policy.yaml +++ b/k8s/apps/firefly-iii/network-policy.yaml @@ -22,6 +22,9 @@ spec: - podSelector: matchLabels: app.kubernetes.io/name: firefly-data-importer + - podSelector: + matchLabels: + app.kubernetes.io/name: firefly-data-importer-sync # hostNetwork traffic is seen as node traffic rather than Pod traffic. - ipBlock: cidr: 192.168.1.117/32