Skip to content

Commit 4da4a47

Browse files
authored
Webtrees: use PHP CLI for initial setup instead of curl to setup wizard (#14818)
1 parent cf3d8f9 commit 4da4a47

1 file changed

Lines changed: 14 additions & 16 deletions

File tree

install/webtrees-install.sh

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,21 @@ systemctl enable -q --now php${PHP_VER}-fpm
4747
systemctl restart caddy
4848

4949
msg_info "Automating Webtrees Setup"
50-
sleep 5
5150
WT_ADMIN_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c15)
52-
curl -sS -X POST "http://127.0.0.1/" \
53-
-d "step=6" \
54-
--data-urlencode "baseurl=http://${LOCAL_IP}" \
55-
-d "lang=en-US" \
56-
-d "dbtype=mysql" \
57-
-d "dbhost=127.0.0.1" \
58-
-d "dbport=3306" \
59-
-d "dbuser=webtrees" \
60-
--data-urlencode "dbpass=${MARIADB_DB_PASS}" \
61-
-d "dbname=webtrees" \
62-
-d "tblpfx=wt_" \
63-
-d "wtname=Administrator" \
64-
-d "wtuser=Admin" \
65-
--data-urlencode "wtpass=${WT_ADMIN_PASS}" \
66-
-d "wtemail=admin@example.com" >/dev/null
51+
$STD sudo -u www-data php /opt/webtrees/index.php config-ini \
52+
--dbhost=127.0.0.1 \
53+
--dbport=3306 \
54+
--dbuser=webtrees \
55+
--dbpass="${MARIADB_DB_PASS}" \
56+
--dbname=webtrees \
57+
--tblpfx=wt_ \
58+
--base-url="http://${LOCAL_IP}"
59+
$STD sudo -u www-data php /opt/webtrees/index.php user Admin \
60+
--create \
61+
--real-name="Administrator" \
62+
--email="admin@example.com" \
63+
--password="${WT_ADMIN_PASS}"
64+
$STD sudo -u www-data php /opt/webtrees/index.php user-setting Admin canadmin 1
6765

6866
cat <<EOF >>~/webtrees.creds
6967

0 commit comments

Comments
 (0)