Files
homelab/k8s/apps/gitea/user-unban-cronjob.yaml
T
ab 3d58baaf2f
Update Kubernetes Services Wiki / Generate and Update K8s Wiki (push) Successful in 37s
Check with kubeconform / lint (push) Failing after 12s
Auto-update README / Generate README and Create MR (push) Successful in 15s
Added tmp job for unban me in gitea
2026-06-28 11:50:56 +03:00

61 lines
1.9 KiB
YAML

---
apiVersion: batch/v1
kind: CronJob
metadata:
name: gitea-user-unban
labels:
app: gitea-user-unban
spec:
schedule: "*/10 * * * *"
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 3
jobTemplate:
spec:
template:
metadata:
labels:
app: gitea-user-unban
spec:
restartPolicy: OnFailure
nodeSelector:
kubernetes.io/hostname: master.tail2fe2d.ts.net
volumes:
- name: storage
hostPath:
path: /k8s/gitea
type: Directory
containers:
- name: sqlite-unban
image: 'gitea/gitea:latest'
imagePullPolicy: IfNotPresent
resources:
requests:
memory: "32Mi"
cpu: "10m"
limits:
memory: "128Mi"
cpu: "100m"
command:
- /bin/sh
- -ec
- |
sqlite3 -cmd ".timeout 30000" /data/gitea/gitea.db "
UPDATE \"user\"
SET is_active = 1,
prohibit_login = 0,
updated_unix = unixepoch()
WHERE lower(email) = lower('ab@hexor.cy')
AND (is_active <> 1 OR prohibit_login <> 0);
SELECT printf(
'gitea user watchdog: id=%d login=%s email=%s is_active=%d prohibit_login=%d updated_unix=%d',
id, lower_name, email, is_active, prohibit_login, updated_unix
)
FROM \"user\"
WHERE lower(email) = lower('ab@hexor.cy');
"
volumeMounts:
- name: storage
mountPath: /data