diff --git a/Vagrant/bootstrap.sh b/Vagrant/bootstrap.sh index cd58500..0b9e1b0 100755 --- a/Vagrant/bootstrap.sh +++ b/Vagrant/bootstrap.sh @@ -1,151 +1,152 @@ #!/bin/sh # Vagrant provision: bootstrap # Exit immediately if a command exits with a non-zero status set -e PORT_APACHE=8070 PORT_NGINX=8071 DOMAIN=localhost WELCOME_APACHE=http://"$DOMAIN":"$PORT_APACHE" WELCOME_NGINX=http://"$DOMAIN":"$PORT_NGINX" PROJECT=/vagrant WWW="$PROJECT" DB_NAME=ldto DB_PREFIX=ldto_ SUCKLESS_PHP="$PROJECT"/includes/suckless-php SUCKLESS_PHP_REPO=https://github.com/valerio-bozzolan/suckless-php.git # Very scaring DB_USER=ldto DB_PASS=ldto # prevent interaction during phpmyadmin installation echo "phpmyadmin phpmyadmin/dbconfig-install boolean true" | debconf-set-selections echo "phpmyadmin phpmyadmin/app-password-confirm password $DB_PASS" | debconf-set-selections echo "phpmyadmin phpmyadmin/mysql/admin-pass password $DB_PASS" | debconf-set-selections echo "phpmyadmin phpmyadmin/mysql/app-pass password $DB_PASS" | debconf-set-selections echo "phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2" | debconf-set-selections # avoid warnings in apt export DEBIAN_FRONTEND=noninteractive apt-get update apt-get install --yes mariadb-server \ php \ php-mysql \ php-mbstring \ php-xml \ apache2 \ libapache2-mod-php \ gettext \ libmarkdown-php \ libjs-jquery \ libjs-leaflet \ git \ phpmyadmin echo "stop apache" systemctl stop apache2 if [ ! -e "$SUCKLESS_PHP" ]; then git clone "$SUCKLESS_PHP_REPO" "$SUCKLESS_PHP" else git -C "$SUCKLESS_PHP" pull fi echo "create a file with database credentials" cat > "$WWW/load.php" <. // Database info $database = 'insert-here-database-name'; $username = 'insert-here-database-username'; $password = 'insert-here-database-password'; $location = 'localhost'; +$charset = 'utf8mb4'; // Database table prefix (if any) // E.g. 'asd_' // Keep in mind that "tagliatella" doesn't support this, so it's probably better to leave an empty string here. $prefix = ''; // See also include/class-Talk.php for track\area names! // Enable extra verbose framework errors define('DEBUG', true); // Absolute pathname to the folder of the project // NO TRAILING SLASH define('ABSPATH', __DIR__ ); // Request URI pathname of the complete website // NO TRAILING SLASH // E.g. '/linux-day' define('ROOT', ''); // used for events define('DB_TIMEZONE', 'Europe/Rome'); // contact informations define('CONTACT_EMAIL', 'asd@asd.asd' ); define('CONTACT_PHONE', '555-55-55-55' ); define('CONTACT_PHONE_PREFIX', '+39' ); // which file should be loaded after boz-php define('REQUIRE_LOAD_POST', ABSPATH . '/includes/load-post.php' ); // load suckless-php require 'includes/suckless-php/load.php';