diff -Nur --no-dereference smeserver-nextcloud-1.2.0.old/root/etc/e-smith/events/actions/nextcloud-conf smeserver-nextcloud-1.2.0/root/etc/e-smith/events/actions/nextcloud-conf --- smeserver-nextcloud-1.2.0.old/root/etc/e-smith/events/actions/nextcloud-conf 2021-06-06 02:51:53.245000000 -0400 +++ smeserver-nextcloud-1.2.0/root/etc/e-smith/events/actions/nextcloud-conf 2021-06-06 02:57:14.268000000 -0400 @@ -8,15 +8,6 @@ TERM=dumb /usr/bin/OCC $params } -# check if inodb is enabled for up to SME9, if not do it. -innodb=$(/sbin/e-smith/db configuration getprop mysqld InnoDB || echo "disabled") -if [[ "$innodb" != "enabled" ]]; then - /sbin/e-smith/db configuration setprop mysqld InnoDB enabled - /sbin/e-smith/expand-template /etc/my.cnf - sv t /service/mariadb - sleep 8 -fi - # important configuration variables password=`/sbin/e-smith/db configuration getprop nextcloud DbPassword || echo "missing"` dbname=`/sbin/e-smith/db configuration getprop nextcloud DbName || echo "nextcloud"` diff -Nur --no-dereference smeserver-nextcloud-1.2.0.old/root/etc/e-smith/events/actions/nextcloud-occ-conf smeserver-nextcloud-1.2.0/root/etc/e-smith/events/actions/nextcloud-occ-conf --- smeserver-nextcloud-1.2.0.old/root/etc/e-smith/events/actions/nextcloud-occ-conf 2021-06-06 02:51:53.248000000 -0400 +++ smeserver-nextcloud-1.2.0/root/etc/e-smith/events/actions/nextcloud-occ-conf 2021-06-06 03:02:26.666000000 -0400 @@ -104,11 +104,12 @@ OCC "config:system:set trusted_domains $i --value=".$_; $i++; } -my $CloudDomain = $cdb->get_prop('nextcloud','TrustedDomains') || ''; +my $CloudDomain = $cdb->get_prop('nextcloud','CloudDomain') || ''; OCC "config:system:set trusted_domains 99 --value=$CloudDomain" unless $CloudDomain eq ""; -# enable files_external +# enable files_external and allow auto refresh OCC "app:enable files_external"; +OCC "config:system:set filesystem_check_changes --value=1"; # set memcache OCC "config:system:set memcache.local --value='\\OC\\Memcache\\APCu'"; diff -Nur --no-dereference smeserver-nextcloud-1.2.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98nextcloud smeserver-nextcloud-1.2.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98nextcloud --- smeserver-nextcloud-1.2.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98nextcloud 2021-06-06 02:51:53.245000000 -0400 +++ smeserver-nextcloud-1.2.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98nextcloud 2021-06-06 04:38:05.269000000 -0400 @@ -2,14 +2,9 @@ my $access = $nextcloud{'access'} || 'private'; my $allow = ($access eq 'public')?'all':"$localAccess $externalSSLAccess"; my $authtype = $nextcloud{'Authentication'} || 'none'; -my $CloudDomain = $nextcloud{'CloudDomain'} || 'none'; my $alias = (($nextcloud{'AliasOnPrimary'} || 'enabled') eq 'enabled') ? 'Alias /nextcloud /usr/share/nextcloud' : ''; -$alias .= "\nAlias /.well-known/acme-challenge/ /home/e-smith/files/ibays/Primary/html/.well-known/acme-challenge/" unless $CloudDomain eq 'none'; - -my $redirectif = ""; -$redirectif = 'RewriteCond "%\{HTTP_HOST\}" "!^'. (quotemeta $CloudDomain) .'" [NC]' unless $CloudDomain eq 'none'; my $maxupload = $nextcloud{'MaxUploadSize'} || '1024'; my $maxpost = $maxupload+1; @@ -93,11 +88,6 @@ $config -$redirectif -RewriteRule /.well-known/carddav/(.+) /nextcloud/remote.php/dav/\$1 [R=301,L] -$redirectif -RewriteRule /.well-known/caldav/(.+) /nextcloud/remote.php/dav/\$1 [R=301,L] - END } else{ diff -Nur --no-dereference smeserver-nextcloud-1.2.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/28nextcloud smeserver-nextcloud-1.2.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/28nextcloud --- smeserver-nextcloud-1.2.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/28nextcloud 2018-03-30 14:36:14.000000000 -0400 +++ smeserver-nextcloud-1.2.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/28nextcloud 2021-06-06 04:38:05.025000000 -0400 @@ -1,14 +1,37 @@ # -# 40nextcloud +# 28nextcloud # - +LogLevel alert rewrite:trace6 { + my $CloudDomain = $nextcloud{'CloudDomain'} || 'none'; $OUT = ''; if ((${'nextcloud'}{'status'} || 'disabled') eq 'enabled' ){ if (($port eq "80") && ($haveSSL eq 'yes')){ $OUT .= " RewriteRule ^/nextcloud(/.*|\$) https://%{HTTP_HOST}/nextcloud\$1 [L,R=301]\n"; } + elsif ( $CloudDomain eq "none" or $CloudDomain ne $virtualHost ) + { + $OUT .= " + RewriteEngine on + RewriteRule ^/\\.well-known/host-meta /nextcloud/public.php?service=host-meta [QSA,L] + RewriteRule ^/\\.well-known/host-meta\.json /nextcloud/public.php?service=host-meta-json [QSA,L] + RewriteRule ^/\\.well-known/webfinger /nextcloud/public.php?service=webfinger [QSA,L] + RewriteRule ^/\\.well-known/carddav /nextcloud/remote.php/dav [R=301,L] + RewriteRule ^/\\.well-known/caldav /nextcloud/remote.php/dav [R=301,L] + RewriteRule ^/remote.php/dav /nextcloud/remote.php/dav [R=301,L]\n"; + } + elsif ( $CloudDomain eq $virtualHost ) + { + $OUT .= " + RewriteEngine on + RewriteRule ^/\\.well-known/host-meta /public.php?service=host-meta [QSA,L] + RewriteRule ^/\\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L] + RewriteRule ^/\\.well-known/webfinger /public.php?service=webfinger [QSA,L] + RewriteRule ^/\\.well-known/carddav /remote.php/dav [R=301,L] + RewriteRule ^/\\.well-known/caldav /remote.php/dav [R=301,L]\n"; + } + } }