Add: docker-collections from mrjk

This commit is contained in:
mrjk 2022-07-19 01:06:13 -04:00
parent cc0a2fb2a8
commit fb9ebb5380
6 changed files with 113 additions and 15 deletions

11
ldap-user-manager/.env Normal file
View File

@ -0,0 +1,11 @@
APP_IMAGE=traefik
APP_VERSION=v2.6.1
APP_PUBLIC_IP="127.0.0.1"
APP_NETWORK=''
APP_DOMAIN=dev
APP_ADMIN_EMAIL=admin@dev
TRAEFIK_CERTRESOLV=default
TRAEFIK_CERTRESOLV_PROVIDER=''

View File

@ -0,0 +1,10 @@
# OpenLDAP Server
## Self-serve configuration
## LUM configuration
For lUM, an initial config step is required:
https://lum.dev.box/setup/

View File

@ -0,0 +1,9 @@
services:
manager:
environment:
- LDAP_DEBUG=true
- LDAP_VERBOSE_CONNECTION_LOGS=true
- SESSION_DEBUG=true
- SMTP_LOG_LEVEL=4

View File

@ -0,0 +1,17 @@
networks:
proxy:
external: true
name: ${APP_PROXY_NETWORK}
services:
manager:
labels:
traefik.enable: "true"
traefik.http.routers.lum.entrypoints: front-http,front-https
traefik.http.routers.lum.rule: Host(`lum.$APP_TOP_DOMAIN`)
traefik.http.routers.lum.service: lum
traefik.http.routers.lum.tls: "true"
traefik.http.routers.lum.tls.certresolver: $TRAEFIK_CERTRESOLV
traefik.http.services.lum.loadbalancer.server.port: '80'

View File

@ -1,18 +1,18 @@
version: "3.9"
networks: networks:
proxy: ldap:
name: ${APP_PROXY_NETWORK} external: true
name: ${APP_LDAP_NETWORK}
services: services:
manager: manager:
image: wheelybird/ldap-user-manager:latest image: wheelybird/ldap-user-manager:latest
restart: always #restart: always
networks: networks:
proxy: ldap:
default:
environment: environment:
- "SERVER_HOSTNAME=lum.$APP_TOP_DOMAIN" - "SERVER_HOSTNAME=lum.$APP_TOP_DOMAIN"
@ -29,12 +29,3 @@ services:
# MrJK Tweaking # MrJK Tweaking
- "USERNAME_REGEX=^[a-z][a-zA-Z0-9._-]{2,32}$$" - "USERNAME_REGEX=^[a-z][a-zA-Z0-9._-]{2,32}$$"
labels:
traefik.enable: "true"
traefik.http.routers.lum.entrypoints: front-http,front-https
traefik.http.routers.lum.rule: Host(`lum.$APP_TOP_DOMAIN`)
traefik.http.routers.lum.service: lum
traefik.http.routers.lum.tls: "true"
traefik.http.routers.lum.tls.certresolver: $TRAEFIK_CERTRESOLV
traefik.http.services.lum.loadbalancer.server.port: '80'

60
traefik/init.sh Executable file
View File

@ -0,0 +1,60 @@
#!/bin/bash
install_mkcert ()
{
local url=https://github.com/FiloSottile/mkcert/releases/download/v1.4.3/mkcert-v1.4.3-linux-amd64
local file=${url##*/}
if [[ -f mkcert ]]; then
MKCERT=$PWD/mkcert
return
fi
if command -v mkcert >&/dev/null; then
MKCERT=$(command -v mkcert)
return
fi
# Install mkcert in PWD
wget "$url"
mv "$file" mkcert
chmod +x mkcert
}
gen_certs ()
{
install_mkcert
DOMAIN1="domain1.org"
DOMAIN2="domain2.org"
SUBDOMAINS=$( echo {infra,paas,apps,iaas,dev,cloud,lab,adm,sv,mgmt}.$DOMAIN1 {infra,paas,apps,iaas,dev,cloud,lab,adm,sv,mgmt}.$DOMAIN2 )
DOMAIN=$DOMAIN1
echo $MKCERT "$DOMAIN" "*.$DOMAIN" $SUBDOMAINS
(
cd config/
$MKCERT "$DOMAIN" "*.$DOMAIN" $SUBDOMAINS
)
echo "INFO: Certificates has bee generated."
tree config
}
gen_htpassword ()
{
CONFIG="admin:admin"
local dst="./config/htpasswd"
set -x
while IFS=: read -r user pass; do
! grep -sq "^$user:" $dst >&/dev/null || continue
echo "Add: $user to $dst"
printf "$user:$(openssl passwd -apr1 $pass)\n" >> "$dst"
done <<< "$CONFIG"
}
main ()
{
gen_certs
gen_htpassword
}
main