Compare commits

..
Author SHA1 Message Date
d087472e63 Add forte-cli public device-code Keycloak client
AI Code Review / ai-review (pull_request) Skipped
scan.yaml / test (pull_request) Successful in 27s
Add a shared public client `forte-cli` to the `forte` realm so downloaded
skills (forte-drop first) can do RFC 8628 device-code login through the
Auth Sidecar. Today no client in the realm has the device grant enabled,
so the flow cannot start.

Client (inline in forte-realm.json, imported verbatim by keycloak-config-cli):
- publicClient: true, standardFlowEnabled: false,
  directAccessGrantsEnabled: false
- attributes: oauth2.device.authorization.grant.enabled=true
- no secret, no redirectUris/webOrigins, no k8s.secret.sync

It has to go in the realm JSON because the self-service registrar
hardcodes publicClient:false/standardFlowEnabled:true and drops
attributes. Also add forte-cli to the cleanup CronJob's protected list
(belt-and-braces; it does not match the UUID pattern anyway).

Additive only: gitea/grafana/argocd and all other realm settings are
unchanged. Keycloak is deployed only via the upc-dev overlay, which
inherits base values, so this lands on id.forteapps.net.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QciXev3MtCxo3eomcfrDRW
2026-10-01 10:37:49 +00:00
27 changed files with 78 additions and 200 deletions
+51
View File
@@ -0,0 +1,51 @@
name: AI Code Review
on:
pull_request:
types: [ labeled, synchronize ]
jobs:
ai-review:
if: >-
(github.event.action == 'synchronized' && contains(toJSON(github.event.pull_request.labels), 'ai-review')) || contains(toJSON(gitea.event.changes.added_labels), 'ai-review')
runs-on: ubuntu-latest
env:
AI_REVIEW_CONFIG_FILE_YAML: ./shared-prompts/iac/.ai-review.yaml
# VCS configuration
VCS__PROVIDER: GITEA
VCS__PIPELINE__OWNER: ${{ github.repository_owner }}
VCS__PIPELINE__REPO: ${{ github.event.repository.name }}
VCS__PIPELINE__PULL_NUMBER: ${{ github.event.pull_request.number }}
VCS__HTTP_CLIENT__API_URL: https://git.forteapps.net/api/v1
VCS__HTTP_CLIENT__API_TOKEN: ${{ secrets.AI_REVIEW_TOKEN }}
# Review — disable fallback to see real Gitea API errors
REVIEW__INLINE_COMMENT_FALLBACK: "false"
# LLM configuration
LLM__PROVIDER: CLAUDE
LLM__META__MODEL: claude-sonnet-5-5
LLM__META__REASONING__EFFORT: high
LLM__META__MAX_TOKENS: "4096"
LLM__HTTP_CLIENT__API_URL: https://api.anthropic.com
LLM__HTTP_CLIENT__API_TOKEN: ${{ secrets.ANTHROPIC_API_KEY }}
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
submodules: true
fetch-depth: 0
token: ${{ secrets.AI_REVIEW_TOKEN }}
- name: Update submodules to remote
run: git submodule update --remote --merge
- name: Run inline review
uses: docker://nikitafilonov/ai-review:v1.1.0
with:
args: ai-review run-inline
- name: Run summary review
uses: docker://nikitafilonov/ai-review:v1.1.0
with:
args: ai-review run-summary
+1 -1
View File
@@ -4,7 +4,7 @@ terraform {
required_providers { required_providers {
azurerm = { azurerm = {
source = "hashicorp/azurerm" source = "hashicorp/azurerm"
version = "~> 5.0" version = "~> 4.0"
} }
} }
} }
@@ -4,7 +4,7 @@ terraform {
required_providers { required_providers {
azurerm = { azurerm = {
source = "hashicorp/azurerm" source = "hashicorp/azurerm"
version = "~> 5.0" version = "~> 4.0"
} }
azuread = { azuread = {
source = "hashicorp/azuread" source = "hashicorp/azuread"
+1 -1
View File
@@ -4,7 +4,7 @@ terraform {
required_providers { required_providers {
azurerm = { azurerm = {
source = "hashicorp/azurerm" source = "hashicorp/azurerm"
version = "~> 5.0" version = "~> 4.0"
} }
} }
} }
+1 -1
View File
@@ -4,7 +4,7 @@ terraform {
required_providers { required_providers {
azurerm = { azurerm = {
source = "hashicorp/azurerm" source = "hashicorp/azurerm"
version = "~> 5.0" version = "~> 4.0"
} }
random = { random = {
source = "hashicorp/random" source = "hashicorp/random"
+1 -1
View File
@@ -2,7 +2,7 @@ terraform {
required_providers { required_providers {
aws = { aws = {
source = "hashicorp/aws" source = "hashicorp/aws"
version = "~> 6.0" version = "~> 5.0"
} }
tls = { tls = {
source = "hashicorp/tls" source = "hashicorp/tls"
@@ -2,7 +2,7 @@ terraform {
required_providers { required_providers {
aws = { aws = {
source = "hashicorp/aws" source = "hashicorp/aws"
version = "~> 6.0" version = "~> 5.0"
} }
tls = { tls = {
source = "hashicorp/tls" source = "hashicorp/tls"
+1 -1
View File
@@ -2,7 +2,7 @@ terraform {
required_providers { required_providers {
aws = { aws = {
source = "hashicorp/aws" source = "hashicorp/aws"
version = "~> 6.0" version = "~> 5.0"
} }
tls = { tls = {
source = "hashicorp/tls" source = "hashicorp/tls"
+1 -1
View File
@@ -2,7 +2,7 @@ terraform {
required_providers { required_providers {
aws = { aws = {
source = "hashicorp/aws" source = "hashicorp/aws"
version = "~> 6.0" version = "~> 5.0"
} }
tls = { tls = {
source = "hashicorp/tls" source = "hashicorp/tls"
+1 -1
View File
@@ -2,7 +2,7 @@ terraform {
required_providers { required_providers {
google = { google = {
source = "hashicorp/google" source = "hashicorp/google"
version = "~> 8.0" version = "~> 6.0"
} }
} }
} }
@@ -2,7 +2,7 @@ terraform {
required_providers { required_providers {
google = { google = {
source = "hashicorp/google" source = "hashicorp/google"
version = "~> 8.0" version = "~> 6.0"
} }
} }
} }
+1 -1
View File
@@ -2,7 +2,7 @@ terraform {
required_providers { required_providers {
google = { google = {
source = "hashicorp/google" source = "hashicorp/google"
version = "~> 8.0" version = "~> 6.0"
} }
} }
} }
+1 -1
View File
@@ -2,7 +2,7 @@ terraform {
required_providers { required_providers {
google = { google = {
source = "hashicorp/google" source = "hashicorp/google"
version = "~> 8.0" version = "~> 6.0"
} }
} }
} }
@@ -1,63 +0,0 @@
# 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.
@@ -1,16 +0,0 @@
---
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
name: ai-git-bot-secrets
namespace: ai-git-bot
spec:
encryptedData:
APP_ENCRYPTION_KEY: AgA29XsXvNJ+urtr6e491V8O2ZGESdQ3+FjjdHXtDKRhcOZLT3vX/c703uiUdU+JvWHfvn6QZKubCnx13erZTp4/nDOl3cW8BjPTRh3xYIzxs+KGFqG/jB++XCvDfXVGn/JPEvoV9V/5Y0Lpa2MDT8fjoyxjqxfp9GFlovwwozEIqqYBMseRi4711cN/aCPuZBB/PDTaOwNqlU1rRkPbGCQjTj7PVuQrELCD0suAj1h90igv6+rA0sgaNCZ+zIQkjsUkWOxZ53GllMa3agTQG4I2JwQ1UBdDSDpMQRIMpVGhRP+dKGV2KRb8jvMOZHWn13uiSHQgIY8iSc00uAoNGsqlcMEffewNTIFn6isAbEYJT3wg4sXOccIFZ3Hxjywg9R6TE99VlKC914pFk1emSlATARfUQ1uMQNrnWfqjQUt82PA3JnOooj1yGgqUyEubJaNpxTZfVf8PuhAEgg0EgG8j//Cn84HbrokDawbDI3Hnpd+UtD4DE9APlDaPrV3q06vu7HKRF2uV8m0Jvznk6wJDGLhjq1oNR6d1a0CxkRl5IQIJhgwNTULnjcmwsMs9xmm5BBrUDZcyWZGJ9U+fxFTM9vbznVI4ZKDuQq5q9xD9p6A84WQEK6jEmQ+tn2UorpJF7/B6TeKZ35AOpYQO82zzQ94IyeAYxegwF+0pPqkGYGXOKJJJ6Bn9iQMQp6v/JuVALc5+uA0s1ltpIOeiVHdnHwTaZcse31cKRDBKZIDkEUN04pLcK6buDcGC7Q==
DATABASE_PASSWORD: AgCxxe6q1p0SgeF1vEUhU3LMXUUvIWXdcVAub88lVvJreGwiRLz7NfXPemThPoHo0Lrzn+dYZYWt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gNppxFNmAv5EEz1ToXLKqY+5LEgAmqiKhVDw1nVqO4t7FvKq5K9Elf5TeyqrGKI2h8qlKHfsUMKie8ek2zQhm54RHqD20GBFhZ9BAZhllNAdKKkf1px2KPPJW4RCH7NPzf8zcw+r4hOKxZYBvIJOPpYHxFnxMquhL8k2wNabjAhOSnI+CDigAGELEMmmmBZV/uOcXxvzxN8GmP957rl+Dj9eIBTWWH+eeRiGATqRQ0AYFfWixQK1B5zBGWJJPFhkU16uuD49K2iJp8u0wCk82IulikxMk9LbLU7qZwPUqa15jJbFAXoK0w7LucuJS6KHloRrPw==
template:
metadata:
name: ai-git-bot-secrets
namespace: ai-git-bot
type: Opaque
@@ -1,50 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: ai-git-bot
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "1"
notifications.argoproj.io/subscribe.on-sync-succeeded.slack: ""
notifications.argoproj.io/subscribe.on-sync-failed.slack: ""
notifications.argoproj.io/subscribe.on-degraded.slack: ""
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/forte-helm.git
path: ai-git-bot
targetRevision: HEAD
helm:
valueFiles:
- $values/ai-git-bot/values.yaml
- repoURL: ssh://git@git.forteapps.net:2222/Forte/helm-prod-values.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
@@ -1,5 +0,0 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ai-git-bot.yaml
- ai-git-bot-secrets-sealed.yaml
-2
View File
@@ -5,11 +5,9 @@ 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).
+1 -1
View File
@@ -29,7 +29,7 @@ spec:
topologyKey: kubernetes.io/hostname topologyKey: kubernetes.io/hostname
initContainers: initContainers:
- name: gitea-dump - name: gitea-dump
image: gitea/gitea:28.1.0 image: gitea/gitea:1.27.3
command: command:
- sh - sh
- -c - -c
+1 -1
View File
@@ -17,7 +17,7 @@ spec:
sources: sources:
- repoURL: https://fluent.github.io/helm-charts - repoURL: https://fluent.github.io/helm-charts
chart: fluent-bit chart: fluent-bit
targetRevision: 0.58.3 targetRevision: 0.58.2
helm: helm:
releaseName: fluent-bit releaseName: fluent-bit
valueFiles: valueFiles:
+1 -1
View File
@@ -17,7 +17,7 @@ spec:
sources: sources:
- repoURL: https://grafana.github.io/helm-charts - repoURL: https://grafana.github.io/helm-charts
chart: grafana chart: grafana
targetRevision: "10.5.15" targetRevision: "8.15.0"
helm: helm:
releaseName: grafana releaseName: grafana
valueFiles: valueFiles:
+1 -1
View File
@@ -17,7 +17,7 @@ spec:
sources: sources:
- repoURL: https://prometheus-community.github.io/helm-charts - repoURL: https://prometheus-community.github.io/helm-charts
chart: prometheus chart: prometheus
targetRevision: "29.36.1" targetRevision: "28.16.0"
helm: helm:
releaseName: prometheus releaseName: prometheus
valueFiles: valueFiles:
@@ -24,7 +24,7 @@ spec:
sources: sources:
- repoURL: https://traefik.github.io/charts - repoURL: https://traefik.github.io/charts
chart: traefik chart: traefik
targetRevision: "41.7.1" targetRevision: "28.3.0"
helm: helm:
releaseName: traefik releaseName: traefik
valueFiles: valueFiles:
@@ -17,7 +17,7 @@ spec:
sources: sources:
- repoURL: https://guerzon.github.io/vaultwarden - repoURL: https://guerzon.github.io/vaultwarden
chart: vaultwarden chart: vaultwarden
targetRevision: "0.46.3" targetRevision: "0.46.2"
helm: helm:
releaseName: vaultwarden releaseName: vaultwarden
valueFiles: valueFiles:
+1 -15
View File
@@ -200,21 +200,7 @@ keycloakConfigCli:
"webOrigins": [], "webOrigins": [],
"attributes": { "attributes": {
"oauth2.device.authorization.grant.enabled": "true" "oauth2.device.authorization.grant.enabled": "true"
}, }
"protocolMappers": [
{
"name": "audience-forte-drop-mcp",
"protocol": "openid-connect",
"protocolMapper": "oidc-audience-mapper",
"consentRequired": false,
"config": {
"included.custom.audience": "https://mcp.drop.forteapps.net/mcp",
"access.token.claim": "true",
"id.token.claim": "false",
"introspection.token.claim": "true"
}
}
]
} }
], ],
"browserFlow": "browser-auto-idp", "browserFlow": "browser-auto-idp",
+6 -9
View File
@@ -4,17 +4,14 @@ opencost:
extraEnv: extraEnv:
EMIT_KSM_V1_METRICS: "false" EMIT_KSM_V1_METRICS: "false"
EMIT_KSM_V1_METRICS_ONLY: "true" EMIT_KSM_V1_METRICS_ONLY: "true"
prometheus:
internal:
enabled: true
serviceName: prometheus-server
namespaceName: monitoring
port: 80
# Cloud-specific pricing is in per-cluster value overrides # Cloud-specific pricing is in per-cluster value overrides
# (e.g. infra/values/upc-dev/opencost-values.yaml) # (e.g. infra/values/upc-dev/opencost-values.yaml)
# NOTE: `prometheus` is a sibling of `exporter` under `opencost` in the
# chart's values schema - nesting it inside `exporter` silently falls back
# to the chart default namespace (prometheus-system).
prometheus:
internal:
enabled: true
serviceName: prometheus-server
namespaceName: monitoring
port: 80
ui: ui:
enabled: false enabled: false
service: service:
+2 -22
View File
@@ -4,12 +4,6 @@ server:
service: service:
servicePort: 80 servicePort: 80
strategy:
type: Recreate
retention: 7d
retentionSize: 6GB
resources: resources:
requests: requests:
cpu: 150m cpu: 150m
@@ -24,7 +18,7 @@ server:
extraScrapeConfigs: | extraScrapeConfigs: |
- job_name: kyverno - job_name: kyverno
scrape_interval: 60s scrape_interval: 15s
metrics_path: /metrics metrics_path: /metrics
kubernetes_sd_configs: kubernetes_sd_configs:
- role: endpoints - role: endpoints
@@ -41,16 +35,9 @@ extraScrapeConfigs: |
target_label: pod target_label: pod
- source_labels: [__meta_kubernetes_namespace] - source_labels: [__meta_kubernetes_namespace]
target_label: namespace target_label: namespace
metric_relabel_configs:
- source_labels: [__name__]
regex: 'kyverno_(http_requests_duration_seconds|controller_.+_duration_seconds|admission_review_duration_seconds)_bucket'
action: drop
- source_labels: [__name__]
regex: 'go_.*|process_.*'
action: drop
- job_name: traefik - job_name: traefik
scrape_interval: 60s scrape_interval: 15s
metrics_path: /metrics metrics_path: /metrics
kubernetes_sd_configs: kubernetes_sd_configs:
- role: endpoints - role: endpoints
@@ -67,13 +54,6 @@ extraScrapeConfigs: |
target_label: pod target_label: pod
- source_labels: [__meta_kubernetes_namespace] - source_labels: [__meta_kubernetes_namespace]
target_label: namespace target_label: namespace
metric_relabel_configs:
- source_labels: [__name__]
regex: 'traefik_(router|service|entrypoint)_request_duration_seconds_bucket'
action: drop
- source_labels: [__name__]
regex: 'go_.*|process_.*'
action: drop
alertmanager: alertmanager:
enabled: false enabled: false