From 92e37a3d77b3c93970c13b0bf42d5de35ab498ee Mon Sep 17 00:00:00 2001
From: David Beniamine <david.beniamine@tetras-libre.fr>
Date: Mon, 22 Jul 2019 12:04:11 +0200
Subject: [PATCH] Update nextcloud 16

---
 etc/apache2/sites-available/nextcloud.conf | 41 +++-------------------
 etc/php/{7.0 => 7.3}/apache2/php.ini       |  0
 installBase.sh                             |  1 -
 installNextcloud.env                       |  2 +-
 installNextcloud.sh                        |  1 -
 5 files changed, 5 insertions(+), 40 deletions(-)
 rename etc/php/{7.0 => 7.3}/apache2/php.ini (100%)

diff --git a/etc/apache2/sites-available/nextcloud.conf b/etc/apache2/sites-available/nextcloud.conf
index a0efa6f..67f00f6 100644
--- a/etc/apache2/sites-available/nextcloud.conf
+++ b/etc/apache2/sites-available/nextcloud.conf
@@ -7,7 +7,8 @@
     Redirect 301 /.well-known/caldav  /remote.php/caldav
     
     <Directory "/var/www/nextcloud/">
-        Options +FollowSymLinks
+        Require all granted
+        Options FollowSymLinks Multiviews
         AllowOverride All
     </Directory>
     
@@ -15,6 +16,8 @@
           Dav off
     </IfModule>
     
+    SetENv HOME /var/www/nextcloud
+    SetENv HTTP_HOME /var/www/nextcloud
     <Directory "/var/www/nextcloud/data/">
      # just in case if .htaccess gets disabled
        Require all denied
@@ -25,42 +28,6 @@
     # Fix Poxy vulnerability
     # https://httpoxy.org/#fix-nowEquestHeader unset Proxy early
     RequestHeader unset Proxy early
-
-	<Directory "/">
-	    #
-	    # Possible values for the Options directive are "None", "All",
-	    # or any combination of:
-	    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
-	    #
-	    # Note that "MultiViews" must be named *explicitly* --- "Options All"
-	    # doesn't give it to you.
-	    #
-	    # The Options directive is both complicated and important.  Please see
-	    # http://httpd.apache.org/docs/2.2/mod/core.html#options
-	    # for more information.
-	    #
-	    Options Indexes FollowSymLinks
-
-	    #
-	    # AllowOverride controls what directives may be placed in .htaccess files.
-	    # It can be "All", "None", or any combination of the keywords:
-	    #   Options FileInfo AuthConfig Limit
-	    #
-	    AllowOverride All
-
-	    #
-	    # Controls who can get stuff from this server.
-	    #
-        Require all granted
-	    ErrorDocument 404 /erreur_404.php
-
-        # Compress output via deflate for recente browsers
-        SetOutputFilter DEFLATE
-        BrowserMatch ^Mozilla/4 gzip-only-text/html
-        BrowserMatch ^Mozilla/4\.0[678] no-gzip
-        BrowserMatch \bMSIE !no-gzip !gzip-only-text/htm
-	</Directory>
-
 	ErrorLog ${APACHE_LOG_DIR}/nextcloud.error.log
 
 	# Possible values include: debug, info, notice, warn, error, crit,
diff --git a/etc/php/7.0/apache2/php.ini b/etc/php/7.3/apache2/php.ini
similarity index 100%
rename from etc/php/7.0/apache2/php.ini
rename to etc/php/7.3/apache2/php.ini
diff --git a/installBase.sh b/installBase.sh
index f6abe92..1bf49b0 100644
--- a/installBase.sh
+++ b/installBase.sh
@@ -68,7 +68,6 @@ DEBIAN_FRONTEND='noninteractive' apt-get -qq install \
     php-curl \
     php-gd \
     php-intl \
-    php-mcrypt \
     php-mysql \
     postfix \
     rkhunter \
diff --git a/installNextcloud.env b/installNextcloud.env
index 65319cf..9b8ebb8 100644
--- a/installNextcloud.env
+++ b/installNextcloud.env
@@ -3,7 +3,7 @@
 # wget configuration
 NEXTCLOUD_DIRECTORY_SOURCES=/root/NextcloudSources/
 NEXTCLOUD_WGET_INPUT=nextcloudSource.txt
-NEXTCLOUD_VERSION="latest-14"
+NEXTCLOUD_VERSION="latest-16"
 NEXTCLOUD_PACKAGE="$NEXTCLOUD_VERSION.tar.bz2"
 
 # extract configuration
diff --git a/installNextcloud.sh b/installNextcloud.sh
index dc6ac8b..6fcfbf7 100644
--- a/installNextcloud.sh
+++ b/installNextcloud.sh
@@ -51,7 +51,6 @@ DEBIAN_FRONTEND='noninteractive' apt-get update \
     php-imagick \
     php-json \
     php-mbstring \
-    php-mcrypt \
     php-mysql \
     php-xml \
     php-zip \
-- 
GitLab