From a241bb588b406985d9083d6bdf3a45d8e912da17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Huss?= Date: Mon, 23 Oct 2023 17:52:24 +0200 Subject: [PATCH] fix --- share/dataset-pg/directus.tf | 19 ++++++++- share/dataset-pg/index.yaml | 77 +++++++++++++++++++----------------- 2 files changed, 58 insertions(+), 38 deletions(-) diff --git a/share/dataset-pg/directus.tf b/share/dataset-pg/directus.tf index 87675bf..6db1645 100644 --- a/share/dataset-pg/directus.tf +++ b/share/dataset-pg/directus.tf @@ -2,6 +2,7 @@ locals { directus-labels = merge(local.common-labels, { "app.kubernetes.io/component" = "directus" }) + directus-icon = "apps/theming/favicon" directus-dns-name = "directus.${local.dns-name}" directus-service = { "name" = "directus-${var.instance}" @@ -46,7 +47,7 @@ resource "kubectl_manifest" "directus_config" { TELEMETRY: "false" AUTH_PROVIDERS: "vynil" AUTH_VYNIL_DRIVER: "oauth2" - AUTH_VYNIL_ISSUER_URL: "https://${data.kubernetes_ingress_v1.authentik.spec[0].rule[0].host}/application/o/directus-${var.instance}/.well-known/openid-configuration" + AUTH_VYNIL_ISSUER_URL: "https://${data.kubernetes_ingress_v1.authentik.spec[0].rule[0].host}/application/o/${replace(var.sub-domain, ".", "-")}-${var.instance}/.well-known/openid-configuration" AUTH_VYNIL_IDENTIFIER_KEY: "nickname" PUBLIC_URL: "https://${local.directus-dns-name}" EOF @@ -215,10 +216,24 @@ module "directus-ingress" { } } +module "directus-application" { + count = var.extentions.directus.enable ? 1 : 0 + source = "/dist/modules/application" + component = replace(var.sub-domain, ".", "-") + instance = var.instance + app-group = var.app-group + dns-name = local.directus-dns-name + icon = local.directus-icon + protocol_provider = module.directus-oauth2.provider-id + providers = { + authentik = authentik + } +} + module "directus-oauth2" { count = var.extentions.directus.enable ? 1 : 0 source = "/dist/modules/oauth2" - component = "directus" + component = replace(var.sub-domain, ".", "-") instance = var.instance namespace = var.namespace labels = local.directus-labels diff --git a/share/dataset-pg/index.yaml b/share/dataset-pg/index.yaml index 8a1d529..61005aa 100644 --- a/share/dataset-pg/index.yaml +++ b/share/dataset-pg/index.yaml @@ -6,21 +6,54 @@ metadata: name: dataset-pg description: null options: - sub-domain: - default: dataset-pg - examples: - - dataset-pg - type: string storage: default: 8Gi examples: - 8Gi type: string + domain: + default: your-company + examples: + - your-company + type: string + domain-name: + default: your_company.com + examples: + - your_company.com + type: string + databases: + default: [] + items: + properties: + name: + default: db + type: string + type: object + type: array + roles: + default: [] + items: + properties: + name: + default: alt-account + type: string + type: object + type: array + replicas: + default: 1 + examples: + - 1 + type: integer issuer: default: letsencrypt-prod examples: - letsencrypt-prod type: string + sub-domain: + default: dataset-pg + examples: + - dataset-pg + type: string extentions: default: directus: @@ -202,29 +235,10 @@ options: type: object type: object type: object - replicas: - default: 1 + app-group: + default: api examples: - - 1 - type: integer - databases: - default: [] - items: - properties: - name: - default: db - type: string - type: object - type: array - domain-name: - default: your_company.com - examples: - - your_company.com - type: string - domain: - default: your-company - examples: - - your-company + - api type: string backups: default: @@ -280,15 +294,6 @@ options: default: backup-settings type: string type: object - roles: - default: [] - items: - properties: - name: - default: alt-account - type: string - type: object - type: array ingress-class: default: traefik examples: