Compare commits
27
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
920693df1b | ||
|
|
dfd5f8dd2d | ||
|
|
f59fb476b8 | ||
|
|
e33a2228e1 | ||
|
|
27bce41bf6 | ||
|
|
1edf1ba7f1 | ||
|
|
44d5207622 | ||
|
|
7a239b2469 | ||
|
|
795cef5a85 | ||
|
|
c1a2dbf52a | ||
|
|
0f854f2bfa | ||
|
|
283d30b422 | ||
|
|
2b2ceab2d1 | ||
|
|
6243ac40b7 | ||
|
|
d6fca68f33 | ||
|
|
e12327f963 | ||
|
|
b03098aa1c | ||
|
|
f61e8f1f68 | ||
|
|
7016f764e6 | ||
|
|
d826510a98 | ||
|
|
467b3441c9 | ||
|
|
7e91262257 | ||
|
|
0edd6bc73a | ||
|
|
4ad0102260 | ||
|
|
e0c08a90b3 | ||
|
|
dfbe2cc920 | ||
|
|
ae93c7ca0d |
@@ -23,7 +23,7 @@ spec:
|
|||||||
containers:
|
containers:
|
||||||
# --- Gotify server ---
|
# --- Gotify server ---
|
||||||
- name: gotify
|
- name: gotify
|
||||||
image: ghcr.io/gotify/server:2.6.1
|
image: ghcr.io/gotify/server:3.1.0
|
||||||
command: ["/bin/sh", "-c"]
|
command: ["/bin/sh", "-c"]
|
||||||
args:
|
args:
|
||||||
- |
|
- |
|
||||||
@@ -84,7 +84,7 @@ spec:
|
|||||||
# Watches Gotify WebSocket stream, forwards messages as email.
|
# Watches Gotify WebSocket stream, forwards messages as email.
|
||||||
# https://github.com/eternal-flame-AD/gotify-broadcast
|
# https://github.com/eternal-flame-AD/gotify-broadcast
|
||||||
- name: smtp-emailer
|
- name: smtp-emailer
|
||||||
image: ghcr.io/gotify/server:2.6.1
|
image: ghcr.io/gotify/server:3.1.0
|
||||||
command:
|
command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: igotify
|
||||||
|
namespace: notifications
|
||||||
|
labels:
|
||||||
|
app: igotify
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
strategy:
|
||||||
|
type: Recreate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: igotify
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: igotify
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: igotify
|
||||||
|
image: ghcr.io/androidseb25/igotify-notification-assist:v1.6.0.1
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
protocol: TCP
|
||||||
|
env:
|
||||||
|
- name: ENABLE_CONSOLE_LOG
|
||||||
|
value: "true"
|
||||||
|
- name: ENABLE_SCALAR_UI
|
||||||
|
value: "true"
|
||||||
|
# GOTIFY_URLS / GOTIFY_CLIENT_TOKENS / SECNTFY_TOKENS intentionally
|
||||||
|
# left unset — not required when Gotify is reachable via public domain
|
||||||
|
# (gotify.riotpiao.com). iGotify iOS app registers itself at runtime.
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /app/data
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /Version
|
||||||
|
port: 8080
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 30
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /Version
|
||||||
|
port: 8080
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 10
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 50m
|
||||||
|
memory: 64Mi
|
||||||
|
limits:
|
||||||
|
cpu: 200m
|
||||||
|
memory: 128Mi
|
||||||
|
volumes:
|
||||||
|
- name: data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: igotify-data
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: igotify
|
||||||
|
namespace: notifications
|
||||||
|
annotations:
|
||||||
|
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
|
||||||
|
nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
|
||||||
|
nginx.ingress.kubernetes.io/proxy-http-version: "1.1"
|
||||||
|
spec:
|
||||||
|
ingressClassName: nginx
|
||||||
|
rules:
|
||||||
|
- host: igotify.riotpiao.com
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: igotify
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: igotify-data
|
||||||
|
namespace: notifications
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: igotify
|
||||||
|
namespace: notifications
|
||||||
|
labels:
|
||||||
|
app: igotify
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: igotify
|
||||||
|
ports:
|
||||||
|
- port: 80
|
||||||
|
targetPort: 8080
|
||||||
|
protocol: TCP
|
||||||
@@ -6,11 +6,9 @@ metadata:
|
|||||||
annotations:
|
annotations:
|
||||||
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
|
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
|
||||||
nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
|
nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
|
||||||
# WebSocket support for Gotify client connections
|
# WebSocket support for Gotify client connections (/stream endpoint)
|
||||||
|
# nginx-ingress handles Upgrade/Connection headers natively with http/1.1
|
||||||
nginx.ingress.kubernetes.io/proxy-http-version: "1.1"
|
nginx.ingress.kubernetes.io/proxy-http-version: "1.1"
|
||||||
nginx.ingress.kubernetes.io/configuration-snippet: |
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "upgrade";
|
|
||||||
spec:
|
spec:
|
||||||
ingressClassName: nginx
|
ingressClassName: nginx
|
||||||
rules:
|
rules:
|
||||||
|
|||||||
@@ -6,3 +6,7 @@ resources:
|
|||||||
- deployment.yaml
|
- deployment.yaml
|
||||||
- service.yaml
|
- service.yaml
|
||||||
- ingress.yaml
|
- ingress.yaml
|
||||||
|
- igotify-pvc.yaml
|
||||||
|
- igotify-deployment.yaml
|
||||||
|
- igotify-service.yaml
|
||||||
|
- igotify-ingress.yaml
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ spec:
|
|||||||
- name: OLLAMA_MODELS
|
- name: OLLAMA_MODELS
|
||||||
value: /mnt/models/ollama
|
value: /mnt/models/ollama
|
||||||
- name: OLLAMA_CONTEXT_LENGTH
|
- name: OLLAMA_CONTEXT_LENGTH
|
||||||
value: '32768'
|
value: '65536'
|
||||||
- name: OLLAMA_KEEP_ALIVE
|
- name: OLLAMA_KEEP_ALIVE
|
||||||
value: '-1'
|
value: '-1'
|
||||||
- name: OLLAMA_NUM_PARALLEL
|
- name: OLLAMA_NUM_PARALLEL
|
||||||
|
|||||||
@@ -20,3 +20,7 @@ data:
|
|||||||
# wire up allauth's confirm-email view, so signup 500s with NoReverseMatch
|
# wire up allauth's confirm-email view, so signup 500s with NoReverseMatch
|
||||||
# on 'account_confirm_email' without this.
|
# on 'account_confirm_email' without this.
|
||||||
PAPERLESS_ACCOUNT_EMAIL_VERIFICATION: "none"
|
PAPERLESS_ACCOUNT_EMAIL_VERIFICATION: "none"
|
||||||
|
# Auto-connect social accounts to existing users with matching email
|
||||||
|
PAPERLESS_SOCIAL_AUTO_SIGNUP: "true"
|
||||||
|
# Allow automatic linking of social accounts to existing users
|
||||||
|
PAPERLESS_ACCOUNT_ALLOW_SIGNUPS: "true"
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace: paperless
|
|||||||
resources:
|
resources:
|
||||||
- pvc.yaml
|
- pvc.yaml
|
||||||
- configmap.yaml
|
- configmap.yaml
|
||||||
|
- paperless-ai-config.yaml
|
||||||
- redis.yaml
|
- redis.yaml
|
||||||
- deployment.yaml
|
- deployment.yaml
|
||||||
- service.yaml
|
- service.yaml
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: paperless-ai-env
|
||||||
|
namespace: paperless
|
||||||
|
data:
|
||||||
|
paperless-ai-config.env: |
|
||||||
|
# Paperless-NGX API configuration
|
||||||
|
PAPERLESS_URL=http://paperless.paperless.svc.cluster.local:8000
|
||||||
|
PAPERLESS_API_TOKEN=7b89463e04c141f4172fbcddf78d623547d327ec
|
||||||
|
|
||||||
|
# AI Processing settings
|
||||||
|
ENABLE_AI_PROCESSING=yes
|
||||||
|
AI_MODEL=reasoning
|
||||||
|
LLM_API_URL=https://api.riotpiao.com/v1
|
||||||
|
LLM_API_TOKEN_FILE=/app/data/llm_token.txt
|
||||||
|
|
||||||
|
# Auto-tagging configuration
|
||||||
|
ENABLE_AUTO_TAGGING=yes
|
||||||
|
ENABLE_CORRESPONDENT_EXTRACTION=yes
|
||||||
|
ENABLE_DOCUMENT_TYPE_EXTRACTION=yes
|
||||||
|
ENABLE_TITLE_GENERATION=yes
|
||||||
|
|
||||||
|
# Advanced tagging with AI
|
||||||
|
ENABLE_INTELLIGENT_TAGGING=yes
|
||||||
|
ENABLE_DATE_EXTRACTION=yes
|
||||||
|
ENABLE_TIMELINE_TAGGING=yes
|
||||||
|
AUTO_CREATE_TAGS=yes
|
||||||
|
|
||||||
|
# Tagging prompts for custom extraction
|
||||||
|
CUSTOM_EXTRACTION_PROMPT=Extract document date, time period, financial year, and temporal context. Create tags like YYYY, Q1-YYYY, Last-Month, Current-Year, Historic
|
||||||
|
TAG_EXTRACTION_MODEL=reasoning
|
||||||
|
|
||||||
|
# Scanning behavior
|
||||||
|
SCAN_INTERVAL_SECONDS=60
|
||||||
|
PROCESS_EXISTING_DOCUMENTS=no
|
||||||
|
ADD_AI_TAG=yes
|
||||||
|
AI_TAG_NAME=ai-processed
|
||||||
|
|
||||||
|
# Date/Timeline tagging configuration
|
||||||
|
DATE_EXTRACTION_FORMAT=iso8601
|
||||||
|
TIMELINE_TAG_GRANULARITY=year,quarter,month
|
||||||
|
AUTO_TAG_HISTORICAL=yes
|
||||||
|
AUTO_TAG_RECENT=yes
|
||||||
|
|
||||||
|
# Performance
|
||||||
|
MAX_CONCURRENT_REQUESTS=2
|
||||||
|
REQUEST_TIMEOUT=60
|
||||||
|
DATE_EXTRACTION_TIMEOUT=30
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: paperless-ai-data
|
||||||
|
namespace: paperless
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
storageClassName: longhorn
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 2Gi
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: paperless-ai
|
||||||
|
namespace: paperless
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: paperless-ai
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/name: paperless-ai
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: paperless-ai
|
||||||
|
spec:
|
||||||
|
tolerations:
|
||||||
|
- key: node-role.kubernetes.io/control-plane
|
||||||
|
operator: Exists
|
||||||
|
effect: NoSchedule
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: paperless-ai-data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: paperless-ai-data
|
||||||
|
|
||||||
|
initContainers:
|
||||||
|
- name: fetch-llm-token
|
||||||
|
image: curlimages/curl:8.12.0
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
set -e
|
||||||
|
echo "[init] Fetching JWT token from Authentik for paperless-ai-agent..."
|
||||||
|
|
||||||
|
# Get JWT token via client_credentials grant
|
||||||
|
TOKEN_RESPONSE=$(curl -s -X POST https://authentik.riotpiao.com/application/o/token/ \
|
||||||
|
-d "grant_type=client_credentials" \
|
||||||
|
-d "client_id=paperless-ai-agent" \
|
||||||
|
-d "client_secret=29skAhE0tBzWn0qrPvmPTQMva0joFjcCr7msDQr_VXQ" \
|
||||||
|
-d "scope=openid llm:inference" 2>/dev/null)
|
||||||
|
|
||||||
|
# Extract token
|
||||||
|
TOKEN=$(echo "$TOKEN_RESPONSE" | grep -o '"access_token":"[^"]*' | cut -d'"' -f4)
|
||||||
|
|
||||||
|
if [ -z "$TOKEN" ]; then
|
||||||
|
echo "[error] Failed to get token. Response: $TOKEN_RESPONSE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Store token in file for main container to read
|
||||||
|
mkdir -p /data
|
||||||
|
echo "$TOKEN" > /data/llm_token.txt
|
||||||
|
echo "[init] Token fetched and stored successfully"
|
||||||
|
volumeMounts:
|
||||||
|
- name: paperless-ai-data
|
||||||
|
mountPath: /data
|
||||||
|
|
||||||
|
containers:
|
||||||
|
- name: paperless-ai
|
||||||
|
image: clusterzx/paperless-ai:latest
|
||||||
|
imagePullPolicy: Always
|
||||||
|
env:
|
||||||
|
# Paperless-ngx connection
|
||||||
|
- name: PAPERLESS_API_URL
|
||||||
|
value: "http://paperless.paperless.svc.cluster.local:8000"
|
||||||
|
- name: PAPERLESS_API_TOKEN
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: paperless-ai-config
|
||||||
|
key: PAPERLESS_API_TOKEN
|
||||||
|
- name: PAPERLESS_USERNAME
|
||||||
|
value: "admin"
|
||||||
|
|
||||||
|
# LLM API configuration
|
||||||
|
- name: AI_PROVIDER
|
||||||
|
value: "custom"
|
||||||
|
- name: CUSTOM_BASE_URL
|
||||||
|
value: "https://api.riotpiao.com/v1"
|
||||||
|
# Token file created by init container with JWT from Authentik
|
||||||
|
- name: CUSTOM_API_KEY_FILE
|
||||||
|
value: "/app/data/llm_token.txt"
|
||||||
|
- name: CUSTOM_MODEL
|
||||||
|
value: "qwen2.5:3b-instruct"
|
||||||
|
|
||||||
|
# Scanning behavior
|
||||||
|
- name: SCAN_INTERVAL
|
||||||
|
value: "60"
|
||||||
|
- name: PROCESS_PREDEFINED_DOCUMENTS
|
||||||
|
value: "no"
|
||||||
|
|
||||||
|
# Tagging configuration
|
||||||
|
- name: ADD_AI_TAG
|
||||||
|
value: "yes"
|
||||||
|
- name: AI_TAG_NAME
|
||||||
|
value: "ai-processed"
|
||||||
|
- name: ADD_AI_DESCRIPTIONS
|
||||||
|
value: "yes"
|
||||||
|
- name: USE_PROMPT_TAGS
|
||||||
|
value: "yes"
|
||||||
|
|
||||||
|
volumeMounts:
|
||||||
|
- name: paperless-ai-data
|
||||||
|
mountPath: /app/data
|
||||||
|
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 512Mi
|
||||||
|
limits:
|
||||||
|
cpu: "1"
|
||||||
|
memory: 2Gi
|
||||||
@@ -25,9 +25,15 @@ spec:
|
|||||||
- name: paperless-ai-data
|
- name: paperless-ai-data
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: paperless-ai-data
|
claimName: paperless-ai-data
|
||||||
|
- name: paperless-ai-env-config
|
||||||
|
configMap:
|
||||||
|
name: paperless-ai-env
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: fetch-llm-token
|
- name: fetch-llm-token
|
||||||
image: curlimages/curl:8.12.0
|
image: curlimages/curl:8.12.0
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 0
|
||||||
|
fsGroup: 0
|
||||||
command:
|
command:
|
||||||
- sh
|
- sh
|
||||||
- -c
|
- -c
|
||||||
@@ -43,8 +49,8 @@ spec:
|
|||||||
-d "client_secret=${LLM_AUTH_CLIENT_SECRET}" \
|
-d "client_secret=${LLM_AUTH_CLIENT_SECRET}" \
|
||||||
-d "scope=openid llm:inference" 2>/dev/null)
|
-d "scope=openid llm:inference" 2>/dev/null)
|
||||||
|
|
||||||
# Extract token
|
# Extract token from JSON response using sed (handles spaces after colons)
|
||||||
TOKEN=$(echo "$TOKEN_RESPONSE" | grep -o '"access_token":"[^"]*' | cut -d'"' -f4)
|
TOKEN=$(echo "$TOKEN_RESPONSE" | sed -n 's/.*"access_token"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p')
|
||||||
|
|
||||||
if [ -z "$TOKEN" ]; then
|
if [ -z "$TOKEN" ]; then
|
||||||
echo "[error] Failed to get token. Response: $TOKEN_RESPONSE"
|
echo "[error] Failed to get token. Response: $TOKEN_RESPONSE"
|
||||||
@@ -52,9 +58,13 @@ spec:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Store token in file for main container to read
|
# Store token in file for main container to read
|
||||||
mkdir -p /data
|
# Write to both locations for compatibility
|
||||||
echo "$TOKEN" > /data/llm_token.txt
|
mkdir -p /tmp/llm-token /app/data 2>/dev/null || true
|
||||||
echo "[init] Token fetched and stored successfully"
|
echo "$TOKEN" | tee /tmp/llm-token/llm_token.txt > /dev/null 2>&1
|
||||||
|
echo "$TOKEN" > /app/data/llm_token.txt 2>/dev/null || true
|
||||||
|
echo "[init] Token fetched and stored"
|
||||||
|
[ -f /tmp/llm-token/llm_token.txt ] && echo " -> /tmp/llm-token/llm_token.txt"
|
||||||
|
[ -f /app/data/llm_token.txt ] && echo " -> /app/data/llm_token.txt"
|
||||||
env:
|
env:
|
||||||
- name: LLM_AUTH_CLIENT_SECRET
|
- name: LLM_AUTH_CLIENT_SECRET
|
||||||
valueFrom:
|
valueFrom:
|
||||||
@@ -63,7 +73,7 @@ spec:
|
|||||||
key: LLM_AUTH_CLIENT_SECRET
|
key: LLM_AUTH_CLIENT_SECRET
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: paperless-ai-data
|
- name: paperless-ai-data
|
||||||
mountPath: /data
|
mountPath: /app/data
|
||||||
containers:
|
containers:
|
||||||
- name: paperless-ai
|
- name: paperless-ai
|
||||||
image: clusterzx/paperless-ai:latest
|
image: clusterzx/paperless-ai:latest
|
||||||
@@ -105,6 +115,9 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: paperless-ai-data
|
- name: paperless-ai-data
|
||||||
mountPath: /app/data
|
mountPath: /app/data
|
||||||
|
- name: paperless-ai-env-config
|
||||||
|
mountPath: /app/data/.env
|
||||||
|
subPath: paperless-ai-config.env
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: poimen-toolkit
|
||||||
|
namespace: argocd
|
||||||
|
annotations:
|
||||||
|
argocd.argoproj.io/sync-wave: "7"
|
||||||
|
argocd-image-updater.argoproj.io/image-list: |
|
||||||
|
controller=ghcr.io/riotpiao-poimen/poimen-toolkit-controller
|
||||||
|
argocd-image-updater.argoproj.io/controller.update-strategy: digest
|
||||||
|
argocd-image-updater.argoproj.io/controller.allow-tags: regexp:^latest$
|
||||||
|
argocd-image-updater.argoproj.io/write-back-method: argocd
|
||||||
|
spec:
|
||||||
|
project: homelab
|
||||||
|
source:
|
||||||
|
repoURL: https://forgejo.riotpiao.com/riotpiao-poimen/poimen-toolkit.git
|
||||||
|
targetRevision: main
|
||||||
|
path: k8s
|
||||||
|
destination:
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
namespace: poimen
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: true
|
||||||
|
selfHeal: true
|
||||||
|
syncOptions:
|
||||||
|
- CreateNamespace=true
|
||||||
|
- ServerSideApply=true
|
||||||
|
retry:
|
||||||
|
limit: 5
|
||||||
|
backoff:
|
||||||
|
duration: 5s
|
||||||
|
factor: 2
|
||||||
|
maxDuration: 3m
|
||||||
@@ -24,6 +24,7 @@ spec:
|
|||||||
- https://forgejo.riotpiao.com/riotpiao-poimen/poimen-memory.git
|
- https://forgejo.riotpiao.com/riotpiao-poimen/poimen-memory.git
|
||||||
- https://forgejo.riotpiao.com/riotpiao-poimen/poimen-workflows.git
|
- https://forgejo.riotpiao.com/riotpiao-poimen/poimen-workflows.git
|
||||||
- https://forgejo.riotpiao.com/riotpiao-poimen/poimen-frontend.git
|
- https://forgejo.riotpiao.com/riotpiao-poimen/poimen-frontend.git
|
||||||
|
- https://forgejo.riotpiao.com/riotpiao-poimen/poimen-toolkit.git
|
||||||
- https://forgejo.riotpiao.com/rock/riotpiao.com.git
|
- https://forgejo.riotpiao.com/rock/riotpiao.com.git
|
||||||
# Public Helm chart repos referenced by k8s/argocd/apps/* and bootstrap/*
|
# Public Helm chart repos referenced by k8s/argocd/apps/* and bootstrap/*
|
||||||
- https://cloudnative-pg.github.io/charts
|
- https://cloudnative-pg.github.io/charts
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ grafana.ini:
|
|||||||
auth.generic_oauth:
|
auth.generic_oauth:
|
||||||
enabled: true
|
enabled: true
|
||||||
name: Authentik
|
name: Authentik
|
||||||
allow_sign_up: true
|
allow_sign_up: true # Allow sync to create/update users from OAuth claims
|
||||||
client_id: grafana
|
client_id: grafana
|
||||||
scopes: openid email profile groups
|
scopes: openid email profile groups
|
||||||
auth_url: https://authentik.riotpiao.com/application/o/authorize/
|
auth_url: https://authentik.riotpiao.com/application/o/authorize/
|
||||||
@@ -84,13 +84,13 @@ grafana.ini:
|
|||||||
# Authentik doesn't serve — request 404s with "Error getting email address"
|
# Authentik doesn't serve — request 404s with "Error getting email address"
|
||||||
# and the whole OAuth login fails.
|
# and the whole OAuth login fails.
|
||||||
email_attribute_path: email
|
email_attribute_path: email
|
||||||
login_attribute_path: preferred_username
|
login_attribute_path: preferred_username # Use preferred_username — OpenID standard claim, always present
|
||||||
name_attribute_path: name
|
name_attribute_path: name
|
||||||
role_attribute_path: "preferred_username == 'akadmin' && 'GrafanaAdmin' || contains(groups[*], 'homelab-admins') && 'Admin' || 'Viewer'"
|
role_attribute_path: "preferred_username == 'akadmin' && 'GrafanaAdmin' || contains(groups[*], 'homelab-admins') && 'Admin' || 'Viewer'"
|
||||||
allow_assign_grafana_admin: true
|
allow_assign_grafana_admin: true
|
||||||
use_pkce: false
|
use_pkce: false
|
||||||
use_refresh_token: false
|
use_refresh_token: false
|
||||||
skip_org_role_sync: false
|
skip_org_role_sync: false # Sync org roles from OAuth groups
|
||||||
tls_skip_verify_insecure: true # Authentik uses self-signed cert; verify in prod
|
tls_skip_verify_insecure: true # Authentik uses self-signed cert; verify in prod
|
||||||
|
|
||||||
# GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET is injected from the grafana-oidc K8s
|
# GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET is injected from the grafana-oidc K8s
|
||||||
|
|||||||
@@ -112,10 +112,16 @@ spec:
|
|||||||
name: minio-oidc
|
name: minio-oidc
|
||||||
key: MINIO_IDENTITY_OPENID_CLIENT_SECRET
|
key: MINIO_IDENTITY_OPENID_CLIENT_SECRET
|
||||||
- name: MINIO_IDENTITY_OPENID_CLAIM_NAME
|
- name: MINIO_IDENTITY_OPENID_CLAIM_NAME
|
||||||
value: "policy"
|
value: "groups"
|
||||||
|
- name: MINIO_IDENTITY_OPENID_CLAIM_PREFIX
|
||||||
|
value: ""
|
||||||
- name: MINIO_IDENTITY_OPENID_REDIRECT_URI
|
- name: MINIO_IDENTITY_OPENID_REDIRECT_URI
|
||||||
value: "https://minio.riotpiao.com/oauth_callback"
|
value: "https://minio.riotpiao.com/oauth_callback"
|
||||||
- name: MINIO_IDENTITY_OPENID_DISPLAY_NAME
|
- name: MINIO_IDENTITY_OPENID_DISPLAY_NAME
|
||||||
value: "Authentik"
|
value: "Authentik"
|
||||||
- name: MINIO_IDENTITY_OPENID_SCOPES
|
- name: MINIO_IDENTITY_OPENID_SCOPES
|
||||||
value: "openid,profile,email,minio"
|
value: "openid,profile,email,groups"
|
||||||
|
- name: MINIO_BROWSER_LOGIN_ANIMATION
|
||||||
|
value: "off"
|
||||||
|
- name: MINIO_BROWSER_REDIRECT_URL
|
||||||
|
value: "https://minio.riotpiao.com"
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ alertmanager:
|
|||||||
# ── Prometheus ────────────────────────────────────────────────────────────────
|
# ── Prometheus ────────────────────────────────────────────────────────────────
|
||||||
prometheus:
|
prometheus:
|
||||||
prometheusSpec:
|
prometheusSpec:
|
||||||
retention: 15d
|
retention: 30d
|
||||||
retentionSize: "18GB"
|
retentionSize: "95GB"
|
||||||
|
|
||||||
# scrapeTimeout MUST be <= scrapeInterval or the operator refuses to generate
|
# scrapeTimeout MUST be <= scrapeInterval or the operator refuses to generate
|
||||||
# the Prometheus config ("scrapeTimeout greater than scrapeInterval") and no
|
# the Prometheus config ("scrapeTimeout greater than scrapeInterval") and no
|
||||||
@@ -64,10 +64,9 @@ prometheus:
|
|||||||
scrapeTimeout: 60s
|
scrapeTimeout: 60s
|
||||||
evaluationInterval: 30s
|
evaluationInterval: 30s
|
||||||
|
|
||||||
# Pin to az-a (talos-cp-1) — sole Longhorn node; else the RWO PVC can't
|
# Pin to worker-1 for more storage capacity
|
||||||
# attach on cp-2/cp-3 (CSINode lacks driver.longhorn.io).
|
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
topology.kubernetes.io/zone: az-a
|
kubernetes.io/hostname: worker-1
|
||||||
|
|
||||||
# Persistent storage — metrics survive node reboots and pod restarts.
|
# Persistent storage — metrics survive node reboots and pod restarts.
|
||||||
# Uses the default `longhorn` StorageClass; nodeSelector above already pins
|
# Uses the default `longhorn` StorageClass; nodeSelector above already pins
|
||||||
@@ -79,7 +78,7 @@ prometheus:
|
|||||||
accessModes: ["ReadWriteOnce"]
|
accessModes: ["ReadWriteOnce"]
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 20Gi
|
storage: 100Gi
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
|
|||||||
@@ -145,6 +145,7 @@ SERVICE_ACCOUNTS: Dict[str, Dict[str, Any]] = {
|
|||||||
SCOPE_MAPPINGS: Dict[str, Dict[str, str]] = {
|
SCOPE_MAPPINGS: Dict[str, Dict[str, str]] = {
|
||||||
"roles": {"expression": 'return user.attributes.get("roles", [])'},
|
"roles": {"expression": 'return user.attributes.get("roles", [])'},
|
||||||
"permissions": {"expression": 'return ["*"] if any(user.groups.filter(is_superuser=True)) else list(user.groups.values_list("name", flat=True))'},
|
"permissions": {"expression": 'return ["*"] if any(user.groups.filter(is_superuser=True)) else list(user.groups.values_list("name", flat=True))'},
|
||||||
|
"groups": {"expression": 'return {"groups": list(user.groups.values_list("name", flat=True))}'},
|
||||||
"minio_buckets": {"expression": 'return user.attributes.get("minio_buckets", [])'},
|
"minio_buckets": {"expression": 'return user.attributes.get("minio_buckets", [])'},
|
||||||
"paperless_doctypes": {"expression": 'return user.attributes.get("paperless_doctypes", [])'},
|
"paperless_doctypes": {"expression": 'return user.attributes.get("paperless_doctypes", [])'},
|
||||||
"memory_projects": {"expression": 'return user.attributes.get("memory_projects", [])'},
|
"memory_projects": {"expression": 'return user.attributes.get("memory_projects", [])'},
|
||||||
@@ -246,6 +247,25 @@ for scope_name, scope_spec in SCOPE_MAPPINGS.items():
|
|||||||
else:
|
else:
|
||||||
print(f" {scope_name}: FAILED {status} {res}")
|
print(f" {scope_name}: FAILED {status} {res}")
|
||||||
|
|
||||||
|
# Fix built-in 'openid' scope to include preferred_username (needed by Grafana, Forgejo, etc.)
|
||||||
|
# Note: sub MUST be a string, not int, for JSON compatibility with Go struct unmarshaling
|
||||||
|
if "openid" in existing_scopes:
|
||||||
|
openid_scope = existing_scopes["openid"]
|
||||||
|
openid_pk = openid_scope["pk"]
|
||||||
|
openid_expression = 'return {"sub": str(user.pk), "preferred_username": user.username}'
|
||||||
|
if openid_expression not in openid_scope.get("expression", ""):
|
||||||
|
status, res = api("PUT", f"/api/v3/propertymappings/provider/scope/{openid_pk}/", {
|
||||||
|
"name": openid_scope["name"],
|
||||||
|
"scope_name": "openid",
|
||||||
|
"expression": openid_expression,
|
||||||
|
})
|
||||||
|
if status in (200, 201):
|
||||||
|
print(f" openid: updated (sub as string + preferred_username)")
|
||||||
|
else:
|
||||||
|
print(f" openid: UPDATE FAILED {status} {res}")
|
||||||
|
else:
|
||||||
|
print(f" openid: already correct (sub as string)")
|
||||||
|
|
||||||
# ===========================================================================
|
# ===========================================================================
|
||||||
# Phase 4: Get flow UUIDs (needed for providers)
|
# Phase 4: Get flow UUIDs (needed for providers)
|
||||||
# ===========================================================================
|
# ===========================================================================
|
||||||
|
|||||||
@@ -38,6 +38,8 @@
|
|||||||
rewrite name api.riotpiao.com ingress-nginx-controller.ingress-nginx.svc.cluster.local
|
rewrite name api.riotpiao.com ingress-nginx-controller.ingress-nginx.svc.cluster.local
|
||||||
rewrite name comfy.riotpiao.com ingress-nginx-controller.ingress-nginx.svc.cluster.local
|
rewrite name comfy.riotpiao.com ingress-nginx-controller.ingress-nginx.svc.cluster.local
|
||||||
rewrite name comfyui.riotpiao.com ingress-nginx-controller.ingress-nginx.svc.cluster.local
|
rewrite name comfyui.riotpiao.com ingress-nginx-controller.ingress-nginx.svc.cluster.local
|
||||||
|
rewrite name gotify.riotpiao.com ingress-nginx-controller.ingress-nginx.svc.cluster.local
|
||||||
|
rewrite name igotify.riotpiao.com ingress-nginx-controller.ingress-nginx.svc.cluster.local
|
||||||
rewrite name riotpiao.com ingress-nginx-controller.ingress-nginx.svc.cluster.local
|
rewrite name riotpiao.com ingress-nginx-controller.ingress-nginx.svc.cluster.local
|
||||||
|
|
||||||
kubernetes cluster.local in-addr.arpa ip6.arpa {
|
kubernetes cluster.local in-addr.arpa ip6.arpa {
|
||||||
|
|||||||
Reference in New Issue
Block a user