fix
This commit is contained in:
@@ -8,7 +8,7 @@ locals {
|
|||||||
forward-outpost-pk = jsondecode(data.http.get_forward_outpost.response_body).results[0].pk
|
forward-outpost-pk = jsondecode(data.http.get_forward_outpost.response_body).results[0].pk
|
||||||
app-name = var.component == var.instance ? var.instance : format("%s-%s", var.component, var.instance)
|
app-name = var.component == var.instance ? var.instance : format("%s-%s", var.component, var.instance)
|
||||||
app-icon = "_static/src/browser/media/favicon-dark-support.svg"
|
app-icon = "_static/src/browser/media/favicon-dark-support.svg"
|
||||||
main-group = format("%s-users", local.app-name)
|
main-group = format("app-%s", local.app-name)
|
||||||
sub-groups = []
|
sub-groups = []
|
||||||
external-url = format("https://%s", local.dns-names[0])
|
external-url = format("https://%s", local.dns-names[0])
|
||||||
access-token-validity = "hours=10" // ;minutes=10
|
access-token-validity = "hours=10" // ;minutes=10
|
||||||
@@ -68,6 +68,7 @@ resource "authentik_application" "prj_application" {
|
|||||||
|
|
||||||
resource "authentik_group" "prj_users" {
|
resource "authentik_group" "prj_users" {
|
||||||
name = local.main-group
|
name = local.main-group
|
||||||
|
attributes = jsonencode({local.app-name = true})
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "authentik_group" "subgroup" {
|
resource "authentik_group" "subgroup" {
|
||||||
@@ -76,6 +77,14 @@ resource "authentik_group" "subgroup" {
|
|||||||
parent = authentik_group.prj_users.id
|
parent = authentik_group.prj_users.id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
data "authentik_group" "vynil-admin" {
|
data "authentik_group" "vynil-admin" {
|
||||||
depends_on = [authentik_group.prj_users] # fake dependency so it is not evaluated at plan stage
|
depends_on = [authentik_group.prj_users] # fake dependency so it is not evaluated at plan stage
|
||||||
name = "vynil-forward-admins"
|
name = "vynil-forward-admins"
|
||||||
@@ -83,7 +92,7 @@ data "authentik_group" "vynil-admin" {
|
|||||||
|
|
||||||
resource "authentik_policy_binding" "prj_access_users" {
|
resource "authentik_policy_binding" "prj_access_users" {
|
||||||
target = authentik_application.prj_application.uuid
|
target = authentik_application.prj_application.uuid
|
||||||
group = authentik_group.prj_users.id
|
policy = authentik_policy_expression.policy.id
|
||||||
order = 0
|
order = 0
|
||||||
}
|
}
|
||||||
resource "authentik_policy_binding" "prj_access_vynil" {
|
resource "authentik_policy_binding" "prj_access_vynil" {
|
||||||
|
|||||||
@@ -6,21 +6,11 @@ metadata:
|
|||||||
name: code-server
|
name: code-server
|
||||||
description: null
|
description: null
|
||||||
options:
|
options:
|
||||||
ingress-class:
|
no-editor:
|
||||||
default: traefik
|
default: false
|
||||||
examples:
|
examples:
|
||||||
- traefik
|
- false
|
||||||
type: string
|
type: boolean
|
||||||
domain-name:
|
|
||||||
default: your_company.com
|
|
||||||
examples:
|
|
||||||
- your_company.com
|
|
||||||
type: string
|
|
||||||
timezone:
|
|
||||||
default: Europe/Paris
|
|
||||||
examples:
|
|
||||||
- Europe/Paris
|
|
||||||
type: string
|
|
||||||
storage:
|
storage:
|
||||||
default:
|
default:
|
||||||
accessMode: ReadWriteOnce
|
accessMode: ReadWriteOnce
|
||||||
@@ -45,9 +35,19 @@ options:
|
|||||||
default: Filesystem
|
default: Filesystem
|
||||||
enum:
|
enum:
|
||||||
- Filesystem
|
- Filesystem
|
||||||
- block
|
- Block
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
|
timezone:
|
||||||
|
default: Europe/Paris
|
||||||
|
examples:
|
||||||
|
- Europe/Paris
|
||||||
|
type: string
|
||||||
|
ingress-class:
|
||||||
|
default: traefik
|
||||||
|
examples:
|
||||||
|
- traefik
|
||||||
|
type: string
|
||||||
domain:
|
domain:
|
||||||
default: your-company
|
default: your-company
|
||||||
examples:
|
examples:
|
||||||
@@ -107,25 +107,28 @@ options:
|
|||||||
type: number
|
type: number
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
no-editor:
|
domain-name:
|
||||||
default: false
|
default: your_company.com
|
||||||
examples:
|
examples:
|
||||||
- false
|
- your_company.com
|
||||||
type: boolean
|
|
||||||
issuer:
|
|
||||||
default: letsencrypt-prod
|
|
||||||
examples:
|
|
||||||
- letsencrypt-prod
|
|
||||||
type: string
|
type: string
|
||||||
sub-domain:
|
sub-domain:
|
||||||
default: code
|
default: code
|
||||||
examples:
|
examples:
|
||||||
- code
|
- code
|
||||||
type: string
|
type: string
|
||||||
|
issuer:
|
||||||
|
default: letsencrypt-prod
|
||||||
|
examples:
|
||||||
|
- letsencrypt-prod
|
||||||
|
type: string
|
||||||
dependencies:
|
dependencies:
|
||||||
- dist: null
|
- dist: null
|
||||||
category: share
|
category: share
|
||||||
component: authentik-forward
|
component: authentik-forward
|
||||||
|
- dist: null
|
||||||
|
category: core
|
||||||
|
component: secret-generator
|
||||||
providers:
|
providers:
|
||||||
kubernetes: true
|
kubernetes: true
|
||||||
authentik: true
|
authentik: true
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ locals {
|
|||||||
forward-outpost-pk = jsondecode(data.http.get_forward_outpost.response_body).results[0].pk
|
forward-outpost-pk = jsondecode(data.http.get_forward_outpost.response_body).results[0].pk
|
||||||
app-name = var.component == var.instance ? var.instance : format("%s-%s", var.component, var.instance)
|
app-name = var.component == var.instance ? var.instance : format("%s-%s", var.component, var.instance)
|
||||||
app-icon = "dashboard/statics/icons/favicon-96x96.png"
|
app-icon = "dashboard/statics/icons/favicon-96x96.png"
|
||||||
main-group = format("%s-users", local.app-name)
|
main-group = format("app-%s", local.app-name)
|
||||||
sub-groups = []
|
sub-groups = []
|
||||||
access-token-validity = "minutes=10"
|
access-token-validity = "minutes=10"
|
||||||
rules-icons = [ for v in local.dns-names : {
|
rules-icons = [ for v in local.dns-names : {
|
||||||
@@ -67,6 +67,7 @@ resource "authentik_application" "prj_application" {
|
|||||||
|
|
||||||
resource "authentik_group" "prj_users" {
|
resource "authentik_group" "prj_users" {
|
||||||
name = local.main-group
|
name = local.main-group
|
||||||
|
attributes = jsonencode({local.app-name = true})
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "authentik_group" "subgroup" {
|
resource "authentik_group" "subgroup" {
|
||||||
@@ -75,6 +76,14 @@ resource "authentik_group" "subgroup" {
|
|||||||
parent = authentik_group.prj_users.id
|
parent = authentik_group.prj_users.id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
data "authentik_group" "vynil-admin" {
|
data "authentik_group" "vynil-admin" {
|
||||||
depends_on = [authentik_group.prj_users] # fake dependency so it is not evaluated at plan stage
|
depends_on = [authentik_group.prj_users] # fake dependency so it is not evaluated at plan stage
|
||||||
name = "vynil-forward-admins"
|
name = "vynil-forward-admins"
|
||||||
@@ -82,7 +91,7 @@ data "authentik_group" "vynil-admin" {
|
|||||||
|
|
||||||
resource "authentik_policy_binding" "prj_access_users" {
|
resource "authentik_policy_binding" "prj_access_users" {
|
||||||
target = authentik_application.prj_application.uuid
|
target = authentik_application.prj_application.uuid
|
||||||
group = authentik_group.prj_users.id
|
policy = authentik_policy_expression.policy.id
|
||||||
order = 0
|
order = 0
|
||||||
}
|
}
|
||||||
resource "authentik_policy_binding" "prj_access_vynil" {
|
resource "authentik_policy_binding" "prj_access_vynil" {
|
||||||
|
|||||||
@@ -6,31 +6,31 @@ metadata:
|
|||||||
name: traefik-ui
|
name: traefik-ui
|
||||||
description: Access to the Traefik UI
|
description: Access to the Traefik UI
|
||||||
options:
|
options:
|
||||||
ingress-class:
|
issuer:
|
||||||
default: traefik
|
default: letsencrypt-prod
|
||||||
examples:
|
examples:
|
||||||
- traefik
|
- letsencrypt-prod
|
||||||
type: string
|
|
||||||
sub-domain:
|
|
||||||
default: traefik
|
|
||||||
examples:
|
|
||||||
- traefik
|
|
||||||
type: string
|
type: string
|
||||||
domain-name:
|
domain-name:
|
||||||
default: your_company.com
|
default: your_company.com
|
||||||
examples:
|
examples:
|
||||||
- your_company.com
|
- your_company.com
|
||||||
type: string
|
type: string
|
||||||
issuer:
|
ingress-class:
|
||||||
default: letsencrypt-prod
|
default: traefik
|
||||||
examples:
|
examples:
|
||||||
- letsencrypt-prod
|
- traefik
|
||||||
type: string
|
type: string
|
||||||
domain:
|
domain:
|
||||||
default: your-company
|
default: your-company
|
||||||
examples:
|
examples:
|
||||||
- your-company
|
- your-company
|
||||||
type: string
|
type: string
|
||||||
|
sub-domain:
|
||||||
|
default: traefik
|
||||||
|
examples:
|
||||||
|
- traefik
|
||||||
|
type: string
|
||||||
dependencies:
|
dependencies:
|
||||||
- dist: null
|
- dist: null
|
||||||
category: share
|
category: share
|
||||||
|
|||||||
Reference in New Issue
Block a user