From e58813ddebbcec6e8921c857e55f6d489a5577ef Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Fri, 17 Jul 2026 08:46:31 +0200 Subject: [PATCH] fix(webtrees): initialize database schema before admin user creation 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 c2be2e79e29..69b735e46ae 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" \