# This script will install a new BookStack instance on a fresh Ubuntu 16.04 server.
# This script is experimental and does not ensure any security.
+echo "THIS SCRIPT IS NO LONGER SUPPORTED OR MAINTAINED"
+echo "IT MAY NOT WORK WITH CURRENT VERSIONS OF BOOKSTACK"
+echo ""
+
echo ""
echo -n "Enter the domain you want to host BookStack and press [ENTER]: "
read DOMAIN
exit 1
fi
-# Install BookStack composer dependancies
-php composer.phar install
+# Install BookStack composer dependencies
+php composer.phar install --no-dev
# Copy and update BookStack environment variables
cp .env.example .env
+sed -i.bak "s@APP_URL=.*\$@APP_URL=http://$DOMAIN@" .env
sed -i.bak 's/DB_DATABASE=.*$/DB_DATABASE=bookstack/' .env
sed -i.bak 's/DB_USERNAME=.*$/DB_USERNAME=bookstack/' .env
sed -i.bak "s/DB_PASSWORD=.*\$/DB_PASSWORD=$DB_PASS/" .env
+
# Generate the application key
php artisan key:generate --no-interaction --force
# Migrate the databases
chown www-data:www-data -R bootstrap/cache public/uploads storage && chmod -R 755 bootstrap/cache public/uploads storage
# Add nginx configuration
-curl -s https://raw.githubusercontent.com/BookStackApp/devops/master/config/nginx > /etc/nginx/sites-available/bookstack
+curl -s https://raw.githubusercontent.com/BookStackApp/devops/main/config/nginx/ubuntu-1604-install-config > /etc/nginx/sites-available/bookstack
sed -i.bak "s/bookstack.dev/$DOMAIN/" /etc/nginx/sites-available/bookstack
ln -s /etc/nginx/sites-available/bookstack /etc/nginx/sites-enabled/bookstack