X-Git-Url: http://source.bookstackapp.com/devops/blobdiff_plain/f9816e7bd7a52c56c980c9a39fdb1436efdda154..HEAD:/scripts/installation-ubuntu-16.04.sh diff --git a/scripts/installation-ubuntu-16.04.sh b/scripts/installation-ubuntu-16.04.sh index 403bc43..6e5d06b 100644 --- a/scripts/installation-ubuntu-16.04.sh +++ b/scripts/installation-ubuntu-16.04.sh @@ -2,16 +2,22 @@ # 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 -n "Enter your the domain you want to host BookStack and press [ENTER]: " + +echo "" +echo -n "Enter the domain you want to host BookStack and press [ENTER]: " read DOMAIN myip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') export DEBIAN_FRONTEND=noninteractive apt update -apt install -y git nginx curl php7.0 php7.0-curl php7.0-mbstring php7.0-ldap php7.0-mcrypt \ -php7.0-tidy php7.0-xml php7.0-zip php7.0-gd php7.0-mysql mysql-server-5.7 mcrypt +apt install -y software-properties-common python-software-properties +add-apt-repository -yu ppa:ondrej/php +apt install -y git nginx curl php7.4 php7.4-fpm php7.4-curl php7.4-mbstring php7.4-ldap \ +php7.4-tidy php7.4-xml php7.4-zip php7.4-gd php7.4-mysql mysql-server-5.7 # Set up database DB_PASS="$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13)" @@ -27,7 +33,7 @@ cd $BOOKSTACK_DIR # Install composer EXPECTED_SIGNATURE=$(wget https://composer.github.io/installer.sig -O - -q) -php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" +curl -s https://getcomposer.org/installer > composer-setup.php ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');") if [ "$EXPECTED_SIGNATURE" = "$ACTUAL_SIGNATURE" ] @@ -41,16 +47,18 @@ else 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 +php artisan key:generate --no-interaction --force # Migrate the databases php artisan migrate --no-interaction --force @@ -58,7 +66,7 @@ php artisan migrate --no-interaction --force chown www-data:www-data -R bootstrap/cache public/uploads storage && chmod -R 755 bootstrap/cache public/uploads storage # Add nginx configuration -curl 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