adds job to append the sso config to the values.yaml of Forgejo
This commit is contained in:
parent
2c4866f2c9
commit
85c7ea1dbb
1 changed files with 60 additions and 10 deletions
|
@ -1,10 +1,60 @@
|
||||||
gitea:
|
---
|
||||||
config:
|
apiVersion: batch/v1
|
||||||
oauth2_client:
|
kind: Job
|
||||||
ENABLE_AUTO_REGISTRATION: true
|
metadata:
|
||||||
ACCOUNT_LINKING: auto
|
name: forgejo-config
|
||||||
oauth:
|
namespace: gitea
|
||||||
- name: 'Keycloak'
|
# annotations:
|
||||||
provider: 'openidConnect'
|
# argocd.argoproj.io/hook: PostSync
|
||||||
existingSecret: auth-generic-oauth-secret
|
spec:
|
||||||
autoDiscoverUrl: 'https://{{{ .Env.DOMAIN }}}/keycloak/realms/cnoe/.well-known/openid-configuration'
|
template:
|
||||||
|
metadata:
|
||||||
|
generateName: forgejo-config-
|
||||||
|
spec:
|
||||||
|
# serviceAccountName: forgejo-config
|
||||||
|
restartPolicy: Never
|
||||||
|
containers:
|
||||||
|
- name: push
|
||||||
|
image: docker.io/library/ubuntu:22.04
|
||||||
|
command: ["/bin/bash", "-c"]
|
||||||
|
args:
|
||||||
|
- |
|
||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
apt-get install git-all
|
||||||
|
wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY} -O /usr/bin/yq && chmod +x /usr/bin/yq
|
||||||
|
|
||||||
|
DOMAIN=192-168-197-2.c-one-infra.de
|
||||||
|
|
||||||
|
git clone https://gitea-${DOMAIN}/giteaAdmin/edfbuilder.git
|
||||||
|
cd edfbuilder
|
||||||
|
yq eval ".gitea.oauth = [
|
||||||
|
{
|
||||||
|
\"name\": \"Keycloak\",
|
||||||
|
\"provider\": \"openidConnect\",
|
||||||
|
\"existingSecret\": \"auth-generic-oauth-secret\",
|
||||||
|
\"autoDiscoverUrl\": \"https://${DOMAIN}/keycloak/realms/cnoe/.well-known/openid-configuration\"
|
||||||
|
}
|
||||||
|
] |
|
||||||
|
(.gitea.oauth[] | .name) |= (. style=\"single\")
|
||||||
|
|
|
||||||
|
(.gitea.oauth[] | .provider) |= (. style=\"single\")
|
||||||
|
|
|
||||||
|
(.gitea.oauth[] | .existingSecret) |= (. style=\"single\")
|
||||||
|
|
|
||||||
|
(.gitea.oauth[] | .autoDiscoverUrl) |= (. style=\"single\")
|
||||||
|
" -i stacks/core/forgejo/values.yaml
|
||||||
|
|
||||||
|
yq eval '.gitea.config.oauth2_client =
|
||||||
|
{
|
||||||
|
"ENABLE_AUTO_REGISTRATION" : true,
|
||||||
|
"ACCOUNT_LINKING" : "auto"
|
||||||
|
}
|
||||||
|
' -i stacks/core/forgejo/values.yaml
|
||||||
|
|
||||||
|
git add stacks/core/forgejo/values.yaml
|
||||||
|
git commit -m "adds Forgejo SSO config"
|
||||||
|
git push
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in a new issue