# Create the required user database, user and permissions in the database
mysql -u root --execute="CREATE DATABASE bookstack;"
- mysql -u root --execute="CREATE USER 'bookstack'@'localhost' IDENTIFIED WITH mysql_native_password BY '$DB_PASS';"
+ mysql -u root --execute="CREATE USER 'bookstack'@'localhost' IDENTIFIED BY '$DB_PASS';"
mysql -u root --execute="GRANT ALL ON bookstack.* TO 'bookstack'@'localhost';FLUSH PRIVILEGES;"
}
git clone https://github.com/BookStackApp/BookStack.git --branch release --single-branch bookstack
}
-# Install composer
-function run_install_composer() {
- EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
-
- if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
- then
- >&2 echo 'ERROR: Invalid composer installer checksum'
- rm composer-setup.php
- exit 1
- fi
-
- php composer-setup.php --quiet
- rm composer-setup.php
-
- # Move composer to global installation
- mv composer.phar /usr/local/bin/composer
-}
-
# Install BookStack composer dependencies
-function run_install_bookstack_composer_deps() {
+function run_download_bookstack_vendor_files() {
cd "$BOOKSTACK_DIR" || exit
- export COMPOSER_ALLOW_SUPERUSER=1
- php /usr/local/bin/composer install --no-dev --no-plugins
+ php bookstack-system-cli download-vendor
}
# Copy and update BookStack environment variables
info_msg ""
sleep 1
-info_msg "[1/9] Installing required system packages... (This may take several minutes)"
+info_msg "[1/8] Installing required system packages... (This may take several minutes)"
run_package_installs >> "$LOGPATH" 2>&1
-info_msg "[2/9] Preparing MySQL database..."
+info_msg "[2/8] Preparing MySQL database..."
run_database_setup >> "$LOGPATH" 2>&1
-info_msg "[3/9] Downloading BookStack to ${BOOKSTACK_DIR}..."
+info_msg "[3/8] Downloading BookStack to ${BOOKSTACK_DIR}..."
run_bookstack_download >> "$LOGPATH" 2>&1
-info_msg "[4/9] Installing Composer (PHP dependency manager)..."
-run_install_composer >> "$LOGPATH" 2>&1
-
-info_msg "[5/9] Installing PHP dependencies using composer..."
-run_install_bookstack_composer_deps >> "$LOGPATH" 2>&1
+info_msg "[4/8] Downloading PHP dependency files..."
+run_download_bookstack_vendor_files >> "$LOGPATH" 2>&1
-info_msg "[6/9] Creating and populating BookStack .env file..."
+info_msg "[5/8] Creating and populating BookStack .env file..."
run_update_bookstack_env >> "$LOGPATH" 2>&1
-info_msg "[7/9] Running initial BookStack database migrations..."
+info_msg "[6/8] Running initial BookStack database migrations..."
run_bookstack_database_migrations >> "$LOGPATH" 2>&1
-info_msg "[8/9] Setting BookStack file & folder permissions..."
+info_msg "[7/8] Setting BookStack file & folder permissions..."
run_set_application_file_permissions >> "$LOGPATH" 2>&1
-info_msg "[9/9] Configuring apache server..."
+info_msg "[8/8] Configuring apache server..."
run_configure_apache >> "$LOGPATH" 2>&1
info_msg "----------------------------------------------------------------"