zm_create.sql is generated at build time, so every new install's Config
table holds the public shipped default secret. zmupdate.pl -f replaces
it, but the rpm %post runs -f only on upgrade, and containers or a
database created by hand from zm_create.sql never run it. Token auth
then refuses to work until the admin sets a secret.
loadConfig() now passes the secret through ensureAuthHashSecret(): a
default or empty value is replaced with bin2hex(random_bytes(32)) and
stored. The UPDATE matches the old value and the stored value is read
back, so concurrent first requests agree on one secret. A secret set in
zm.conf or conf.d is left alone.
ZM_AUTH_HASH_SECRET_DEFAULT moves from auth.php to config.php.in, which
loads first.
Tests: tests/php/test_auth_hash_secret_generate.php.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit a844cf136827d175f8dd02400c9755923bd28f1c)