xactmon: Deploy xactmon

`xactmon` is a new tool I developed to parse transaction notifications
from banks and automatically import them into my personal finance
tracker.  It is designed in a modular fashion, composed of three main
components:

* Receiver
* Processor
* Importer

Components communicate with one another using an AMQP exchange.
Hypothetically, there could be multipel implementations of the receiver
and importer components.  Right now, there is only a JMAP receiver,
which fetches email messages (from Fastmail), and a Firefly III
importer.  The processor is a singleton, handling notifications from the
receiver, parsing them into a normalized format, and passing them on to
the importer.  It uses a set of rules to decide how to parse the
messages, and supports using either a regular expression with named
capture groups or an Awk script to extract the relevant information.
This commit is contained in:
2024-07-22 08:11:31 -05:00
parent ccc46288c2
commit a04a2b5334
8 changed files with 405 additions and 0 deletions

238
xactmon/xactmon.yaml Normal file
View File

@@ -0,0 +1,238 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: xactmon-receiver-jmap
labels:
app.kubernetes.io/name: xactmon-receiver-jmap
app.kubernetes.io/component: receiver-jmap
spec:
selector:
matchLabels:
app.kubernetes.io/name: xactmon-receiver-jmap
app.kubernetes.io/component: receiver-jmap
template:
metadata:
labels:
app.kubernetes.io/name: xactmon-receiver-jmap
app.kubernetes.io/component: receiver-jmap
spec:
containers:
- name: receiver-jmap
image: git.pyrocufflink.net/packages/xactmon
imagePullPolicy: Always
args:
- receiver-jmap
- /etc/xactmon/config.toml
env:
- name: RUST_LOG
value: xactmon=trace,info
- name: TZ
value: America/Chicago
volumeMounts:
- mountPath: /etc/xactmon
name: xactmon-config
readOnly: true
- mountPath: /run/dch-ca
name: dch-ca
readOnly: true
- mountPath: /run/secrets/xactmon
name: xactmon-secrets
readOnly: true
- mountPath: /run/secrets/rabbitmq/password
name: rabbitmq-cert-password
subPath: password
readOnly: true
- mountPath: /run/secrets/rabbitmq/cert
name: rabbitmq-cert
readOnly: true
- mountPath: /tmp
name: tmp
subPath: tmp
imagePullSecrets:
- name: imagepull-gitea
securityContext:
runAsUser: 251
runAsGroup: 251
fsGroup: 251
volumes:
- name: dch-ca
configMap:
name: dch-root-ca
- name: rabbitmq-cert
secret:
secretName: rabbitmq-cert
defaultMode: 0440
- name: rabbitmq-cert-password
secret:
secretName: rabbitmq-cert-password
defaultMode: 0440
- name: tmp
emptyDir:
medium: Memory
- name: xactmon-config
configMap:
name: xactmon
- name: xactmon-secrets
secret:
secretName: xactmon
defaultMode: 0440
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: xactmon-processor
labels:
app.kubernetes.io/name: xactmon-processor
app.kubernetes.io/component: processor
spec:
selector:
matchLabels:
app.kubernetes.io/name: xactmon-processor
app.kubernetes.io/component: processor
template:
metadata:
labels:
app.kubernetes.io/name: xactmon-processor
app.kubernetes.io/component: processor
spec:
containers:
- name: processor
image: git.pyrocufflink.net/packages/xactmon
imagePullPolicy: Always
args:
- processor
- /etc/xactmon/config.toml
env:
- name: RUST_LOG
value: xactmon=trace,info
- name: TZ
value: America/Chicago
volumeMounts:
- mountPath: /etc/xactmon
name: xactmon-config
readOnly: true
- mountPath: /run/dch-ca
name: dch-ca
readOnly: true
- mountPath: /run/secrets/xactmon
name: xactmon-secrets
readOnly: true
- mountPath: /run/secrets/rabbitmq/password
name: rabbitmq-cert-password
subPath: password
readOnly: true
- mountPath: /run/secrets/rabbitmq/cert
name: rabbitmq-cert
readOnly: true
- mountPath: /tmp
name: tmp
subPath: tmp
imagePullSecrets:
- name: imagepull-gitea
securityContext:
runAsUser: 251
runAsGroup: 251
fsGroup: 251
volumes:
- name: dch-ca
configMap:
name: dch-root-ca
- name: rabbitmq-cert
secret:
secretName: rabbitmq-cert
defaultMode: 0440
- name: rabbitmq-cert-password
secret:
secretName: rabbitmq-cert-password
defaultMode: 0440
- name: tmp
emptyDir:
medium: Memory
- name: xactmon-config
configMap:
name: xactmon
- name: xactmon-secrets
secret:
secretName: xactmon
defaultMode: 0440
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: xactmon-importer-firefly
labels:
app.kubernetes.io/name: xactmon-importer-firefly
app.kubernetes.io/component: importer-firefly
spec:
selector:
matchLabels:
app.kubernetes.io/name: xactmon-importer-firefly
app.kubernetes.io/component: importer-firefly
template:
metadata:
labels:
app.kubernetes.io/name: xactmon-importer-firefly
app.kubernetes.io/component: importer-firefly
spec:
containers:
- name: importer-firefly
image: git.pyrocufflink.net/packages/xactmon
imagePullPolicy: Always
args:
- importer-firefly
- /etc/xactmon/config.toml
env:
- name: RUST_LOG
value: xactmon=trace,info
- name: TZ
value: America/Chicago
volumeMounts:
- mountPath: /etc/xactmon
name: xactmon-config
readOnly: true
- mountPath: /run/dch-ca
name: dch-ca
readOnly: true
- mountPath: /run/secrets/xactmon
name: xactmon-secrets
readOnly: true
- mountPath: /run/secrets/rabbitmq/password
name: rabbitmq-cert-password
subPath: password
readOnly: true
- mountPath: /run/secrets/rabbitmq/cert
name: rabbitmq-cert
readOnly: true
- mountPath: /tmp
name: tmp
subPath: tmp
imagePullSecrets:
- name: imagepull-gitea
securityContext:
runAsUser: 251
runAsGroup: 251
fsGroup: 251
volumes:
- name: dch-ca
configMap:
name: dch-root-ca
- name: rabbitmq-cert
secret:
secretName: rabbitmq-cert
defaultMode: 0440
- name: rabbitmq-cert-password
secret:
secretName: rabbitmq-cert-password
defaultMode: 0440
- name: tmp
emptyDir:
medium: Memory
- name: xactmon-config
configMap:
name: xactmon
- name: xactmon-secrets
secret:
secretName: xactmon
defaultMode: 0440