Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ldap #679

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions terraform/_modules/authentik/ldap_app/data.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "authentik_flow" "default-authentication-flow" {
slug = "default-authentication-flow"
}
16 changes: 16 additions & 0 deletions terraform/_modules/authentik/ldap_app/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
resource "authentik_application" "app" {
name = var.name
slug = replace(lower(var.name), " ", "-")
protocol_provider = authentik_provider_ldap.main.id
meta_icon = var.app_values.icon_url
meta_publisher = var.app_values.meta_publisher
meta_description = var.app_values.meta_description
group = var.group
}

resource "authentik_policy_binding" "app-access" {
for_each = toset(var.access_group)
target = authentik_application.app.uuid
group = each.key
order = index(var.access_group, each.key) + 100
}
3 changes: 3 additions & 0 deletions terraform/_modules/authentik/ldap_app/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "app_id" {
value = authentik_application.app.id
}
7 changes: 7 additions & 0 deletions terraform/_modules/authentik/ldap_app/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
terraform {
required_providers {
authentik = {
source = "goauthentik/authentik"
}
}
}
24 changes: 24 additions & 0 deletions terraform/_modules/authentik/ldap_app/vars.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
variable "name" {
type = string
}

variable "group" {
type = string
}

variable "app_values" {
type = object({
meta_publisher = optional(string)
meta_description = optional(string)
icon_url = optional(string)
})
}

variable "access_group" {
type = list(string)
}

variable "jwks_sources" {
type = list(string)
default = []
}
8 changes: 1 addition & 7 deletions terraform/authentik/applications.tf
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,10 @@ module "authentik-app-miniflux" {
}

module "authentik-app-jellyfin" {
source = "../_modules/authentik/proxy_app"
source = "../_modules/authentik/ldap_app"
name = "Jellyfin"
group = "main"

proxy_values = {
internal = ""
external = "https://jellyfin.k8s.chkpwd.com"
mode = "forward_single"
}

app_values = {
meta_description = "Usenet Downloader"
icon_url = "https://cdn.jsdelivr.net/gh/chkpwd/icons@main/png/jellyfin.png"
Expand Down
1 change: 0 additions & 1 deletion terraform/authentik/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ resource "authentik_outpost" "main" {
module.authentik-app-prowlarr.provider_id,
module.authentik-app-sabnzbd.provider_id,
module.authentik-app-mainsail.provider_id,
module.authentik-app-jellyfin.provider_id,
]
service_connection = authentik_service_connection_kubernetes.main.id
}
Expand Down