feat: add firezone tofu app

This commit is contained in:
cătălin 2024-03-24 17:31:30 +01:00
commit dc6fc316e7
No known key found for this signature in database
5 changed files with 61 additions and 8 deletions

View file

@ -21,6 +21,11 @@ resource "authentik_group" "ci" {
users = [data.authentik_user.catalin.id] users = [data.authentik_user.catalin.id]
} }
resource "authentik_group" "admins" {
name = "authentik Admins"
is_superuser = true
}
module "argo-workflows" { module "argo-workflows" {
source = "../modules/authentik" source = "../modules/authentik"
app_name = "Argo Workflows" app_name = "Argo Workflows"
@ -28,6 +33,24 @@ module "argo-workflows" {
client_id = var.argo_workflows_client_id client_id = var.argo_workflows_client_id
client_secret = var.argo_workflows_client_secret client_secret = var.argo_workflows_client_secret
app_access_group_id = authentik_group.ci.id app_access_group_id = authentik_group.ci.id
redirect_uris = ["https://ci.fuku/oauth2/callback"] redirect_uris = ["https://ci.fuku/oauth2/callback"]
app_icon = "https://argoproj.github.io/icons/icon-512x512.png" app_icon = "https://argoproj.github.io/icons/icon-512x512.png"
app_description = "Kubernetes-native workflow engine supporting DAG and step-based workflows"
app_publisher = "Argo Project"
app_url = "https://ci.fuku"
}
module "firezone" {
source = "../modules/authentik"
app_name = "Firezone"
app_slug = "firezone"
client_id = var.firezone_client_id
client_secret = var.firezone_client_secret
app_access_group_id = authentik_group.admins.id
redirect_uris = ["https://fz.fukurokuju.dev/auth/oidc/authentik/callback/"]
app_icon = "https://www.firezone.dev/icon.svg"
app_description = "VPN"
app_publisher = "Firezone"
app_url = "https://fz.fukurokuju.dev"
sub_mode = "hashed_user_id"
} }

View file

@ -1,4 +1,6 @@
AUTHENTIK_URL=https://auth.fukurokuju.dev AUTHENTIK_URL=https://auth.fukurokuju.dev
AUTHENTIK_TOKEN= AUTHENTIK_TOKEN=
TF_VAR_argo_workflows_client_id= TF_VAR_argo_workflows_client_id=
TF_VAR_argo_workflows_client_secret= TF_VAR_argo_workflows_client_secret=
TF_VAR_firezone_client_id=
TF_VAR_firezone_client_secret=

View file

@ -7,3 +7,13 @@ variable "argo_workflows_client_secret" {
description = "Client secret" description = "Client secret"
type = string type = string
} }
variable "firezone_client_id" {
description = "Client ID"
type = string
}
variable "firezone_client_secret" {
description = "Client secret"
type = string
}

View file

@ -38,6 +38,9 @@ resource "authentik_application" "app" {
protocol_provider = authentik_provider_oauth2.provider_oidc.id protocol_provider = authentik_provider_oauth2.provider_oidc.id
open_in_new_tab = var.open_in_new_tab open_in_new_tab = var.open_in_new_tab
meta_icon = var.app_icon meta_icon = var.app_icon
meta_description = var.app_description
meta_publisher = var.app_publisher
meta_launch_url = var.app_url
} }
resource "authentik_policy_binding" "app_access" { resource "authentik_policy_binding" "app_access" {
target = authentik_application.app.uuid target = authentik_application.app.uuid

View file

@ -29,7 +29,7 @@ variable "redirect_uris" {
} }
variable "sub_mode" { variable "sub_mode" {
type = string type = string
default = "user_username" default = "user_username"
} }
@ -40,11 +40,26 @@ variable "oidc_signing_key" {
} }
variable "open_in_new_tab" { variable "open_in_new_tab" {
type = bool type = bool
description = "Open apps in a new tab" description = "Open apps in a new tab"
default = true default = true
} }
variable "app_icon" { variable "app_icon" {
type = string type = string
} default = ""
}
variable "app_description" {
type = string
default = ""
}
variable "app_publisher" {
type = string
default = ""
}
variable "app_url" {
type = string
default = ""
}