mediawiki/scripts/db-setup.sh

49 lines
1.2 KiB
Bash
Raw Normal View History

2021-01-12 08:49:20 +01:00
#!/bin/bash
set -euo pipefail
cd /var/www/html/
2021-01-12 12:37:43 +01:00
# The install script doesn't want there to be an existing LocalSettings.php
echo Deleting LocalSettings.php
2021-01-12 08:49:20 +01:00
echo
rm /var/www/html/LocalSettings.php
echo Install.php
echo
2021-01-12 12:37:43 +01:00
php maintenance/install.php \
--dbtype "${WG_DB_TYPE}" \
--dbname "${WG_DB_NAME}" \
--dbuser "${WG_DB_USER}" \
--dbport "${WG_DB_PORT}" \
--dbpass "${WG_DB_PASSWORD}" \
--scriptpath "/var/www/html/" \
--dbserver "${WG_DB_SERVER}" \
--pass "${MEDIAWIKI_ADMIN_PASS}" \
--dbpath "${WG_DATABASE_DIR}" \
"${WG_SITENAME}" "${MEDIAWIKI_ADMIN_USER}"
2021-01-12 08:49:20 +01:00
# Now, we're going to replace the LocalSettings.php file that install.php just generated with ours
# This way, update.php will work.
rm /var/www/html/LocalSettings.php
ln -s /var/www/conf/LocalSettings.php /var/www/html/LocalSettings.php
2021-01-12 12:37:43 +01:00
echo LocalSettings.php linked
2021-01-12 08:49:20 +01:00
echo
echo Creating localstore
echo
# Copy the htaccess file
mkdir -p /var/www/localstore/images
mkdir -p /var/www/localstore/smwconfig
2021-01-12 08:49:20 +01:00
cp /var/www/html/images/* /var/www/localstore/images
chown -R www-data:www-data /var/www/localstore
# Run update.php, to set up all of the extensions
echo update.php
echo
php maintenance/update.php --quick