Files
Homelabv4/infrastructure/authentik/gitlab-blueprint.yaml
T
Scooby HuskyandClaude Sonnet 5 5670a941d4 Deploy real GitLab on the VPS (not just Gitea)
User wants actual GitLab on the VPS, not just Gitea's pull-mirror -
deliberate scope increase from the original plan's 'keep the VPS
lighter' design for git hosting specifically.

Simplified single-node equivalent of apps/gitlab (home) - same chart
version (7.7.0), same Authentik OIDC provider/client_id (added a second
redirect_uri to the shared GitLab provider in infrastructure/authentik/
gitlab-blueprint.yaml), same known chart bugs already diagnosed at home
(redis-init-fix.yaml for the initializer-ordering bug) - but:
  - 1 CNPG instance (local-path) instead of home's 3-instance HA
  - No Praefect - pointless HA routing with a single Gitaly node
  - No PgBouncer - direct CNPG connection, traffic is low enough
  - No SAML, no Container Registry, no KAS - addable later if needed
  - Own Traefik Ingress + https-redirect Middleware from the start
    (found needed the hard way on Vault/Gitea/n8n/Nextcloud/Authentik
    earlier this session - applying that lesson here immediately)

New Vault paths this needed: secret/vps/gitlab-redis (freshly generated,
this Redis instance is new, nothing to reuse) and widened the
vps-eso-reader policy to also allow secret/gitlab-oauth (the shared
Authentik client, already used by home's GitLab).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-20 21:04:48 -05:00

83 lines
3.5 KiB
YAML

---
# Was a plain ConfigMap with client_secret hardcoded in plaintext - found
# and fixed 2026-08-20 (user: "make the repo proper and not have
# sensitive things in the files"). Unlike argocd/n8n/etc, Vault had NO
# copy of this at all before this fix - the ONLY place it existed was
# here and in gitlab-oidc-secret (a manually kubectl-created Secret in
# the gitlab namespace, apps/gitlab/values.yaml:166 - also fixed
# alongside this). Created secret/gitlab-oauth in Vault with the existing
# live value (not rotated - this is GitLab's actual working OIDC
# credential right now, changing it would break login until both sides
# are updated in lockstep).
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: authentik-blueprints-gitlab
namespace: authentik
spec:
refreshInterval: 1h
secretStoreRef:
kind: ClusterSecretStore
name: vault-backend
target:
name: authentik-blueprints-gitlab
creationPolicy: Owner
template:
metadata:
labels:
goauthentik.io/blueprint: "true"
data:
gitlab.yaml: |-
# yaml-language-server: $schema=https://goauthentik.io/blueprints/schema.json
version: 1
metadata:
name: gitlab-oidc
entries:
# OAuth2/OIDC Provider for GitLab
- model: authentik_providers_oauth2.oauth2provider
id: gitlab-provider
state: present
identifiers:
name: GitLab
attrs:
name: GitLab
client_id: 70b9da5c8166cea0ba504a869824020bce6636
client_secret: "{{ .clientSecret }}"
authorization_flow: !Find [authentik_flows.flow, [slug, default-provider-authorization-implicit-consent]]
authentication_flow: !Find [authentik_flows.flow, [slug, default-authentication-flow]]
invalidation_flow: !Find [authentik_flows.flow, [slug, default-provider-invalidation-flow]]
redirect_uris:
- url: "https://gitlab.kube.huskypup.net/users/auth/openid_connect/callback"
matching_mode: strict
# Real GitLab on the VPS (infrastructure/vps-standby/gitlab/) -
# shares this same provider/client_id, added 2026-08-21.
- url: "https://gitlab.vps.huskypup.net/users/auth/openid_connect/callback"
matching_mode: strict
enabled: true
property_mappings:
- !Find [authentik_providers_oauth2.scopemapping, [scope_name, openid]]
- !Find [authentik_providers_oauth2.scopemapping, [scope_name, email]]
- !Find [authentik_providers_oauth2.scopemapping, [scope_name, profile]]
client_type: confidential
access_code_validity: "minutes=10"
access_token_validity: "days=7"
refresh_token_validity: "days=30"
signing_key: !Find [authentik_crypto.certificatekeypair, [name, default]]
# Application for GitLab
- model: authentik_core.application
id: gitlab-application
state: present
identifiers:
slug: gitlab
attrs:
name: GitLab
slug: gitlab
policy_engine_mode: any
provider: !KeyOf gitlab-provider
data:
- secretKey: clientSecret
remoteRef:
key: gitlab-oauth
property: client-secret