fix: simplify token generation

This commit is contained in:
ange 2024-06-05 12:36:44 +02:00
parent 35c78dd847
commit caf66eefc2
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D

View File

@ -60,10 +60,11 @@ kcreatesec gitea-admin \
--from-literal=username="$GITEA_USERNAME" \
--from-literal=password="$GITEA_PASSWORD"
kubectl run --image "$IMAGEAPP" secrets sleep 60 & &> /dev/null
kcreatesec gitea \
--from-literal=secret_key="$(kgseckey gitea secret_key || kubectl run -i --rm --image "$IMAGEAPP" "$RANDOM" gitea generate secret SECRET_KEY)" \
--from-literal=internal_token="$(kgseckey gitea internal_token || kubectl run -i --rm --image "$IMAGEAPP" "$RANDOM" gitea generate secret INTERNAL_TOKEN)" \
--from-literal=oauth2_jwt_secret="$(kgseckey gitea oauth2_jwt_secret || kubectl run -i --rm --image "$IMAGEAPP" "$RANDOM" gitea generate secret JWT_SECRET)"
--from-literal=secret_key="$(kgseckey gitea secret_key || kubectl exec secrets gitea generate secret SECRET_KEY)" \
--from-literal=internal_token="$(kgseckey gitea internal_token || kubectl exec secrets gitea generate secret INTERNAL_TOKEN)" \
--from-literal=oauth2_jwt_secret="$(kgseckey gitea oauth2_jwt_secret || kubectl exec secrets gitea generate secret JWT_SECRET)"
kcreatecm gitea \
--from-file=app.ini=<(envsubst "$(env | xargs printf '$%s ')" < config/app.ini)