From 6c88dadeae2d7b43b029cd8c05ddc2cefff87d09 Mon Sep 17 00:00:00 2001
From: Pierre Delpy
Date: Thu, 26 Nov 2026 10:31:11 +0100
Subject: [PATCH] feat: Check that LDM_AUTH holds valid basic auth users
---
lib/check-bridgehead.sh | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/lib/check-bridgehead.sh b/lib/check-bridgehead.sh
index ea6bba6..0141802 100755
--- a/lib/check-bridgehead.sh
+++ b/lib/check-bridgehead.sh
@@ -57,6 +57,13 @@ for DIR in /srv/docker/bridgehead /etc/bridgehead; do
fi
done
+if [[ "$LDM_AUTH" =~ ^[^:,]+:[^:,]+(,[^:,]+:[^:,]+)*$ ]]; then
+ report OK "LDM_AUTH holds valid basic auth users"
+else
+ report CRIT "LDM_AUTH is empty or not a comma-separated list of user:hash entries" \
+ "Hint: Remove the LDM_AUTH line from /etc/bridgehead/$PROJECT.local.conf and run '/srv/docker/bridgehead/bridgehead adduser $PROJECT' for the component LDM_AUTH."
+fi
+
if [ -d "/etc/bridgehead/.git" ]; then
if [ -z "$(git -C "/etc/bridgehead" status --porcelain)" ]; then
report OK "The config repo at /etc/bridgehead is clean"