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:
|
||||
oauth2_client:
|
||||
ENABLE_AUTO_REGISTRATION: true
|
||||
ACCOUNT_LINKING: auto
|
||||
oauth:
|
||||
- name: 'Keycloak'
|
||||
provider: 'openidConnect'
|
||||
existingSecret: auth-generic-oauth-secret
|
||||
autoDiscoverUrl: 'https://{{{ .Env.DOMAIN }}}/keycloak/realms/cnoe/.well-known/openid-configuration'
|
||||
---
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: forgejo-config
|
||||
namespace: gitea
|
||||
# annotations:
|
||||
# argocd.argoproj.io/hook: PostSync
|
||||
spec:
|
||||
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