ABRP keeps getting live data while the car server is down: with an ABRP API key and user token set in the app (Live data tab, or abrp_api_key / abrp_token in the config file), the car sends the newest sample to ABRP itself at every upload. It tells the server the newest sample ABRP took (abrpSentUtc), and the server forwards only newer ones, so ABRP gets each sample once. Without credentials in the app the server forwards everything, as before. The credentials sit in encrypted storage, go in the request body, and neither they nor ABRP's answer are logged. Settings are grouped by what they are for: - Live data (was Upload): on/off, ABRP credentials, upload frequency. - Settings (replaces the Wi-Fi tab): full screen and voice key, usable capacity and manual SoH (were on Consumption), charging price (was on Charging), Wi-Fi. Charging and Live data get icons of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QLJfZQZeAKAwSqViTmLzki
95 lines
2.6 KiB
YAML
95 lines
2.6 KiB
YAML
# The car server (Go). One replica on purpose: the ABRP rate limit is kept in memory, and
|
|
# two replicas would each forward to ABRP at the full rate.
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: mg4-server
|
|
namespace: mg4
|
|
labels:
|
|
app.kubernetes.io/name: mg4-server
|
|
app.kubernetes.io/part-of: mg4
|
|
spec:
|
|
replicas: 1
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: mg4-server
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: mg4-server
|
|
app.kubernetes.io/part-of: mg4
|
|
spec:
|
|
securityContext:
|
|
runAsNonRoot: true
|
|
runAsUser: 65532
|
|
runAsGroup: 65532
|
|
seccompProfile:
|
|
type: RuntimeDefault
|
|
containers:
|
|
- name: server
|
|
# 2.3.0, pinned by digest so a re-pushed tag cannot change what runs.
|
|
image: git.stinnesbeck.com/nils/mg4-server@sha256:dc5eb49cd88a1fd6a8e853c6e2291f2b5d62252e8bb6daf1750e1c3698bc7e0a
|
|
ports:
|
|
- name: http
|
|
containerPort: 8080
|
|
env:
|
|
- name: INFLUX_URL
|
|
value: http://influxdb.mg4.svc:8086
|
|
- name: INFLUX_ORG
|
|
value: mg4
|
|
- name: INFLUX_BUCKET
|
|
value: mg4
|
|
# Where a phone reaches the server; the pairing QR code points here.
|
|
- name: PUBLIC_URL
|
|
value: https://car.k8s.stinnesbeck.com
|
|
- name: INFLUX_TOKEN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: influxdb-auth
|
|
key: admin-token
|
|
# INGEST_TOKEN, APPROVAL_PASSWORD, ABRP_API_KEY, ABRP_USER_TOKEN,
|
|
# ABRP_MIN_INTERVAL_SECONDS.
|
|
envFrom:
|
|
- secretRef:
|
|
name: mg4-server
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /v1/health
|
|
port: http
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /v1/health
|
|
port: http
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 30
|
|
resources:
|
|
requests:
|
|
cpu: 10m
|
|
memory: 32Mi
|
|
limits:
|
|
memory: 128Mi
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
readOnlyRootFilesystem: true
|
|
capabilities:
|
|
drop: ["ALL"]
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: mg4-server
|
|
namespace: mg4
|
|
labels:
|
|
app.kubernetes.io/name: mg4-server
|
|
app.kubernetes.io/part-of: mg4
|
|
spec:
|
|
selector:
|
|
app.kubernetes.io/name: mg4-server
|
|
ports:
|
|
- name: http
|
|
port: 80
|
|
targetPort: http
|