ai-bot impl

This commit is contained in:
2026-10-12 14:36:17 +02:00
parent 34444fdcd2
commit 2d6d2c0c36
13 changed files with 750 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
apiVersion: v2
name: ai-git-bot
description: AI-Git-Bot (https://github.com/tmseidel/ai-git-bot) - AI code review and coding agent for Gitea, with a bundled PostgreSQL
type: application
version: 0.1.0
appVersion: "1.27.0"
@@ -0,0 +1,33 @@
{{- define "ai-git-bot.fullname" -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- define "ai-git-bot.labels" -}}
helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version }}
app.kubernetes.io/version: {{ .Values.image.tag | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{{- define "ai-git-bot.selectorLabels" -}}
app.kubernetes.io/name: ai-git-bot
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- define "ai-git-bot.postgresql.fullname" -}}
{{- printf "%s-postgresql" (include "ai-git-bot.fullname" .) -}}
{{- end -}}
{{- define "ai-git-bot.postgresql.selectorLabels" -}}
app.kubernetes.io/name: postgresql
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- define "ai-git-bot.publicUrl" -}}
{{- if .Values.publicUrl -}}
{{- .Values.publicUrl -}}
{{- else if .Values.ingress.host -}}
{{- printf "https://%s" .Values.ingress.host -}}
{{- else -}}
http://localhost:8080
{{- end -}}
{{- end -}}
@@ -0,0 +1,124 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "ai-git-bot.fullname" . }}
labels:
{{- include "ai-git-bot.labels" . | nindent 4 }}
{{- include "ai-git-bot.selectorLabels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
# Recreate: agent sessions run in-process and Flyway migrations must not race
# between an old and a new pod.
strategy:
type: Recreate
selector:
matchLabels:
{{- include "ai-git-bot.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "ai-git-bot.selectorLabels" . | nindent 8 }}
{{- if .Values.prometheus.enabled }}
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8080"
prometheus.io/path: /actuator/prometheus
{{- end }}
spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if .Values.postgresql.enabled }}
initContainers:
- name: wait-for-postgresql
image: {{ .Values.postgresql.image }}
command:
- sh
- -c
- until pg_isready -h {{ include "ai-git-bot.postgresql.fullname" . }} -p 5432; do echo waiting for postgresql; sleep 2; done
securityContext:
{{- toYaml .Values.securityContext | nindent 10 }}
resources:
requests:
cpu: 10m
memory: 16Mi
limits:
cpu: 100m
memory: 64Mi
{{- end }}
containers:
- name: ai-git-bot
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext:
{{- toYaml .Values.securityContext | nindent 10 }}
ports:
- name: http
containerPort: 8080
envFrom:
- secretRef:
name: {{ .Values.existingSecret }}
env:
- name: SPRING_PROFILES_ACTIVE
value: docker
{{- if .Values.postgresql.enabled }}
- name: DATABASE_URL
value: jdbc:postgresql://{{ include "ai-git-bot.postgresql.fullname" . }}:5432/{{ .Values.postgresql.database }}
{{- end }}
- name: APP_PUBLIC_URL
value: {{ include "ai-git-bot.publicUrl" . | quote }}
- name: PROMETHEUS_ENABLED
value: {{ .Values.prometheus.enabled | quote }}
- name: GITEABOT_SECURITY_LOGIN_METHOD
value: {{ .Values.loginMethod | quote }}
{{- if eq .Values.loginMethod "oauth" }}
- name: GITEABOT_SECURITY_OAUTH_ISSUER_URI
value: {{ .Values.oauth.issuerUri | quote }}
- name: GITEABOT_SECURITY_OAUTH_SCOPE
value: {{ .Values.oauth.scope | quote }}
- name: GITEABOT_SECURITY_OAUTH_USER_NAME_ATTRIBUTE
value: {{ .Values.oauth.userNameAttribute | quote }}
{{- end }}
{{- range $name, $value := .Values.env }}
- name: {{ $name }}
value: {{ $value | quote }}
{{- end }}
startupProbe:
httpGet:
path: /actuator/health
port: http
periodSeconds: 10
failureThreshold: 30
livenessProbe:
httpGet:
path: /actuator/health
port: http
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /actuator/health
port: http
periodSeconds: 10
timeoutSeconds: 5
resources:
{{- toYaml .Values.resources | nindent 10 }}
volumeMounts:
- name: tmp
mountPath: /tmp
volumes:
- name: tmp
emptyDir:
sizeLimit: {{ .Values.tmpVolume.sizeLimit }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
@@ -0,0 +1,33 @@
{{- if .Values.ingress.enabled }}
{{- if not .Values.ingress.host }}
{{- fail "ingress.host is required when ingress.enabled is true" }}
{{- end }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "ai-git-bot.fullname" . }}
labels:
{{- include "ai-git-bot.labels" . | nindent 4 }}
{{- include "ai-git-bot.selectorLabels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ingressClassName: {{ .Values.ingress.className }}
rules:
- host: {{ .Values.ingress.host }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ include "ai-git-bot.fullname" . }}
port:
name: http
tls:
- secretName: {{ .Values.ingress.tlsSecretName }}
hosts:
- {{ .Values.ingress.host }}
{{- end }}
@@ -0,0 +1,98 @@
{{- if .Values.postgresql.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "ai-git-bot.postgresql.fullname" . }}
labels:
{{- include "ai-git-bot.labels" . | nindent 4 }}
{{- include "ai-git-bot.postgresql.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: database
spec:
type: ClusterIP
ports:
- name: tcp-postgresql
port: 5432
targetPort: tcp-postgresql
selector:
{{- include "ai-git-bot.postgresql.selectorLabels" . | nindent 4 }}
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "ai-git-bot.postgresql.fullname" . }}
labels:
{{- include "ai-git-bot.labels" . | nindent 4 }}
{{- include "ai-git-bot.postgresql.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: database
spec:
serviceName: {{ include "ai-git-bot.postgresql.fullname" . }}
replicas: 1
selector:
matchLabels:
{{- include "ai-git-bot.postgresql.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "ai-git-bot.postgresql.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: database
spec:
containers:
- name: postgresql
image: {{ .Values.postgresql.image }}
# NOTE: no securityContext. The official postgres image's entrypoint must
# start as root to chown a fresh data dir, then drops to the postgres user
# (uid 70 in alpine). Same pattern as forte-drop/vaultwarden postgresql.
ports:
- name: tcp-postgresql
containerPort: 5432
env:
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: {{ .Values.existingSecret }}
key: DATABASE_USERNAME
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.existingSecret }}
key: DATABASE_PASSWORD
- name: POSTGRES_DB
value: {{ .Values.postgresql.database }}
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
volumeMounts:
- name: data
mountPath: /var/lib/postgresql/data
livenessProbe:
exec:
command:
- sh
- -c
- pg_isready -U "$POSTGRES_USER" -d "$POSTGRES_DB"
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
exec:
command:
- sh
- -c
- pg_isready -U "$POSTGRES_USER" -d "$POSTGRES_DB"
initialDelaySeconds: 5
periodSeconds: 5
resources:
{{- toYaml .Values.postgresql.resources | nindent 10 }}
volumeClaimTemplates:
- metadata:
name: data
annotations:
argocd.argoproj.io/sync-options: Prune=false,Delete=false
spec:
accessModes:
- ReadWriteOnce
{{- with .Values.postgresql.storage.storageClassName }}
storageClassName: {{ . }}
{{- end }}
resources:
requests:
storage: {{ .Values.postgresql.storage.size }}
{{- end }}
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "ai-git-bot.fullname" . }}
labels:
{{- include "ai-git-bot.labels" . | nindent 4 }}
{{- include "ai-git-bot.selectorLabels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- name: http
port: {{ .Values.service.port }}
targetPort: http
selector:
{{- include "ai-git-bot.selectorLabels" . | nindent 4 }}
+90
View File
@@ -0,0 +1,90 @@
# Default values for ai-git-bot.
# Everything except the database connection and encryption key (AI providers, Git
# integrations, bots, prompts) is configured in the web UI and stored in PostgreSQL.
image:
repository: tmseidel/ai-git-bot
tag: "1.27.0"
pullPolicy: IfNotPresent
# Existing Secret with the app credentials. Every key is exposed to the app as an
# env var (envFrom). Required keys: DATABASE_USERNAME, DATABASE_PASSWORD,
# APP_ENCRYPTION_KEY. Optional: GITEABOT_SECURITY_OAUTH_CLIENT_ID,
# GITEABOT_SECURITY_OAUTH_CLIENT_SECRET (when loginMethod is "oauth").
existingSecret: ai-git-bot-secrets
# Public base URL of the bot (APP_PUBLIC_URL). Defaults to https://<ingress.host>.
publicUrl: ""
# Web UI login: "native" (DB-backed login form) or "oauth" (OIDC).
loginMethod: native
oauth:
issuerUri: ""
scope: "openid,profile"
userNameAttribute: preferred_username
prometheus:
enabled: false
# Additional plain env vars (see doc/DEPLOYMENT.md upstream for the full list).
env: {}
replicaCount: 1
resources:
requests:
cpu: 250m
memory: 1Gi
limits:
cpu: "2"
memory: 3Gi
# Agent workspaces (repo clones, builds, test runs) are created under /tmp.
tmpVolume:
sizeLimit: 10Gi
podSecurityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
service:
type: ClusterIP
port: 8080
ingress:
enabled: true
className: traefik
host: ""
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
tlsSecretName: ai-git-bot-tls
postgresql:
# Set to false and provide DATABASE_URL (via env or the secret) to use an external database.
enabled: true
image: postgres:17-alpine
database: giteabot
storage:
size: 5Gi
storageClassName: ""
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 500m
memory: 512Mi
nodeSelector: {}
tolerations: []
affinity: {}
+210
View File
@@ -0,0 +1,210 @@
❯ Plan and implement ai-git-bot based on the documentation https://github.com/tmseidel/ai-git-bot for Gitea. It should be hosted as a separate helm deployment on "upc-dev" overlay, with secrets ready to be sealed and added by me. I will also configure Gitea webhook myself afterwards.
Ran 1 shell command
● Fetch(https://github.com/tmseidel/ai-git-bot)
Received 463.7KB (200 OK)
Read 1 file, ran 2 shell commands
● Auto mode lets Claude handle permission prompts automatically — Claude checks each tool call for risky actions and prompt injection before executing. Actions Claude identifies as safe are executed, while actions Claude identifies as risky are blocked and Claude may try a different approach. Ideal for long-running tasks. Sessions are slightly more expensive. Claude can make mistakes that allow harmful commands to run, it's recommended to only use in isolated environments. Shift+Tab to change mode.
I've reviewed the ai-git-bot deployment docs — it's a Spring Boot app on :8080 needing Postgres and an APP_ENCRYPTION_KEY, with the rest configured how existing apps in this repo are wired(charts, ingress, TLS, secrets) to match the pattern.
Searched for 1 pattern, listed 1 directory, ran 3 shell commands
Got the conventions down: Argo multi-source apps, Traefik + cert-manager ingress, SealedSecrets, and plaintext
templates in gitignored private/upc-dev/. Chext, then writing the chart.
Ran 2 shell commands
No official Helm chart exists, just Docker C local chart for this repo — I'll also flagthat /setup is publicly accessible until the first admin is created. Writing the chart now.
Ran 2 shell commands
The shell heredoc tripped on quoting; I'll write the files directly instead.
● Write(apps\charts\ai-git-bot\Chart.yaml)
Wrote 6 lines to apps\charts\ai-git-bot\C
apiVersion: v2
name: ai-git-bot
description: AI-Git-Bot (https://github.com/tmseidel/ai-git-bot) - AI code review and coding agent for Gi
tea, with a bundled PostgreSQL
type: application
version: 0.1.0
appVersion: "1.27.0"
● Write(apps\charts\ai-git-bot\values.yaml)
Wrote 90 lines to apps\charts\ai-git-bot\
# Default values for ai-git-bot.
# Everything except the database conn providers, Git
# integrations, bots, prompts) is configured in the web UI and stored in PostgreSQL.
image:
repository: tmseidel/ai-git-bot
tag: "1.27.0"
pullPolicy: IfNotPresent
# Existing Secret with the app credeno the app as an
… +80 lines
● Write(apps\charts\ai-git-bot\templates\_helpers.tpl)
Wrote 33 lines to apps\charts\ai-git-bot\
{{- define "ai-git-bot.fullname" -}}
{{- .Release.Name | trunc 63 | trimSuf
{{- end -}}
{{- define "ai-git-bot.labels" -}}
helm.sh/chart: {{ printf "%s-%s" .Char
app.kubernetes.io/version: {{ .Values.image.tag | quote }}
app.kubernetes.io/managed-by: {{ .Rele
{{- end -}}
… +23 lines
● Write(apps\charts\ai-git-bot\templates\deplo
Wrote 124 lines to apps\charts\ai-git-bot\templates\deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "ai-git-bot.fullname" . }}
labels:
{{- include "ai-git-bot.labels" . | nindent 4 }}
{{- include "ai-git-bot.selectorL
spec:
replicas: {{ .Values.replicaCount }
# Recreate: agent sessions run in-process and Flyway migrations must not race
… +116 lines
● Write(apps\charts\ai-git-bot\templates\servi
Wrote 15 lines to apps\charts\ai-git-bot\templates\service.yaml
apiVersion: v1
kind: Service
metadata:
name: {{ include "ai-git-bot.fullname" . }}
labels:
{{- include "ai-git-bot.labels" . | nindent 4 }}
{{- include "ai-git-bot.selectorL
spec:
type: {{ .Values.service.type }}
ports:
… +5 lines
● Write(apps\charts\ai-git-bot\templates\ingre
Wrote 33 lines to apps\charts\ai-git-bot\templates\ingress.yaml
{{- if .Values.ingress.enabled }}
{{- if not .Values.ingress.host }}
{{- fail "ingress.host is required wh}
{{- end }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "ai-git-bot.fullname" . }}
labels:
{{- include "ai-git-bot.labels" . | nindent 4 }}
… +23 lines
● Write(apps\charts\ai-git-bot\templates\postg
Wrote 98 lines to apps\charts\ai-git-bot\templates\postgresql.yaml
{{- if .Values.postgresql.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "ai-git-bot.postgr
labels:
{{- include "ai-git-bot.labels" .
{{- include "ai-git-bot.postgresql.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: data
spec:
… +88 lines
● Update(apps\charts\ai-git-bot\templates\depl
Added 2 lines, removed 2 lines
metadata:
labels:
{{- include "ai-git-bot.sele
{{- if .Values.prometheus.enabled }}
annotations:
{{- if .Values.prometheus.enabled }}
prometheus.io/scrape: "true"
prometheus.io/port: "8080"
prometheus.io/path: /actuato
{{- end }}
{{- end }}
spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
● Write(apps\overlays\upc-dev\ai-git-bot\ai-git-bot.yaml)
Wrote 48 lines to apps\overlays\upc-dev\a
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: ai-git-bot
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "1"
labels:
app.kubernetes.io/name: ai-git-bot
app.kubernetes.io/part-of: apps
… +38 lines
● Write(apps\overlays\upc-dev\ai-git-bot\values.yaml)
Wrote 21 lines to apps\overlays\upc-dev\a
# upc-dev values for apps/charts/ai-git-bot
# AI providers, the Gitea integrationre configured
# in the web UI after the first login; see apps/overlays/upc-dev/ai-git-bot/README.md.
existingSecret: ai-git-bot-secrets
ingress:
host: ai-git-bot.forteapps.net
annotations:
cert-manager.io/cluster-issuer: l
… +11 lines
● Write(apps\overlays\upc-dev\ai-git-bot\kustomization.yaml)
Wrote 7 lines to apps\overlays\upc-dev\ai
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ai-git-bot.yaml
# Uncomment once the secret has been sealed (see README.md in this directory).
# Until then the pods wait in CreateCo
# - ai-git-bot-secrets-sealed.yaml
Now the plaintext secret (in gitignored private/upc-dev/, with freshly generated random values) and the README.
Searched for 1 pattern, ran 1 shell command
"Development" group already exists. Now the README and wiring into the upc-dev overlay.
● Write(apps\overlays\upc-dev\ai-git-bot\README.md) Wrote 63 lines to apps\overlays\upc-dev\a
# ai-git-bot (upc-dev)
[AI-Git-Bot](https://github.com/tmseidel/ai-git-bot) reviews Gitea pull requests and can implement issues as a coding agent. IHelm chart
`apps/charts/ai-git-bot` (app + bundled PostgreSQL 17) into the `ai-git-bot` namespace.
| | | |---|---|
| URL | https://ai-git-bot.forteapps.net | | Chart | `apps/charts/ai-git-bot` |
… +54 lines
● Update(apps\overlays\upc-dev\kustomization.yaml) Added 1 line
- forte-drop-postgresql - forte-drop
- forte-drop-mcp - ai-git-bot
# No patches needed — base apps alree paths
# (upc-dev is the default/base cluster).
● Update(apps\overlays\upc-dev\kustomization.yaml) Added 1 line
# forte-drop (postgres + web + mcp) and dbunk-demo are upc-dev-only apps — their # values hardcode upc-dev hosts (drot not sync to
# upc-prod, so they live here in the overlay rather than in apps/base/. # ai-git-bot is upc-dev-only as well-bot).
lidating: helm lint/template with the upc-uild of the overlay.
n 2 shell commands
-git-bot is set up as its own Helm deploymt file is ready for you to seal. helm lint,helm template and kubectl kustomize apps/overlays/upc-dev all pass. Nothing has been deployed to the cluster yet,thing is committed.
at I built
- The upstream project only provides Docker Compose, not a Helm chart, so I wrote a small chart at apps/charts/ai-git-bot/. It runs the app (:1.27.0) plus its own PostgreSQL 17 databasewith 5Gi storage, set so Argo won't delete the volume. It also includes the web address and TLS certificate, anhealth checks. The bot runs one pod, whichlapped on updates. Repo clones and agentbuilds use a 10Gi temporary volume. apps/overlays/upc-dev/ai-git-bot/ holds thattern as vaultwarden), the upc-dev settingsand a README with the setup steps. I added it to apps/overlays/upc-dev/kustomization.yaml. The address is https://ai-git-bot.forteapp homepage under "Development". This assumesthe *.forteapps.net DNS record covers the new name.
Secrets ivate/upc-dev/ai-git-bot-secrets.yaml is gASE_USERNAME, plus a freshly generatedDATABASE_PASSWORD and APP_ENCRYPTION_KEY. To seal it: beseal --format=yaml --namespace=ai-git-bo
< private/upc-dev/ai-git-bot-secrets.yaml \ > apps/overlays/upc-dev/ai-git-bot/ai-git-
Then uncomment the line for that file in apps/overlays/upc-dev/ai-git-bot/kustomization.yaml. If you push before is, the pods will just wait for the secretack up APP_ENCRYPTION_KEY (for example inVaultwarden): it encrypts the API keys and Gitea tokens stored in the database, and losing it makes them unreadab
Before you set up the webhook Create the admin account straight after this public until an admin exists, and whoeveropens it first becomes admin. You can open it through kubectl -n ai-git-bot port-forward svc/ai-git-bot 8080:80instead.
- Everything else is configured in the bot's web interface, not in Helm: the Anthropic key, the Gitea connection (https://git.forteapps.net and the bot useselves. Each bot gets a webhook URL likehttps://ai-git-bot.forteapps.net/api/webhook/<secret>. Set a webhook signing secret on the bot and enter the same value in Gitea. The README lists the Gitea
- The login is a username and password by default. Keycloak login (id.forteapps.net) is built in but off; turning it on is one setting plus two secret keys, de
- The image is several GB because it bundles build tools for the agent, so the first start will be slow. Metrics are
off; Prometheus would need a new scrape co
✻ Brewed for 4m 34s · done 14:04
@@ -0,0 +1,63 @@
# ai-git-bot (upc-dev)
[AI-Git-Bot](https://github.com/tmseidel/ai-git-bot) reviews Gitea pull requests and can
implement issues as a coding agent. It is deployed from the local Helm chart
`apps/charts/ai-git-bot` (app + bundled PostgreSQL 17) into the `ai-git-bot` namespace.
| | |
|---|---|
| URL | https://ai-git-bot.forteapps.net |
| Chart | `apps/charts/ai-git-bot` |
| Values | `apps/overlays/upc-dev/ai-git-bot/values.yaml` |
| Secret | `ai-git-bot-secrets` (SealedSecret) |
| Webhook endpoint | `https://ai-git-bot.forteapps.net/api/webhook/<per-bot-secret>` |
## 1. Seal the secret
The plaintext template (random DB password and encryption key already generated) lives in
the gitignored `private/upc-dev/ai-git-bot-secrets.yaml`.
```bash
kubeseal --format=yaml --namespace=ai-git-bot \
< private/upc-dev/ai-git-bot-secrets.yaml \
> apps/overlays/upc-dev/ai-git-bot/ai-git-bot-secrets-sealed.yaml
```
Then uncomment `ai-git-bot-secrets-sealed.yaml` in `kustomization.yaml` and commit.
| Key | Purpose |
|---|---|
| `DATABASE_USERNAME` / `DATABASE_PASSWORD` | Used by both PostgreSQL (initdb) and the app |
| `APP_ENCRYPTION_KEY` | Encrypts AI API keys / Gitea tokens / SSH keys in the DB. Back it up; changing it makes stored credentials unreadable |
| `GITEABOT_SECURITY_OAUTH_CLIENT_ID` / `_SECRET` | Optional, only with `loginMethod: oauth` |
The DB password is only applied on the first PostgreSQL init. To rotate it later, change it
inside PostgreSQL (`ALTER USER`) as well as in the secret.
## 2. First login (do this right after the first sync)
`/setup` is public until the first admin account exists — whoever opens it first becomes
admin. Open https://ai-git-bot.forteapps.net immediately after the pod is ready (or use
`kubectl -n ai-git-bot port-forward svc/ai-git-bot 8080:8080`) and create the admin.
Then in the web UI:
1. **AI Integrations** → add Anthropic (API key + model).
2. **Git Integrations** → Gitea, URL `https://git.forteapps.net`, token of the bot user
(scopes `write:issue`, `write:repository`, `write:user`).
3. **Bots** → create a bot, set **Username** to the Gitea bot user, set a
**Webhook signing secret**, copy the webhook URL.
## 3. Gitea webhook
Repo or org **Settings → Webhooks → Add Webhook → Gitea**: target = the bot's webhook URL,
`POST`, `application/json`, secret = the bot's signing secret. Custom events: Pull Request,
Pull Request Comment, Pull Request Review Requested, Pull Request Assigned, Issue Comment,
and Issue Assigned + Issues if you use the coding agent. See upstream
[GITEA_SETUP.md](https://github.com/tmseidel/ai-git-bot/blob/main/doc/GITEA_SETUP.md).
## Optional: Keycloak login
Set `loginMethod: oauth` and `oauth.issuerUri: https://id.forteapps.net/realms/forte` in
`values.yaml`, add the client id/secret keys to the secret, and register
`https://ai-git-bot.forteapps.net/login/oauth2/code/giteabot` as redirect URI.
@@ -0,0 +1,48 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: ai-git-bot
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "1"
labels:
app.kubernetes.io/name: ai-git-bot
app.kubernetes.io/part-of: apps
app.kubernetes.io/managed-by: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
sources:
- repoURL: ssh://git@git.forteapps.net:2222/Forte/launchpad.git
path: apps/charts/ai-git-bot
targetRevision: HEAD
helm:
releaseName: ai-git-bot
valueFiles:
- $values/apps/overlays/upc-dev/ai-git-bot/values.yaml
- repoURL: ssh://git@git.forteapps.net:2222/Forte/launchpad.git
targetRevision: HEAD
ref: values
destination:
server: https://kubernetes.default.svc
namespace: ai-git-bot
syncPolicy:
automated:
prune: true
selfHeal: true
allowEmpty: false
syncOptions:
- CreateNamespace=true
- Validate=true
- ServerSideApply=true
ignoreDifferences:
- group: apps
kind: StatefulSet
jsonPointers:
- /spec/volumeClaimTemplates
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ai-git-bot.yaml
# Uncomment once the secret has been sealed (see README.md in this directory).
# Until then the pods wait in CreateContainerConfigError.
# - ai-git-bot-secrets-sealed.yaml
@@ -0,0 +1,21 @@
# upc-dev values for apps/charts/ai-git-bot
# AI providers, the Gitea integration (URL + bot token) and bots are configured
# in the web UI after the first login; see apps/overlays/upc-dev/ai-git-bot/README.md.
existingSecret: ai-git-bot-secrets
ingress:
host: ai-git-bot.forteapps.net
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
gethomepage.dev/enabled: "true"
gethomepage.dev/name: "AI Git Bot"
gethomepage.dev/description: "AI code review and coding agent for Gitea"
gethomepage.dev/group: "Development"
gethomepage.dev/icon: "gitea"
gethomepage.dev/href: "https://ai-git-bot.forteapps.net"
postgresql:
storage:
size: 5Gi
storageClassName: upcloud-block-storage-maxiops
+2
View File
@@ -5,9 +5,11 @@ resources:
- forte-drop-postgresql - forte-drop-postgresql
- forte-drop - forte-drop
- forte-drop-mcp - forte-drop-mcp
- ai-git-bot
# No patches needed — base apps already default to "upc-dev" value paths # No patches needed — base apps already default to "upc-dev" value paths
# (upc-dev is the default/base cluster). # (upc-dev is the default/base cluster).
# forte-drop (postgres + web + mcp) and dbunk-demo are upc-dev-only apps — their # forte-drop (postgres + web + mcp) and dbunk-demo are upc-dev-only apps — their
# values hardcode upc-dev hosts (drop.forteapps.net etc.) and must not sync to # values hardcode upc-dev hosts (drop.forteapps.net etc.) and must not sync to
# upc-prod, so they live here in the overlay rather than in apps/base/. # upc-prod, so they live here in the overlay rather than in apps/base/.
# ai-git-bot is upc-dev-only as well (chart in apps/charts/ai-git-bot).