From a374fe5e66c778adbc7004939280d8d9f6c27f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Huss?= Date: Thu, 21 Sep 2023 13:49:35 +0200 Subject: [PATCH] fix --- apps/dolibarr/application.tf | 8 + apps/dolibarr/index.yaml | 356 +++++++++++++++++------------------ 2 files changed, 186 insertions(+), 178 deletions(-) diff --git a/apps/dolibarr/application.tf b/apps/dolibarr/application.tf index 129b3b1..9954b62 100644 --- a/apps/dolibarr/application.tf +++ b/apps/dolibarr/application.tf @@ -34,6 +34,14 @@ resource "authentik_application" "dolibarr_application_ldap" { meta_launch_url = "blank://blank" } +resource "authentik_policy_expression" "policy" { + name = local.main-group + expression = <<-EOF + attr = request.user.group_attributes() + return attr['${local.app-name}'] if '${local.app-name}' in attr else False + EOF +} + resource "authentik_policy_binding" "dolibarr_ldap_access_users" { target = authentik_application.dolibarr_application_ldap.uuid policy = authentik_policy_expression.policy.id diff --git a/apps/dolibarr/index.yaml b/apps/dolibarr/index.yaml index d7178b4..ac8a179 100644 --- a/apps/dolibarr/index.yaml +++ b/apps/dolibarr/index.yaml @@ -6,14 +6,24 @@ metadata: name: dolibarr description: null options: - parameters: + postgres: default: - MAIN_LANG_DEFAULT: auto + replicas: 1 + storage: 5Gi + version: '14' examples: - - MAIN_LANG_DEFAULT: auto + - replicas: 1 + storage: 5Gi + version: '14' properties: - MAIN_LANG_DEFAULT: - default: auto + replicas: + default: 1 + type: integer + storage: + default: 5Gi + type: string + version: + default: '14' type: string type: object app-group: @@ -21,6 +31,115 @@ options: examples: - '' type: string + domain-name: + default: your_company.com + examples: + - your_company.com + type: string + sub-domain: + default: erp + examples: + - erp + type: string + resources: + default: + limits: + cpu: 200m + memory: 256Mi + requests: + cpu: 50m + memory: 100Mi + examples: + - limits: + cpu: 200m + memory: 256Mi + requests: + cpu: 50m + memory: 100Mi + properties: + limits: + default: + cpu: 200m + memory: 256Mi + properties: + cpu: + default: 200m + type: string + memory: + default: 256Mi + type: string + type: object + requests: + default: + cpu: 50m + memory: 100Mi + properties: + cpu: + default: 50m + type: string + memory: + default: 100Mi + type: string + type: object + type: object + log-level: + default: 5 + examples: + - 5 + type: integer + redis: + default: + exporter: + enabled: true + image: quay.io/opstree/redis-exporter:v1.44.0 + image: quay.io/opstree/redis:v7.0.5 + storage: 2Gi + examples: + - exporter: + enabled: true + image: quay.io/opstree/redis-exporter:v1.44.0 + image: quay.io/opstree/redis:v7.0.5 + storage: 2Gi + properties: + exporter: + default: + enabled: true + image: quay.io/opstree/redis-exporter:v1.44.0 + properties: + enabled: + default: true + type: boolean + image: + default: quay.io/opstree/redis-exporter:v1.44.0 + type: string + type: object + image: + default: quay.io/opstree/redis:v7.0.5 + type: string + storage: + default: 2Gi + type: string + type: object + hpa: + default: + avg-cpu: 50 + max-replicas: 5 + min-replicas: 1 + examples: + - avg-cpu: 50 + max-replicas: 5 + min-replicas: 1 + properties: + avg-cpu: + default: 50 + type: integer + max-replicas: + default: 5 + type: integer + min-replicas: + default: 1 + type: integer + type: object backups: default: enable: false @@ -127,135 +246,6 @@ options: default: false type: boolean type: object - sub-domain: - default: erp - examples: - - erp - type: string - domain-name: - default: your_company.com - examples: - - your_company.com - type: string - hpa: - default: - avg-cpu: 50 - max-replicas: 5 - min-replicas: 1 - examples: - - avg-cpu: 50 - max-replicas: 5 - min-replicas: 1 - properties: - avg-cpu: - default: 50 - type: integer - max-replicas: - default: 5 - type: integer - min-replicas: - default: 1 - type: integer - type: object - log-level: - default: 5 - examples: - - 5 - type: integer - redis: - default: - exporter: - enabled: true - image: quay.io/opstree/redis-exporter:v1.44.0 - image: quay.io/opstree/redis:v7.0.5 - storage: 2Gi - examples: - - exporter: - enabled: true - image: quay.io/opstree/redis-exporter:v1.44.0 - image: quay.io/opstree/redis:v7.0.5 - storage: 2Gi - properties: - exporter: - default: - enabled: true - image: quay.io/opstree/redis-exporter:v1.44.0 - properties: - enabled: - default: true - type: boolean - image: - default: quay.io/opstree/redis-exporter:v1.44.0 - type: string - type: object - image: - default: quay.io/opstree/redis:v7.0.5 - type: string - storage: - default: 2Gi - type: string - type: object - resources: - default: - limits: - cpu: 200m - memory: 256Mi - requests: - cpu: 50m - memory: 100Mi - examples: - - limits: - cpu: 200m - memory: 256Mi - requests: - cpu: 50m - memory: 100Mi - properties: - limits: - default: - cpu: 200m - memory: 256Mi - properties: - cpu: - default: 200m - type: string - memory: - default: 256Mi - type: string - type: object - requests: - default: - cpu: 50m - memory: 100Mi - properties: - cpu: - default: 50m - type: string - memory: - default: 100Mi - type: string - type: object - type: object - postgres: - default: - replicas: 1 - storage: 5Gi - version: '14' - examples: - - replicas: 1 - storage: 5Gi - version: '14' - properties: - replicas: - default: 1 - type: integer - storage: - default: 5Gi - type: string - version: - default: '14' - type: string - type: object modules: default: - societe @@ -264,37 +254,25 @@ options: items: type: string type: array - storage: + user-groups: default: - accessMode: ReadWriteOnce - size: 10Gi - type: Filesystem + - admin: true + name: dolibarr-admin examples: - - accessMode: ReadWriteOnce - size: 10Gi - type: Filesystem - properties: - accessMode: - default: ReadWriteOnce - enum: - - ReadWriteOnce - - ReadOnlyMany - - ReadWriteMany - type: string - size: - default: 10Gi - type: string - type: - default: Filesystem - enum: - - Filesystem - - block - type: string - type: object - domain: - default: your-company + - - admin: true + name: dolibarr-admin + items: + properties: + admin: + type: boolean + name: + type: string + type: object + type: array + issuer: + default: letsencrypt-prod examples: - - your-company + - letsencrypt-prod type: string images: default: @@ -361,31 +339,53 @@ options: type: string type: object type: object - issuer: - default: letsencrypt-prod + domain: + default: your-company examples: - - letsencrypt-prod + - your-company type: string ingress-class: default: traefik examples: - traefik type: string - user-groups: + storage: default: - - admin: true - name: dolibarr-admin + accessMode: ReadWriteOnce + size: 10Gi + type: Filesystem examples: - - - admin: true - name: dolibarr-admin - items: - properties: - admin: - type: boolean - name: - type: string - type: object - type: array + - accessMode: ReadWriteOnce + size: 10Gi + type: Filesystem + properties: + accessMode: + default: ReadWriteOnce + enum: + - ReadWriteOnce + - ReadOnlyMany + - ReadWriteMany + type: string + size: + default: 10Gi + type: string + type: + default: Filesystem + enum: + - Filesystem + - block + type: string + type: object + parameters: + default: + MAIN_LANG_DEFAULT: auto + examples: + - MAIN_LANG_DEFAULT: auto + properties: + MAIN_LANG_DEFAULT: + default: auto + type: string + type: object dependencies: - dist: null category: share