Compare commits

...

10 Commits

Author SHA1 Message Date
Hermes Platform Engineer
45a9948682 fix(myorg-assistant): normalize GIT_REPO_URL host to git.rogi.casa in git-sync
PR #26 added the git-clone initContainer but still trusted the GIT_REPO_URL
secret verbatim. That secret historically contains gitea.rogi.casa, which
526s through Cloudflare, so the clone still fails with 'Not a git repository'.

Normalize the host to git.rogi.casa at runtime (sed) so the clone works
regardless of the secret's stale host. Directly addresses the subdomain bug.
2026-07-19 16:13:45 +00:00
Roger Oriol
e44d7ba1fc Merge branch 'main' of https://git.rogi.casa/roger/k3s-cluster 2026-07-19 12:01:21 +02:00
Roger Oriol
f1005cd426 change openwebui url to ai.rogi.casa 2026-07-19 12:00:52 +02:00
Roger Oriol
43c0c2561e fix hermes write folder 2026-07-18 19:29:52 +02:00
8334cd48f8 Merge pull request 'fix(myorg-assistant): add git-clone initContainer to git-sync CronJob' (#26) from fix/myorg-git-sync-clone into main
Reviewed-on: roger/k3s-cluster#26
2026-07-18 19:25:00 +02:00
Hermes Platform Engineer
ba7e05a73d fix(myorg-assistant): add git-clone initContainer to git-sync CronJob
The git-sync CronJob only ran `git pull`/`git push` against /data/myorg
but never ensured the repo existed. The clone was solely the Deployment's
git-clone initContainer's job, and when that didn't populate the volume the
cron pod failed with 'Not a git repository: /data/myorg' on every run (and
swallowed the error, exiting 0).

Add an idempotent git-clone initContainer (guarded by [ ! -d /data/myorg/.git ])
so the cron job self-heals and actually syncs.

Refs: myorg-git-sync-* 'Pull: Error: Not a git repository' (last 24h+)
2026-07-18 17:21:26 +00:00
Roger Oriol
8bc3025296 fix platform engineer not allowed to respond to discord messages 2026-07-18 19:20:23 +02:00
Roger Oriol
7a7d67bedc configure git token env variable in myorg assistant cronjobs 2026-07-18 19:03:46 +02:00
Roger Oriol
19cdc77880 add git token env var to deadline checker 2026-07-18 18:59:36 +02:00
Roger Oriol
8983f482d0 give more memory to homeassistant 2026-07-17 23:59:50 +02:00
9 changed files with 82 additions and 4 deletions

View File

@@ -58,9 +58,9 @@ spec:
image: ghcr.io/home-assistant/home-assistant:stable image: ghcr.io/home-assistant/home-assistant:stable
resources: resources:
requests: requests:
memory: "256Mi"
limits:
memory: "512Mi" memory: "512Mi"
limits:
memory: "1Gi"
ports: ports:
- containerPort: 8123 - containerPort: 8123
volumeMounts: volumeMounts:

View File

@@ -59,6 +59,11 @@ spec:
secretKeyRef: secretKeyRef:
name: myorg-assistant-secret name: myorg-assistant-secret
key: WEB_SECRET_KEY key: WEB_SECRET_KEY
- name: GIT_TOKEN
valueFrom:
secretKeyRef:
name: myorg-assistant-secret
key: GIT_TOKEN
volumeMounts: volumeMounts:
- name: myorg-data - name: myorg-data
mountPath: /data/myorg mountPath: /data/myorg

View File

@@ -59,6 +59,11 @@ spec:
secretKeyRef: secretKeyRef:
name: myorg-assistant-secret name: myorg-assistant-secret
key: WEB_SECRET_KEY key: WEB_SECRET_KEY
- name: GIT_TOKEN
valueFrom:
secretKeyRef:
name: myorg-assistant-secret
key: GIT_TOKEN
volumeMounts: volumeMounts:
- name: myorg-data - name: myorg-data
mountPath: /data/myorg mountPath: /data/myorg

View File

@@ -24,6 +24,47 @@ spec:
restartPolicy: OnFailure restartPolicy: OnFailure
imagePullSecrets: imagePullSecrets:
- name: gitea-registry - name: gitea-registry
initContainers:
- name: git-clone
image: alpine/git:latest
command:
- sh
- -c
- |
# Normalize the repo URL host to the correct Gitea subdomain.
# The GIT_REPO_URL secret historically contained gitea.rogi.casa,
# which 526s through Cloudflare; the working subdomain is git.rogi.casa.
export GIT_REPO_URL="$(echo "${GIT_REPO_URL}" | sed -E 's#https?://[^/@]+@?gitea\.rogi\.casa#https://'"${GIT_USERNAME}"':'"${GIT_TOKEN}"'@git.rogi.casa#')"
if [ ! -d /data/myorg/.git ]; then
echo "Cloning repository..."
git clone ${GIT_REPO_URL} /data/myorg
cd /data/myorg
git config user.name "${GIT_USERNAME}"
git config user.email "${GIT_USERNAME}@rogi.casa"
git config credential.helper store
echo "https://${GIT_USERNAME}:${GIT_TOKEN}@git.rogi.casa" > ~/.git-credentials
else
echo "Repository already exists, skipping clone."
fi
env:
- name: GIT_REPO_URL
valueFrom:
secretKeyRef:
name: myorg-assistant-secret
key: GIT_REPO_URL
- name: GIT_USERNAME
valueFrom:
secretKeyRef:
name: myorg-assistant-secret
key: GIT_USERNAME
- name: GIT_TOKEN
valueFrom:
secretKeyRef:
name: myorg-assistant-secret
key: GIT_TOKEN
volumeMounts:
- name: myorg-data
mountPath: /data/myorg
containers: containers:
- name: git-sync - name: git-sync
image: git.rogi.casa/roger/myorg-assistant/myorg-assistant:fcf79bf image: git.rogi.casa/roger/myorg-assistant/myorg-assistant:fcf79bf

View File

@@ -66,6 +66,11 @@ spec:
secretKeyRef: secretKeyRef:
name: myorg-assistant-secret name: myorg-assistant-secret
key: WEB_SECRET_KEY key: WEB_SECRET_KEY
- name: GIT_TOKEN
valueFrom:
secretKeyRef:
name: myorg-assistant-secret
key: GIT_TOKEN
volumeMounts: volumeMounts:
- name: myorg-data - name: myorg-data
mountPath: /data/myorg mountPath: /data/myorg

View File

@@ -59,6 +59,11 @@ spec:
secretKeyRef: secretKeyRef:
name: myorg-assistant-secret name: myorg-assistant-secret
key: WEB_SECRET_KEY key: WEB_SECRET_KEY
- name: GIT_TOKEN
valueFrom:
secretKeyRef:
name: myorg-assistant-secret
key: GIT_TOKEN
volumeMounts: volumeMounts:
- name: myorg-data - name: myorg-data
mountPath: /data/myorg mountPath: /data/myorg

View File

@@ -9,10 +9,10 @@ spec:
ingressClassName: traefik ingressClassName: traefik
tls: tls:
- hosts: - hosts:
- openai.rogi.casa - ai.rogi.casa
secretName: openwebui-tls secretName: openwebui-tls
rules: rules:
- host: openai.rogi.casa - host: ai.rogi.casa
http: http:
paths: paths:
- path: / - path: /

View File

@@ -59,6 +59,16 @@ data:
cron: cron:
wrap_response: false wrap_response: false
discord:
allowed_channels: '1470909384162017444' # DISCORD_HOME_CHANNEL
free_response_channels: '1470909384162017444' # no @mention needed here
# Per-platform gateway auth. Paired with GATEWAY_ALLOW_ALL_USERS=true in
# the env (secret.yaml), this lets the bot reply to inbound DMs and
# group messages from anyone. Tighten later by switching to
# DISCORD_ALLOWED_USERS=<id> in the secret and dropping these two lines.
dm_policy: open
group_policy: open
memory: memory:
memory_enabled: true memory_enabled: true
user_profile_enabled: true user_profile_enabled: true

View File

@@ -125,6 +125,13 @@ spec:
env: env:
- name: HERMES_HOME - name: HERMES_HOME
value: /opt/data value: /opt/data
# Hermes' file-write tool refuses any path outside HERMES_WRITE_SAFE_ROOT.
# When unset it defaults to HERMES_HOME (/opt/data), which blocks the
# agent's only GitOps remediation path (editing manifests under
# /workspace/k3s-cluster). Whitelist the whole filesystem — consistent
# with yolo:true, approvals.mode:off, and the agent having no k8s RBAC.
- name: HERMES_WRITE_SAFE_ROOT
value: "/"
volumeMounts: volumeMounts:
- name: data - name: data
mountPath: /opt/data mountPath: /opt/data