From 68fe9ea9d18f3408e10d4efcfbe953d96d2938d3 Mon Sep 17 00:00:00 2001 From: "rieger::CLOUD" Date: Mon, 23 Apr 2018 11:09:52 +0200 Subject: [PATCH 1/2] Nextcloud silent installation You will be asked for Administrator name and password Nextcloud will be installed silently using these credentials --- install-nextcloud.sh | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/install-nextcloud.sh b/install-nextcloud.sh index 6194eb7..b19622c 100644 --- a/install-nextcloud.sh +++ b/install-nextcloud.sh @@ -1,8 +1,9 @@ ####################################################### # Carsten Rieger IT-Services # INSTALL-NEXTCLOUD.SH -# Version 1.2 -# April 21st, 2018 +# Version 1.3 +# April 23rd, 2018 +# version 1.3: Nextcloud will silently be installed # version 1.2: changed the process of creating the NC # db/user, added mysql_secure_installation # version 1.1: added functions @@ -423,12 +424,34 @@ rm latest.tar.bz2 update_and_clean restart_all_services clear -echo "###############################################################################" -echo " Nextcloud is up and running. Please open your browser and call:" -echo "###############################################################################" +echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" +echo "The Nextcloud-Administrator and Password - Attention: password is case-sensitive:" +echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "" -echo " https://$(hostname)" +echo "Your Nextcloud-DB user: "$NEXTCLOUDDBUSER echo "" -echo " and confirm the upcoming ssl warning caused by the self-signed certificates. " -echo "###############################################################################" +echo "Your Nextcloud-DB password: "$NEXTCLOUDDBPASSWORD +echo "" +read -p "Enter your Nextcloud Administrator: " NEXTCLOUDADMINUSER +echo "Your Nextcloud Administrator: "$NEXTCLOUDADMINUSER +echo "" +read -p "Enter your Nextcloud Administrator password: " NEXTCLOUDADMINUSERPASSWORD +echo "Your Nextcloud Administrator password: "$NEXTCLOUDADMINUSERPASSWORD +echo "" +echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" +echo "" +echo " NEXTCLOUD will now be installed silently - be patient ..." +sudo -u www-data php /var/www/nextcloud/occ maintenance:install --database "mysql" --database-name "nextcloud" --database-user "$NEXTCLOUDDBUSER" --database-pass "$NEXTCLOUDDBPASSWORD" --admin-user "$NEXTCLOUDADMINUSER" --admin-pass "$NEXTCLOUDADMINUSERPASSWORD" --data-dir "/var/nc_data" +declare -l YOURSERVERNAME +###read the current hostname +YOURSERVERNAME=$(hostname) +sudo -u www-data cp /var/www/nextcloud/config/config.php /var/www/nextcloud/config/config.php.bak +sudo -u www-data php /var/www/nextcloud/occ config:system:set trusted_domains 0 --value=$YOURSERVERNAME +sudo -u www-data sed -in 's/http:\/\/localhost/https:\/\/'$YOURSERVERNAME'/' /var/www/nextcloud/config/config.php +echo "" +echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" +echo "" +echo " Open your browser and call: https://$YOURSERVERNAME" +echo"" +echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" exit 0 From 88cb9bac199aa160fe0a0b21723f8dc973308433 Mon Sep 17 00:00:00 2001 From: "rieger::CLOUD" Date: Mon, 23 Apr 2018 11:13:42 +0200 Subject: [PATCH 2/2] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8a954ed..ee2ec56 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ The initial script (install-nextcloud.sh) will install your self hosted Nextclou OpenSSL 1.1.0 h PHP 7.2.4 Redis-Server + self signed certificates or Let's Encrypt SSL The only precondition for this script is to use Ubuntu 16.04.4 LTS 64Bit as your server OS.