From 83c41371f4fa9a401fb407cbb068b84c7099ed6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bonhomme?= Date: Fri, 21 Sep 2018 15:33:20 +0200 Subject: [PATCH] Updated Vagrant for Ubuntu Bionic. --- vagrant/README.rst | 4 ++-- vagrant/Vagrantfile | 2 +- vagrant/bootstrap.sh | 33 +++++++++++++++++++++++++++++---- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/vagrant/README.rst b/vagrant/README.rst index 272b2eb..7b88b8f 100644 --- a/vagrant/README.rst +++ b/vagrant/README.rst @@ -14,7 +14,7 @@ Installation of VirtualBox and Vagrant .. code-block:: bash - $ sudo apt-get install virtualbox vagrant + $ sudo apt install virtualbox vagrant Deployment of the back office @@ -30,7 +30,7 @@ MONARC will be automatically deployed in an Ubuntu Artful Server. $ vagrant up Once the VM will be configured by Vagrant, go to the address -http://127.0.0.1:5001. +http://127.0.0.1:5000. The username is *admin@admin.test* and the password is *admin*. diff --git a/vagrant/Vagrantfile b/vagrant/Vagrantfile index 3ec9eed..7da6b8c 100644 --- a/vagrant/Vagrantfile +++ b/vagrant/Vagrantfile @@ -10,7 +10,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # please see the online documentation at vagrantup.com. # Every Vagrant virtual environment requires a box to build off of. - config.vm.box = "fso/artful64" + config.vm.box = "ubuntu/bionic64" config.vm.provision :shell, path: "bootstrap.sh", args: "#{ENV['GITHUB_AUTH_TOKEN']}" # Disable automatic box update checking. If you disable this, then diff --git a/vagrant/bootstrap.sh b/vagrant/bootstrap.sh index 46c1682..18067aa 100644 --- a/vagrant/bootstrap.sh +++ b/vagrant/bootstrap.sh @@ -26,7 +26,7 @@ post_max_size=50M max_execution_time=100 max_input_time=223 memory_limit=512M -PHP_INI=/etc/php/7.1/apache2/php.ini +PHP_INI=/etc/php/7.2/apache2/php.ini export DEBIAN_FRONTEND=noninteractive export LANGUAGE=en_US.UTF-8 @@ -44,14 +44,39 @@ echo -e "\n--- Install base packages… ---\n" apt-get -y install vim zip unzip git gettext > /dev/null echo -e "\n--- Install MariaDB specific packages and settings… ---\n" -echo "mysql-server mysql-server/root_password password $DBPASSWORD_ADMIN" | debconf-set-selections -echo "mysql-server mysql-server/root_password_again password $DBPASSWORD_ADMIN" | debconf-set-selections +# echo "mysql-server mysql-server/root_password password $DBPASSWORD_ADMIN" | debconf-set-selections +# echo "mysql-server mysql-server/root_password_again password $DBPASSWORD_ADMIN" | debconf-set-selections apt-get -y install mariadb-server mariadb-client > /dev/null +# Secure the MariaDB installation (especially by setting a strong root password) systemctl restart mariadb.service > /dev/null sleep 5 +apt-get -y install expect > /dev/null +## do we need to spawn mysql_secure_install with sudo in future? +expect -f - <<-EOF + set timeout 10 + spawn mysql_secure_installation + expect "Enter current password for root (enter for none):" + send -- "\r" + expect "Set root password?" + send -- "y\r" + expect "New password:" + send -- "${DBPASSWORD_ADMIN}\r" + expect "Re-enter new password:" + send -- "${DBPASSWORD_ADMIN}\r" + expect "Remove anonymous users?" + send -- "y\r" + expect "Disallow root login remotely?" + send -- "y\r" + expect "Remove test database and access to it?" + send -- "y\r" + expect "Reload privilege tables now?" + send -- "y\r" + expect eof +EOF +sudo apt-get purge -y expect > /dev/null 2>&1 echo -e "\n--- Installing PHP-specific packages… ---\n" -apt-get -y install php apache2 libapache2-mod-php php-curl php-gd php-mcrypt php-mysql php-pear php-apcu php-xml php-mbstring php-intl php-imagick php-zip > /dev/null +apt-get -y install php apache2 libapache2-mod-php php-curl php-gd php-mysql php-pear php-apcu php-xml php-mbstring php-intl php-imagick php-zip > /dev/null echo -e "\n--- Configuring PHP ---\n" for key in upload_max_filesize post_max_size max_execution_time max_input_time memory_limit