From dabb32845d07a100474ffd926470e9e076032084 Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Wed, 14 Apr 2021 14:54:05 +0200 Subject: [PATCH] CMS:Nextcloud fixes related to #15 --- CMS/nextcloud/Nginx-unconfigured | 21 ++++++++++++++++----- CMS/nextcloud/nextcloud-init.sh | 17 ++++++++++++++++- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/CMS/nextcloud/Nginx-unconfigured b/CMS/nextcloud/Nginx-unconfigured index 273d74d..d98802e 100644 --- a/CMS/nextcloud/Nginx-unconfigured +++ b/CMS/nextcloud/Nginx-unconfigured @@ -28,13 +28,14 @@ location = /robots.txt { access_log off; } -location = /.well-known/carddav { - return 301 $scheme://$host:$server_port/remote.php/dav; -} -location = /.well-known/caldav { - return 301 $scheme://$host:$server_port/remote.php/dav; +location ^~ /.well-known { + location = /.well-known/carddav { return 301 /remote.php/dav/; } + location = /.well-known/caldav { return 301 /remote.php/dav/; } + location ^~ /.well-known { return 301 /index.php$uri; } + try_files $uri $uri/ =404; } + location / { rewrite ^ /index.php; } @@ -80,4 +81,14 @@ location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ { try_files $uri /index.php$request_uri; access_log off; } + +## Reverse proxy Config for 'Files High Performance Back-end' +#FHPBlocation ^~ /push/ { +#FHPB proxy_http_version 1.1; +#FHPB proxy_set_header Upgrade $http_upgrade; +#FHPB proxy_set_header Connection "Upgrade"; +#FHPB proxy_set_header Host $host; +#FHPB proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +#FHPB} + #endConf \ No newline at end of file diff --git a/CMS/nextcloud/nextcloud-init.sh b/CMS/nextcloud/nextcloud-init.sh index d74e693..10e5618 100644 --- a/CMS/nextcloud/nextcloud-init.sh +++ b/CMS/nextcloud/nextcloud-init.sh @@ -4,6 +4,7 @@ sudo -u SITEname php /var/www/DOMAINname/html/occ app:disable firstrunwizard sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set default_language --value=nl sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set default_locale --value=nl +sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set default_phone_region --value=nl sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set skeletondirectory --value= sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set memcache.local --value='\OC\Memcache\APCu' @@ -12,8 +13,22 @@ if [ "$(systemctl is-active redis-server)" = "active" ] || [ "$(systemctl is-ac sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set memcache.locking --value='\OC\Memcache\Redis' sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set redis host --value=localhost sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set redis port --value=6379 + while true; do + read -p "Prepair for Files High Performance Back-end -> yes/no?" yn + case $yn in + [Nn]* ) + break;; + [Yy]* ) + sudo -u SITEname php /var/www/DOMAINname/html/occ app:install notify_push + sed -i --follow-symlinks 's/#FHPB//g' /etc/nginx/sites-enabled/SITEname + systemctl nginx reload + echo -e "\e[96m Run: sudo -u SITEname php /var/www/DOMAINname/html/occ notify_push:setup\e[39m" + break;; + * )echo "Choose yes or no.";; + esac + done else - echo "Redis running on this system" + echo "Redis is not running on this system" fi echo "*/5 * * * * SITEname php -f /var/www/DOMAINname/html/cron.php > /dev/null 2>&1" >> /etc/crontab