First Commit

This commit is contained in:
Lonny Lowe 2026-09-24 11:29:54 -05:00
commit 2e5a4751a7
30 changed files with 2517 additions and 0 deletions

24
image/ad-dnsupdate.sh Normal file
View file

@ -0,0 +1,24 @@
#!/bin/sh
# =====================================================================================
# Samba dnsupdate wrapper: pins DNS registration to the address(es) this DC advertises.
#
# Why: a Docker host is multi-homed (docker0 + every user-defined bridge + whatever stale
# DHCP addresses linger). Samba's updater registers ALL non-loopback interfaces, so the DC's
# A record ends up containing 172.17.0.1 etc. Clients that pick one of those get connection
# failures that look like Kerberos/SMB bugs. Wired in via smb.conf:
# dns update command = /usr/local/bin/ad-dnsupdate
# so it governs the daemon's internal updater as well as manual invocations.
#
# The address list is written by ad-entrypoint to /run/ad-dc-addresses (one per line).
# =====================================================================================
IPFILE=/run/ad-dc-addresses
if [ -f "$IPFILE" ]; then
set -- --current-ip="$(head -n 1 "$IPFILE")" "$@"
# remaining lines (e.g. IPv6) -> additional --current-ip arguments
for line in $(tail -n +2 "$IPFILE"); do
set -- "$@" --current-ip="$line"
done
fi
exec /usr/sbin/samba_dnsupdate "$@"