Files
Bertrand Gouny 7ce0c43309 feat: add Postfix Book schema and improve diagnostics
Add the Postfix Book schema in .schema and cn=config LDIF formats, document its incompatibility with virtualMail, and improve debug output and validation during schema conversion and file moves. Update the base image to osixia/baseimage:alpine-2.0.0-rc3 and document the changes for 2.6.15-beta.
2026-10-13 22:06:15 +02:00

29 lines
570 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
generate_password() {
openldap-ctl password generate
}
hash_password() {
if [ "$#" -ne 1 ] || [ -z "$1" ]; then
container log fatal "password to hash required"
fi
openldap-ctl password hash "$1"
}
ensure_hashed_password() {
local hashed_var="$1"
local label="$2"
[ -n "${!hashed_var}" ] && return 0
local plain_var
plain_var=$(generate_password)
container log warning "Generated ${label} password: ${plain_var}"
printf -v "${hashed_var}" '%s' "$(hash_password "${plain_var}")"
}