Fix authentik config
This commit is contained in:
parent
979a386831
commit
424e1db07f
9 changed files with 17 additions and 7 deletions
|
@ -88,6 +88,7 @@ variable "services" {
|
|||
})))
|
||||
ports = optional(list(string))
|
||||
auth = bool
|
||||
auth_cert = optional(string)
|
||||
auth_redirects = optional(list(string))
|
||||
s3 = bool
|
||||
database = bool
|
||||
|
|
|
@ -2,10 +2,14 @@ data "authentik_flow" "default_authorization_flow" {
|
|||
slug = "default-provider-authorization-implicit-consent"
|
||||
}
|
||||
|
||||
data "authentik_certificate_key_pair" "default" {
|
||||
data "authentik_certificate_key_pair" "ecdsa" {
|
||||
name = "auth.serguzim.me"
|
||||
}
|
||||
|
||||
data "authentik_certificate_key_pair" "rsa" {
|
||||
name = "authentik Self-signed Certificate"
|
||||
}
|
||||
|
||||
data "authentik_property_mapping_provider_scope" "default_scopes" {
|
||||
managed_list = [
|
||||
"goauthentik.io/providers/oauth2/scope-email",
|
||||
|
@ -58,7 +62,9 @@ resource "authentik_provider_oauth2" "service_providers" {
|
|||
data.authentik_property_mapping_provider_scope.default_scopes.ids,
|
||||
each.key == "minio" ? [authentik_property_mapping_provider_scope.minio.id] : []
|
||||
])
|
||||
signing_key = data.authentik_certificate_key_pair.default.id
|
||||
signing_key = (each.value.auth_cert == "rsa" ?
|
||||
data.authentik_certificate_key_pair.rsa.id :
|
||||
data.authentik_certificate_key_pair.ecdsa.id)
|
||||
}
|
||||
|
||||
resource "authentik_application" "service_applications" {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
output "authentik_data" {
|
||||
value = {
|
||||
for key in keys(authentik_application.service_applications) : key => {
|
||||
"base_url" = "${var.authentik_url}/application/o/${authentik_application.service_applications[key].slug}/"
|
||||
"base_url" = "${var.authentik_url}/application/o/${authentik_application.service_applications[key].slug}"
|
||||
"client_id" = authentik_provider_oauth2.service_providers[key].client_id
|
||||
"client_secret" = authentik_provider_oauth2.service_providers[key].client_secret
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ variable "services" {
|
|||
})))
|
||||
ports = optional(list(string))
|
||||
auth = bool
|
||||
auth_cert = optional(string)
|
||||
auth_redirects = optional(list(string))
|
||||
s3 = bool
|
||||
database = bool
|
||||
|
|
|
@ -47,7 +47,7 @@ gatus_yml:
|
|||
|
||||
security:
|
||||
oidc:
|
||||
issuer-url: "{{ opentofu.authentik_data.gatus.base_url }}"
|
||||
issuer-url: "{{ opentofu.authentik_data.gatus.base_url }}/"
|
||||
redirect-url: "https://{{ gatus_svc.domain }}/authorization-code/callback"
|
||||
client-id: "{{ opentofu.authentik_data.gatus.client_id }}"
|
||||
client-secret: "{{ opentofu.authentik_data.gatus.client_secret }}"
|
||||
|
|
|
@ -27,8 +27,8 @@ linkwarden_env:
|
|||
SPACES_FORCE_PATH_STYLE: false
|
||||
|
||||
NEXT_PUBLIC_DISABLE_REGISTRATION: true
|
||||
NEXT_PUBLIC_CREDENTIALS_ENABLED: true
|
||||
NEXT_PUBLIC_AUTHENTIK_ENABLED: false
|
||||
NEXT_PUBLIC_CREDENTIALS_ENABLED: false
|
||||
NEXT_PUBLIC_AUTHENTIK_ENABLED: true
|
||||
AUTHENTIK_CUSTOM_NAME: auth.serguzim.me
|
||||
AUTHENTIK_ISSUER: "{{ opentofu.authentik_data.linkwarden.base_url }}"
|
||||
AUTHENTIK_CLIENT_ID: "{{ opentofu.authentik_data.linkwarden.client_id }}"
|
||||
|
|
|
@ -40,7 +40,7 @@ vikunja_yml:
|
|||
enabled: true
|
||||
providers:
|
||||
- name: auth.serguzim.me
|
||||
authurl: "{{ opentofu.authentik_data.vikunja.base_url }}"
|
||||
authurl: "{{ opentofu.authentik_data.vikunja.base_url }}/"
|
||||
logouturl: "{{ (opentofu.authentik_data.vikunja.base_url, 'end-session') | path_join }}"
|
||||
clientid: "{{ opentofu.authentik_data.vikunja.client_id }}"
|
||||
clientsecret: "{{ opentofu.authentik_data.vikunja.client_secret }}"
|
||||
|
|
|
@ -233,6 +233,7 @@ services = {
|
|||
group = "4-services"
|
||||
}
|
||||
auth = true
|
||||
auth_cert = "rsa"
|
||||
auth_redirects = ["https://bookmarks.serguzim.me/api/v1/auth/callback/authentik"]
|
||||
database = true
|
||||
s3 = true
|
||||
|
|
|
@ -144,6 +144,7 @@ variable "services" {
|
|||
}))
|
||||
ports = optional(list(string))
|
||||
auth = bool
|
||||
auth_cert = optional(string)
|
||||
auth_redirects = optional(list(string))
|
||||
s3 = bool
|
||||
database = bool
|
||||
|
|
Loading…
Reference in a new issue