From ff690d420a5067bfe5b91d01a7f47a77530bf9ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Huss?= Date: Sun, 29 Oct 2023 09:07:40 +0100 Subject: [PATCH] fix --- apps/woodpecker/datas.tf | 2 + apps/woodpecker/index.yaml | 80 +++++++++++++++++------------- apps/woodpecker/presentation.tf | 13 +++++ modules/application/application.tf | 1 + modules/application/variables.tf | 6 +++ 5 files changed, 67 insertions(+), 35 deletions(-) diff --git a/apps/woodpecker/datas.tf b/apps/woodpecker/datas.tf index 1f2b507..906a222 100644 --- a/apps/woodpecker/datas.tf +++ b/apps/woodpecker/datas.tf @@ -138,6 +138,8 @@ data "kustomization_overlay" "data" { image: "${var.images.server.registry}/${var.images.server.repository}:${var.images.server.tag}" imagePullPolicy: "${var.images.server.pullPolicy}" env: + - name: WOODPECKER_ADMIN + value: "${var.admin-users}" - name: WOODPECKER_HOST value: "https://${var.sub-domain}.${var.domain-name}" - name: WOODPECKER_HOST diff --git a/apps/woodpecker/index.yaml b/apps/woodpecker/index.yaml index ede48be..95f283b 100644 --- a/apps/woodpecker/index.yaml +++ b/apps/woodpecker/index.yaml @@ -6,15 +6,15 @@ metadata: name: woodpecker description: null options: - domain-name: - default: your_company.com + issuer: + default: letsencrypt-prod examples: - - your_company.com + - letsencrypt-prod type: string - domain: - default: your-company + sub-domain: + default: ci examples: - - your-company + - ci type: string storage-agent: default: @@ -36,6 +36,31 @@ options: default: 'false' type: string type: object + app-group: + default: dev + examples: + - dev + type: string + admin-users: + default: woodpecker,admin + examples: + - woodpecker,admin + type: string + domain: + default: your-company + examples: + - your-company + type: string + ingress-class: + default: traefik + examples: + - traefik + type: string + domain-name: + default: your_company.com + examples: + - your_company.com + type: string storage-server: default: accessMode: ReadWriteOnce @@ -55,11 +80,21 @@ options: default: 10Gi type: string type: object - issuer: - default: letsencrypt-prod + timeouts: + default: + default: '60' + max: '120' examples: - - letsencrypt-prod - type: string + - default: '60' + max: '120' + properties: + default: + default: '60' + type: string + max: + default: '120' + type: string + type: object images: default: agent: @@ -157,31 +192,6 @@ options: type: string type: object type: object - sub-domain: - default: ci - examples: - - ci - type: string - timeouts: - default: - default: '60' - max: '120' - examples: - - default: '60' - max: '120' - properties: - default: - default: '60' - type: string - max: - default: '120' - type: string - type: object - ingress-class: - default: traefik - examples: - - traefik - type: string dependencies: - dist: null category: apps diff --git a/apps/woodpecker/presentation.tf b/apps/woodpecker/presentation.tf index 1c42688..4c92ef4 100644 --- a/apps/woodpecker/presentation.tf +++ b/apps/woodpecker/presentation.tf @@ -1,6 +1,7 @@ locals { dns-name = "${var.sub-domain}.${var.domain-name}" dns-names = [local.dns-name] + icon = "/favicons/favicon-light-default.svg" service = { "name" = "${var.component}-server" "port" = { @@ -24,3 +25,15 @@ module "ingress" { kubectl = kubectl } } + +module "application" { + source = "/dist/modules/application" + component = var.component + instance = var.instance + app-group = var.app-group + dns-name = local.dns-name + icon = local.icon + providers = { + authentik = authentik + } +} diff --git a/modules/application/application.tf b/modules/application/application.tf index 0ee8eff..3b5ce43 100644 --- a/modules/application/application.tf +++ b/modules/application/application.tf @@ -21,6 +21,7 @@ resource "authentik_application" "prj_app" { slug = "${var.component}-${var.instance}" group = var.app-group protocol_provider = var.protocol_provider + backchannel_providers = var.backchannel_providers meta_launch_url = format("https://%s", var.dns-name) meta_icon = format("https://%s/%s", var.dns-name, var.icon) } diff --git a/modules/application/variables.tf b/modules/application/variables.tf index 6bbaa25..af23281 100644 --- a/modules/application/variables.tf +++ b/modules/application/variables.tf @@ -12,6 +12,7 @@ variable "app-group" { } variable "protocol_provider" { type = number + default = null } variable "dns-name" { type = string @@ -20,3 +21,8 @@ variable "sub-groups" { type = list(string) default = [] } + +variable "backchannel_providers" { + type = list(number) + default = null +}