diff -Nur smeserver-nextcloud-1.1.0.old/root/etc/e-smith/events/actions/nextcloud-occ-conf smeserver-nextcloud-1.1.0/root/etc/e-smith/events/actions/nextcloud-occ-conf --- smeserver-nextcloud-1.1.0.old/root/etc/e-smith/events/actions/nextcloud-occ-conf 2020-11-08 11:52:18.783000000 -0500 +++ smeserver-nextcloud-1.1.0/root/etc/e-smith/events/actions/nextcloud-occ-conf 2020-11-08 14:03:55.927000000 -0500 @@ -103,6 +103,8 @@ OCC "config:system:set trusted_domains $i --value=".$_; $i++; } +my $CloudDomain = $cdb->get_prop('nextcloud','TrustedDomains') || ''; +OCC "config:system:set trusted_domains 99 --value=$CloudDomain" unless $CloudDomain eq ""; # enable files_external OCC "app:enable files_external"; diff -Nur smeserver-nextcloud-1.1.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98nextcloud smeserver-nextcloud-1.1.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98nextcloud --- smeserver-nextcloud-1.1.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98nextcloud 2020-11-08 11:52:18.812000000 -0500 +++ smeserver-nextcloud-1.1.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98nextcloud 2020-11-08 14:00:15.267000000 -0500 @@ -2,9 +2,14 @@ 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; @@ -88,9 +93,10 @@ $config -Redirect 301 /.well-known/carddav /nextcloud/remote.php/dav -Redirect 301 /.well-known/caldav /nextcloud/remote.php/dav - +$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 }