fix
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
locals {
|
||||
app-name = var.component == var.instance ? var.instance : format("%s-%s", var.component, var.instance)
|
||||
main-group = format("app-%s", local.app-name)
|
||||
sorted-group-names = reverse(distinct(sort([
|
||||
for grp in var.user-groups: grp.name
|
||||
])))
|
||||
@@ -17,6 +19,7 @@ data "authentik_group" "vynil-admin" {
|
||||
resource "authentik_group" "groups" {
|
||||
count = length(local.sorted-groups)
|
||||
name = local.sorted-groups[count.index].name
|
||||
attributes = jsonencode({"${local.app-name}" = true})
|
||||
}
|
||||
data "authentik_group" "readed_groups" {
|
||||
depends_on = [ authentik_group.groups ]
|
||||
@@ -32,25 +35,25 @@ resource "authentik_application" "dolibarr_application_ldap" {
|
||||
}
|
||||
|
||||
resource "authentik_policy_binding" "dolibarr_ldap_access_users" {
|
||||
count = length(local.sorted-groups)
|
||||
target = authentik_application.dolibarr_application_ldap.uuid
|
||||
group = authentik_group.groups[count.index].id
|
||||
order = count.index
|
||||
policy = authentik_policy_expression.policy.id
|
||||
order = 0
|
||||
}
|
||||
resource "authentik_policy_binding" "dolibarr_ldap_access_ldap" {
|
||||
target = authentik_application.dolibarr_application_ldap.uuid
|
||||
group = authentik_group.dolibarr_ldapsearch.id
|
||||
order = length(local.sorted-groups)+1
|
||||
order = 1
|
||||
}
|
||||
resource "authentik_policy_binding" "dolibarr_ldap_access_vynil" {
|
||||
target = authentik_application.dolibarr_application_ldap.uuid
|
||||
group = data.authentik_group.vynil-admin.id
|
||||
order = length(local.sorted-groups)+2
|
||||
order = 2
|
||||
}
|
||||
|
||||
resource "authentik_application" "dolibarr_application_saml" {
|
||||
name = "${var.instance}"
|
||||
slug = "${var.component}-${var.instance}"
|
||||
group = var.app-group
|
||||
protocol_provider = authentik_provider_saml.dolibarr.id
|
||||
meta_launch_url = format("https://%s.%s", var.sub-domain, var.domain-name)
|
||||
meta_icon = format("https://%s.%s/%s", var.sub-domain, var.domain-name, "theme/dolibarr_256x256_color.png")
|
||||
|
||||
@@ -6,33 +6,6 @@ metadata:
|
||||
name: dolibarr
|
||||
description: null
|
||||
options:
|
||||
storage:
|
||||
default:
|
||||
accessMode: ReadWriteOnce
|
||||
size: 10Gi
|
||||
type: Filesystem
|
||||
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
|
||||
parameters:
|
||||
default:
|
||||
MAIN_LANG_DEFAULT: auto
|
||||
@@ -43,89 +16,10 @@ options:
|
||||
default: auto
|
||||
type: string
|
||||
type: object
|
||||
domain-name:
|
||||
default: your_company.com
|
||||
app-group:
|
||||
default: ''
|
||||
examples:
|
||||
- your_company.com
|
||||
type: string
|
||||
user-groups:
|
||||
default:
|
||||
- admin: true
|
||||
name: dolibarr-admin
|
||||
examples:
|
||||
- - admin: true
|
||||
name: dolibarr-admin
|
||||
items:
|
||||
properties:
|
||||
admin:
|
||||
type: boolean
|
||||
name:
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
modules:
|
||||
default:
|
||||
- societe
|
||||
examples:
|
||||
- - societe
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
issuer:
|
||||
default: letsencrypt-prod
|
||||
examples:
|
||||
- letsencrypt-prod
|
||||
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
|
||||
ingress-class:
|
||||
default: traefik
|
||||
examples:
|
||||
- traefik
|
||||
- ''
|
||||
type: string
|
||||
backups:
|
||||
default:
|
||||
@@ -233,6 +127,36 @@ 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:
|
||||
@@ -271,25 +195,46 @@ options:
|
||||
default: 2Gi
|
||||
type: string
|
||||
type: object
|
||||
hpa:
|
||||
resources:
|
||||
default:
|
||||
avg-cpu: 50
|
||||
max-replicas: 5
|
||||
min-replicas: 1
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 256Mi
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 100Mi
|
||||
examples:
|
||||
- avg-cpu: 50
|
||||
max-replicas: 5
|
||||
min-replicas: 1
|
||||
- limits:
|
||||
cpu: 200m
|
||||
memory: 256Mi
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 100Mi
|
||||
properties:
|
||||
avg-cpu:
|
||||
default: 50
|
||||
type: integer
|
||||
max-replicas:
|
||||
default: 5
|
||||
type: integer
|
||||
min-replicas:
|
||||
default: 1
|
||||
type: integer
|
||||
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:
|
||||
@@ -311,6 +256,46 @@ options:
|
||||
default: '14'
|
||||
type: string
|
||||
type: object
|
||||
modules:
|
||||
default:
|
||||
- societe
|
||||
examples:
|
||||
- - societe
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
storage:
|
||||
default:
|
||||
accessMode: ReadWriteOnce
|
||||
size: 10Gi
|
||||
type: Filesystem
|
||||
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
|
||||
examples:
|
||||
- your-company
|
||||
type: string
|
||||
images:
|
||||
default:
|
||||
dolibarr:
|
||||
@@ -376,11 +361,31 @@ options:
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
domain:
|
||||
default: your-company
|
||||
issuer:
|
||||
default: letsencrypt-prod
|
||||
examples:
|
||||
- your-company
|
||||
- letsencrypt-prod
|
||||
type: string
|
||||
ingress-class:
|
||||
default: traefik
|
||||
examples:
|
||||
- traefik
|
||||
type: string
|
||||
user-groups:
|
||||
default:
|
||||
- admin: true
|
||||
name: dolibarr-admin
|
||||
examples:
|
||||
- - admin: true
|
||||
name: dolibarr-admin
|
||||
items:
|
||||
properties:
|
||||
admin:
|
||||
type: boolean
|
||||
name:
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
dependencies:
|
||||
- dist: null
|
||||
category: share
|
||||
|
||||
Reference in New Issue
Block a user