From 3f7228f9c6c53a65db7dd08a846cf4514606756a Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> Date: Fri, 17 Jul 2026 21:16:15 +0200 Subject: [PATCH] fix(webtrees): initialize database schema before admin user creation (#15837) PR #14818 replaced the setup wizard curl with CLI commands but omitted the schema migration step, causing fresh installs to fail when creating the admin user. Trigger schema init via HTTP after config-ini. Fixes #15828 --- install/webtrees-install.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/install/webtrees-install.sh b/install/webtrees-install.sh index c2be2e79e..69b735e46 100644 --- a/install/webtrees-install.sh +++ b/install/webtrees-install.sh @@ -47,6 +47,8 @@ msg_ok "Configured Caddy" msg_info "Automating Webtrees Setup" cd /opt/webtrees +mkdir -p /opt/webtrees/data +chown -R www-data:www-data /opt/webtrees/data WT_ADMIN_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c15) $STD sudo -u www-data php /opt/webtrees/index.php config-ini \ --dbhost=127.0.0.1 \ @@ -56,6 +58,15 @@ $STD sudo -u www-data php /opt/webtrees/index.php config-ini \ --dbname=webtrees \ --tblpfx=wt_ \ --base-url="http://${LOCAL_IP}" +msg_info "Initializing Webtrees database schema" +for i in {1..15}; do + if curl -sf "http://127.0.0.1/" >/dev/null 2>&1; then + break + fi + sleep 2 +done +$STD mariadb -u webtrees -p"${MARIADB_DB_PASS}" -h 127.0.0.1 webtrees -e "SHOW TABLES LIKE 'wt_user';" | grep -q wt_user +msg_ok "Initialized Webtrees database schema" $STD sudo -u www-data php /opt/webtrees/index.php user Admin \ --create \ --real-name="Administrator" \