From 2cd409afe6174dec0d950b2d7c23a963ba5c6e59 Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Tue, 4 Jul 2017 03:37:56 +0200 Subject: [PATCH 1/2] test --- wordpress_install.sh | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/wordpress_install.sh b/wordpress_install.sh index 966fa0a..a789ec8 100644 --- a/wordpress_install.sh +++ b/wordpress_install.sh @@ -247,13 +247,13 @@ cd "$WPATH" check_command wp core download --allow-root --force --debug --path="$WPATH" # Populate DB -mysql -uroot -p"$MARIADB_PASS" <> "$MYCNF" # Install Wordpress -check_command wp core install --allow-root --url="http://$ADDRESS/" --title=Wordpress --admin_user="$WPADMINUSER" --admin_password="$WPADMINPASS" --admin_email=no-reply@techandme.se --skip-email +check_command wp core install --allow-root --url=http://$ADDRESS/ --title=Wordpress --admin_user=$WPADMINUSER --admin_password=$WPADMINPASS --admin_email=no-reply@techandme.se --skip-email echo "WP PASS: $WPADMINPASS" > /var/adminpass.txt chown wordpress:wordpress /var/adminpass.txt # Create welcome post -check_command wget -q "$STATIC/welcome.txt" +check_command wget -q $STATIC/welcome.txt sed -i "s|wordpress_user_login|$WPADMINUSER|g" welcome.txt sed -i "s|wordpress_password_login|$WPADMINPASS|g" welcome.txt -wp post create ./welcome.txt --post_title='Tech and Me - Welcome' --post_status=publish --path="$WPATH" --allow-root +wp post create ./welcome.txt --post_title='Tech and Me - Welcome' --post_status=publish --path=$WPATH --allow-root rm -f welcome.txt wp post delete 1 --force --allow-root @@ -303,7 +303,7 @@ run_static_script wp-permissions # Hardening security # create .htaccess to protect uploads directory -cat > "$WPATH/wp-content/uploads/.htaccess" <<'EOL' +cat > $WPATH/wp-content/uploads/.htaccess <<'EOL' # Protect this file Order Deny,Allow @@ -334,10 +334,10 @@ sed -i "s|upload_max_filesize =.*|upload_max_filesize = 1000M|g" /etc/php/7.0/ap apt install figlet -y # Generate $SSL_CONF -if [ ! -f "$SSL_CONF" ]; +if [ ! -f $SSL_CONF ]; then - touch "$SSL_CONF" - cat << SSL_CREATE > "$SSL_CONF" + touch $SSL_CONF + cat << SSL_CREATE > $SSL_CONF Header add Strict-Transport-Security: "max-age=15768000;includeSubdomains" SSLEngine on @@ -348,15 +348,15 @@ if [ ! -f "$SSL_CONF" ]; # ServerAlias www.example.com ### SETTINGS ### - DocumentRoot "$WPATH" - + DocumentRoot $WPATH + Options Indexes FollowSymLinks MultiViews AllowOverride All Require all granted - SetEnv HOME "$WPATH" - SetEnv HTTP_HOME "$WPATH" + SetEnv HOME $WPATH + SetEnv HTTP_HOME $WPATH ### LOCATION OF CERT FILES ### SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem @@ -374,10 +374,10 @@ sleep 3 fi # Generate $HTTP_CONF -if [ ! -f "$HTTP_CONF" ]; +if [ ! -f $HTTP_CONF ]; then - touch "$HTTP_CONF" - cat << HTTP_CREATE > "$HTTP_CONF" + touch $HTTP_CONF + cat << HTTP_CREATE > $HTTP_CONF @@ -387,8 +387,8 @@ if [ ! -f "$HTTP_CONF" ]; # ServerAlias www.example.com ### SETTINGS ### - DocumentRoot "$WPATH" - + DocumentRoot $WPATH + Options Indexes FollowSymLinks MultiViews AllowOverride All Require all granted From bec8a37c92eb47fdbb9e750f5370a103ca449c69 Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Tue, 4 Jul 2017 03:41:13 +0200 Subject: [PATCH 2/2] travis --- wordpress_install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wordpress_install.sh b/wordpress_install.sh index a789ec8..326ec28 100644 --- a/wordpress_install.sh +++ b/wordpress_install.sh @@ -247,13 +247,13 @@ cd "$WPATH" check_command wp core download --allow-root --force --debug --path="$WPATH" # Populate DB -mysql -uroot -p$MARIADB_PASS <> "$MYCNF" # Install Wordpress -check_command wp core install --allow-root --url=http://$ADDRESS/ --title=Wordpress --admin_user=$WPADMINUSER --admin_password=$WPADMINPASS --admin_email=no-reply@techandme.se --skip-email +check_command wp core install --allow-root --url=http://"$ADDRESS"/ --title=Wordpress --admin_user=$WPADMINUSER --admin_password="$WPADMINPASS" --admin_email=no-reply@techandme.se --skip-email echo "WP PASS: $WPADMINPASS" > /var/adminpass.txt chown wordpress:wordpress /var/adminpass.txt