feat(LLDAP): Add new service

This commit is contained in:
Simon 2023-07-05 14:57:00 +02:00
parent 2667aa22dd
commit 06f1e2910f
8 changed files with 164 additions and 0 deletions

View File

@ -23,6 +23,7 @@ Vous trouverez dans ce dépôt l'ensemble des services Open Source que RésiLien
- [GeoIP Update](./geoipupdate) : Permet de télécharger la base de données GeoIP2 permettant de localiser les IPs
- [Gitea](./gitea) : Un service Git très simple à installer et à utiliser. Il est similaire à GitHub, Bitbucket ou Gitlab.
- [Grafana](./grafana) : Un outil de supervision simple et élégant
- [LLDAP](./lldap): Implémentation légère de LDAP pour l'authentification
- [PostgreSQL](./postgres) : PostgreSQL est un système de gestion de base de données relationnelle et objet.
- [Prometheus](./prometheus) : Un logiciel de surveillance informatique
- [Redis](./redis) : Système de gestion de base de données clé-valeur extensible, très hautes performances

50
lldap/.env Normal file
View File

@ -0,0 +1,50 @@
########
# DOCKER
SERVICES_DIR=..
COMPOSE_FILE=${SERVICES_DIR}/lldap/docker-compose.yml:${SERVICES_DIR}/lldap/docker-compose.local.yml:${SERVICES_DIR}/postgres/docker-compose.yml
#COMPOSE_PROJECT_NAME=
#######
# LLDAP
LLDAP_DOMAIN=lldap.cool.life
LLDAP_VOLUME_NAME=lldap_cool_life
LLDAP_CONTAINER_NAME=lldap_cool_life
LLDAP_IMAGE=nitnelave/lldap:v0.4.3
LLDAP_JWT_SECRET="6IeP8UUbEkQXrkUNbnu1sGpcZOu29wUTWh3uiEgMorI="
LLDAP_VERBOSE=true
LLDAP_LDAP_BASE_DN="dc=cool,dc=life"
LLDAP_LDAP_USER_DN="myuser"
LLDAP_LDAP_USER_EMAIL="admin@cool.life"
LLDAP_LDAP_USER_PASS="mon-mot-de-passe"
# LLDAP_TEST_EMAIL_TO=
# LLDAP_SMTP_OPTIONS__ENABLE_PASSWORD_RESET=
# LLDAP_SMTP_OPTIONS__SERVER=
# LLDAP_SMTP_OPTIONS__PORT=
# LLDAP_SMTP_OPTIONS__SMTP_ENCRYPTION=
# LLDAP_SMTP_OPTIONS__USER=
# LLDAP_SMTP_OPTIONS__PASSWORD=
# LLDAP_SMTP_OPTIONS__FROM=
# LLDAP_SMTP_OPTIONS__REPLY_TO=
##########
# POSTGRES
POSTGRES_USER=user-example
POSTGRES_PASSWORD=password-example
POSTGRES_DB=postgres-database-name-example
POSTGRES_CONTAINER_NAME=lldap-postgres
POSTGRES_VOLUME_NAME=lldap-postgres
#POSTGRES_IMAGE=
#########
# TRAEFIK
#TRAEFIK_NETWORK_NAME=
#TRAEFIK_ROUTER_NAME= # Don't use char '.'
#TRAEFIK_ENTRYPOINTS=

27
lldap/README.md Normal file
View File

@ -0,0 +1,27 @@
# LLDAP
> Implémentation légère de LDAP pour l'authentification :
> Ce projet est un serveur d'authentification léger (écrit en rust) qui fournit une interface LDAP simplifiée pour l'authentification. Il s'intègre avec de nombreux backends, de KeyCloak à [Authelia](https://github.com/lldap/lldap/blob/main/example_configs/authelia_config.yml) en passant par Nextcloud et plus encore !
## Documentation
- Le fichier [`lldap_config.docker_template.toml`](https://github.com/lldap/lldap/blob/main/lldap_config.docker_template.toml) contient toute la configuration possible de l'outil.
- De base le projet utilise SQLite, mais on peut utiliser Postgres voir le fichier [`docker-compose.postgres.yml`](./docker-compose.postgres.yml)
- Le projet n'est pas [traduit](https://github.com/lldap/lldap/issues/20) actuellement
- Lors du lancement du service une clé est généré aléatoirement dans le fichier `private_key` du dossier `/data` du container, ce fichier est important il faut donc le sauvegarder puisque les mots de passe sont chiffrés en base avec.
## Configuration
La configuration a été séparée en 5 fichiers :
- [`docker-compose.yml`](./docker-compose.yml) contient la configuration de base
- [`docker-compose.local.yml`](./docker-compose.local.yml) permettant de tester le service sans Traefik
- [`docker-compose.smtp.yml`](./docker-compose.smtp.yml) correspondant à la configuration du service SMTP
- [`docker-compose.postgres.yml`](./docker-compose.postgres.yml) pour configurer le service Postgres
- [`docker-compose.traefik.yml`](./docker-compose.traefik.yml) pour configurer automatiquement Traefik
## Liens
- [Code source](https://github.com/lldap/lldap)
- [Docker Hub](https://hub.docker.com/r/nitnelave/lldap)
- [Documentation](https://github.com/lldap/lldap/blob/main/lldap_config.docker_template.toml)

View File

@ -0,0 +1,13 @@
---
version: "3.8"
services:
lldap:
ports:
# For LDAP
- "3890:3890"
# For LDAPS (LDAP Over SSL), enable port if LLDAP_LDAPS_OPTIONS__ENABLED set true, look env below
- "6360:6360"
# For the web front-end
- "17170:17170"

View File

@ -0,0 +1,8 @@
---
version: "3.8"
services:
lldap:
environment:
- LLDAP_DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_CONTAINER_NAME}/${POSTGRES_DB}

View File

@ -0,0 +1,16 @@
---
version: "3.8"
services:
lldap:
environment:
- LLDAP_TEST_EMAIL_TO=${LLDAP_TEST_EMAIL_TO}
- LLDAP_SMTP_OPTIONS__ENABLE_PASSWORD_RESET=${LLDAP_SMTP_OPTIONS__ENABLE_PASSWORD_RESET}
- LLDAP_SMTP_OPTIONS__SERVER=${LLDAP_SMTP_OPTIONS__SERVER}
- LLDAP_SMTP_OPTIONS__PORT=${LLDAP_SMTP_OPTIONS__PORT}
- LLDAP_SMTP_OPTIONS__SMTP_ENCRYPTION=${LLDAP_SMTP_OPTIONS__ENCRYPTION}
- LLDAP_SMTP_OPTIONS__USER=${LLDAP_SMTP_OPTIONS__USER}
- LLDAP_SMTP_OPTIONS__PASSWORD=${LLDAP_SMTP_OPTIONS__PASSWORD}
- LLDAP_SMTP_OPTIONS__FROM=${LLDAP_SMTP_OPTIONS__FROM}
- LLDAP_SMTP_OPTIONS__REPLY_TO=${LLDAP_SMTP_OPTIONS__TO}

View File

@ -0,0 +1,23 @@
---
version: "3.8"
networks:
default:
name: ${TRAEFIK_NETWORK_NAME:-traefik}
services:
lldap:
labels:
- traefik.enable=true
- traefik.docker.network=${TRAEFIK_NETWORK_NAME:-traefik}
- traefik.http.routers.${TRAEFIK_ROUTER_NAME:-lldap}.rule=Host(`${LLDAP_DOMAIN:?err}`)
- traefik.http.routers.${TRAEFIK_ROUTER_NAME:-lldap}.entrypoints=${TRAEFIK_ENTRYPOINTS:-web}
# - traefik.http.routers.${TRAEFIK_ROUTER_NAME:-lldap}.tls.certResolver=letsencrypt
- traefik.http.services.${TRAEFIK_ROUTER_NAME:-lldap}.loadbalancer.server.port=17170
- traefik.http.services.${TRAEFIK_ROUTER_NAME:-lldap}.loadbalancer.server.scheme=http
# https://github.com/lldap/lldap/issues/247#issuecomment-1489962511
# - traefik.tcp.routers.${TRAEFIK_ROUTER_NAME:-lldap}.rule=HostSNI(`${LLDAP_DOMAIN:?err}`)
# - traefik.tcp.routers.${TRAEFIK_ROUTER_NAME:-lldap}.entrypoints=${TRAEFIK_ENTRYPOINTS:-web}
# - traefik.tcp.services.${TRAEFIK_ROUTER_NAME:-lldap}.loadbalancer.server.port=3890

26
lldap/docker-compose.yml Normal file
View File

@ -0,0 +1,26 @@
---
version: "3.8"
volumes:
lldap:
name: ${LLDAP_VOLUME_NAME:-lldap}
services:
lldap:
container_name: ${LLDAP_CONTAINER_NAME:-lldap}
image: ${LLDAP_IMAGE:-nitnelave/lldap:v0.4.3}
restart: always
volumes:
- "lldap:/data"
environment:
- TZ=${TIMEZONE:-Europe/Paris}
- LLDAP_VERBOSE=${LLDAP_VERBOSE:-false}
- LLDAP_JWT_SECRET=${LLDAP_JWT_SECRET:?err}
- LLDAP_HTTP_URL=https://${LLDAP_DOMAIN:?err}
- LLDAP_LDAP_BASE_DN=${LLDAP_LDAP_BASE_DN:?err}
- LLDAP_LDAP_USER_DN=${LLDAP_LDAP_USER_DN:?err}
- LLDAP_LDAP_USER_EMAIL=${LLDAP_LDAP_USER_EMAIL:?err}
- LLDAP_LDAP_USER_PASS=${LLDAP_LDAP_USER_PASS:?err}