Remove external LLDAP service in favor of authentik
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
LLDAP_JWT_SECRET=
|
||||
LLDAP_BASE_DN=
|
||||
LLDAP_USER_DN=
|
||||
LLDAP_USER_EMAIL=
|
||||
LLDAP_USER_PASS=
|
||||
LLDAP_KEY_SEED=
|
||||
@@ -1,58 +0,0 @@
|
||||
# LLDAP Module
|
||||
|
||||
This module deploys [](), an app to manage users for authentik, as a container in the homelab environment.
|
||||
|
||||
## Overview
|
||||
|
||||
The LLDAP Module
|
||||
|
||||
- Deploys a container
|
||||
- `LLDAP`: The main LLDAP server holding my users.
|
||||
|
||||
## Usage:
|
||||
```hcl
|
||||
module "lldap" {
|
||||
source = "../../10-generic/docker-service"
|
||||
container_name = local.container_name
|
||||
image = local.lldap_image
|
||||
tag = local.lldap_tag
|
||||
volumes = local.lldap_volumes
|
||||
env_vars = local.lldap_env_vars
|
||||
networks = concat(var.networks)
|
||||
restart_policy = "always"
|
||||
}
|
||||
```
|
||||
|
||||
## Outputs
|
||||
|
||||
| Output | Description |
|
||||
| -------------------- | ---------------------------------------------------------- |
|
||||
| `service_definition` | Service definition for integration with networking modules |
|
||||
|
||||
## Service Definition
|
||||
|
||||
This module outputs a service definition that is used by the networking modules to expose the service.
|
||||
|
||||
```hcl
|
||||
output "service_definition" {
|
||||
description = "General service definition with optional ingress configuration"
|
||||
value = {
|
||||
name = local.container_name
|
||||
primary_port = local.lldap_internal_port
|
||||
endpoint = "http://${local.container_name}:${local.lldap_internal_port}"
|
||||
subdomains = ["users"]
|
||||
ports = []
|
||||
}
|
||||
}```
|
||||
|
||||
## Example Integration in Main Configuration
|
||||
|
||||
```hcl
|
||||
module "lldap" {
|
||||
source = "${local.module_dir}/30-services-software/lldap-service"
|
||||
volume_path = "${local.root_volume}/lldap"
|
||||
networks = [
|
||||
module.homelab_docker_network.name
|
||||
]
|
||||
}
|
||||
```
|
||||
@@ -1,53 +0,0 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
dotenv = {
|
||||
source = "germanbrew/dotenv"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
locals {
|
||||
container_name = "lldap"
|
||||
lldap_image = "ghcr.io/lldap/lldap"
|
||||
lldap_tag = var.image_tag
|
||||
env_file = "${path.module}/.env"
|
||||
lldap_internal_port = 17170
|
||||
|
||||
lldap_volumes = [
|
||||
{
|
||||
host_path = "${var.volume_path}/${local.container_name}/data"
|
||||
container_path = "/data"
|
||||
read_only = false
|
||||
},
|
||||
]
|
||||
|
||||
lldap_env_vars = {
|
||||
LLDAP_JWT_SECRET = provider::dotenv::get_by_key("LLDAP_JWT_SECRET", local.env_file)
|
||||
LLDAP_BASE_DN = provider::dotenv::get_by_key("LLDAP_BASE_DN", local.env_file)
|
||||
LLDAP_USER_DN = provider::dotenv::get_by_key("LLDAP_USER_DN", local.env_file)
|
||||
LLDAP_USER_EMAIL = provider::dotenv::get_by_key("LLDAP_USER_EMAIL", local.env_file)
|
||||
LLDAP_USER_PASS = provider::dotenv::get_by_key("LLDAP_USER_PASS", local.env_file)
|
||||
LLDAP_KEY_SEED = provider::dotenv::get_by_key("LLDAP_KEY_SEED", local.env_file)
|
||||
}
|
||||
}
|
||||
|
||||
module "lldap" {
|
||||
source = "../../10-generic/docker-service"
|
||||
container_name = local.container_name
|
||||
image = local.lldap_image
|
||||
tag = local.lldap_tag
|
||||
volumes = local.lldap_volumes
|
||||
env_vars = local.lldap_env_vars
|
||||
networks = concat(var.networks)
|
||||
restart_policy = "always"
|
||||
}
|
||||
|
||||
output "service_definition" {
|
||||
description = "General service definition with optional ingress configuration"
|
||||
value = {
|
||||
name = local.container_name
|
||||
primary_port = local.lldap_internal_port
|
||||
endpoint = "http://${local.container_name}:${local.lldap_internal_port}"
|
||||
subdomains = ["users"]
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
|
||||
variable "image_tag" {
|
||||
description = "The tag for the LLDAP container image. Default: latest-alpine-rootless"
|
||||
type = string
|
||||
default = "latest-alpine-rootless"
|
||||
}
|
||||
|
||||
variable "volume_path" {
|
||||
description = "Base directory for volumes"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "networks" {
|
||||
description = "List of networks to which the container should be attached"
|
||||
type = list(string)
|
||||
default = []
|
||||
}
|
||||
|
||||
variable "user_id" {
|
||||
description = "User ID for container permissions"
|
||||
type = string
|
||||
default = "1000"
|
||||
}
|
||||
|
||||
variable "group_id" {
|
||||
description = "Group ID for container permissions"
|
||||
type = string
|
||||
default = "1000"
|
||||
}
|
||||
|
||||
variable "timezone" {
|
||||
description = "Timezone for the container"
|
||||
type = string
|
||||
default = "Europe/Helsinki"
|
||||
}
|
||||
@@ -16,14 +16,6 @@ module "homelab_docker_network" {
|
||||
subnet = "10.88.0.0/16"
|
||||
}
|
||||
|
||||
module "lldap" {
|
||||
source = "${local.module_dir}/30-services-software/lldap-service"
|
||||
volume_path = "${local.root_volume}/lldap"
|
||||
networks = [
|
||||
module.homelab_docker_network.name
|
||||
]
|
||||
}
|
||||
|
||||
module "authentik" {
|
||||
source = "${local.module_dir}/30-services-software/authentik-service"
|
||||
volume_path = "${local.root_volume}/authentik"
|
||||
|
||||
@@ -2,7 +2,6 @@ output "service_definitions" {
|
||||
description = "Service definitions for all services"
|
||||
value = [
|
||||
module.jellyfin.service_definition,
|
||||
module.lldap.service_definition,
|
||||
module.authentik.service_definition,
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user