From 4ec9a003707514665b370aa0e9786cd077358b21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?c=C4=83t=C4=83lin?= Date: Wed, 11 Dec 2024 14:47:15 +0100 Subject: [PATCH] feat: add sftpgo tofu deploy --- tofu/authentik/main.tf | 29 +++++++++++++++++++++++++++++ tofu/authentik/vars.tf | 10 ++++++++++ 2 files changed, 39 insertions(+) diff --git a/tofu/authentik/main.tf b/tofu/authentik/main.tf index 3d8f724..c9008b5 100644 --- a/tofu/authentik/main.tf +++ b/tofu/authentik/main.tf @@ -17,6 +17,7 @@ data "authentik_user" "catalin" { username = "catalin" } + resource "authentik_group" "ci" { name = "ci" users = [data.authentik_user.catalin.id] @@ -32,6 +33,10 @@ resource "authentik_group" "vpn" { is_superuser = false } +resource "authentik_group" "ftp" { + name = "ftp" + is_superuser = false +} module "gitea" { source = "../modules/authentik-oidc" @@ -141,6 +146,30 @@ module "lidarr" { app_icon = "https://lidarr.audio/img/background/logo.png" } +module "sftpgo" { + source = "../modules/authentik-oidc" + app_name = "SFTPGo" + app_slug = "SFTPGo" + client_id = var.sftpgo_client_id + client_secret = var.sftpgo_client_secret + client_type = "confidential" + app_access_group_id = authentik_group.ftp.id + redirect_uris = [ + { + matching_mode = "regex", + url = "https://ftp.fukurokuju.dev/.*" + } + ] + extra_property_mappings = [ + + ] + app_icon = "https://ftp.fukurokuju.dev/static/img/logo.png" + access_token_validity = "days=10" + app_url = "https://ftp.fukurokuju.dev" + app_description = "SFTPGo" + sub_mode = "user_username" +} + module "netbird" { source = "../modules/authentik-oidc" app_name = "netbird" diff --git a/tofu/authentik/vars.tf b/tofu/authentik/vars.tf index 1b5020c..50cba45 100644 --- a/tofu/authentik/vars.tf +++ b/tofu/authentik/vars.tf @@ -48,3 +48,13 @@ variable "netbird_client_secret" { description = "Netbird client secret" type = string } + +variable "sftpgo_client_id" { + description = "SFTPGo client ID" + type = string +} + +variable "sftpgo_client_secret" { + description = "SFTPGo client secret" + type = string +}