Browse Source

Make nextcloud server side encryption optional

Bob Mottram 6 years ago
parent
commit
9a72c76e23
1 changed files with 18 additions and 5 deletions
  1. 18
    5
      src/freedombone-app-nextcloud

+ 18
- 5
src/freedombone-app-nextcloud View File

40
 # Stable 13 branch
40
 # Stable 13 branch
41
 NEXTCLOUD_COMMIT='edd5712c6ead5b09fa4f996cfda66fc4e18ba597'
41
 NEXTCLOUD_COMMIT='edd5712c6ead5b09fa4f996cfda66fc4e18ba597'
42
 NEXTCLOUD_ADMIN_PASSWORD=
42
 NEXTCLOUD_ADMIN_PASSWORD=
43
+NEXTCLOUD_SERVER_SIDE_ENCRYPTION=1
43
 
44
 
44
 nextcloud_variables=(ONION_ONLY
45
 nextcloud_variables=(ONION_ONLY
45
                      NEXTCLOUD_DOMAIN_NAME
46
                      NEXTCLOUD_DOMAIN_NAME
83
         ONION_ONLY='no'
84
         ONION_ONLY='no'
84
     fi
85
     fi
85
 
86
 
87
+    dialog --title $"Enable NextCloud server side encryption" \
88
+           --backtitle $"Freedombone Configuration" \
89
+           --yesno $"\\nDo you want to enable server side encryption. On ARM or older x86 systems, especially without HRNG, this may make performance excessively slow?" 10 60
90
+    sel=$?
91
+    case $sel in
92
+        1) NEXTCLOUD_SERVER_SIDE_ENCRYPTION=
93
+           ;;
94
+        255) return;;
95
+    esac
96
+
86
     if [[ $ONION_ONLY != "no" ]]; then
97
     if [[ $ONION_ONLY != "no" ]]; then
87
         NEXTCLOUD_DOMAIN_NAME='nextcloud.local'
98
         NEXTCLOUD_DOMAIN_NAME='nextcloud.local'
88
     else
99
     else
668
     sudo -u www-data ./occ check
679
     sudo -u www-data ./occ check
669
     sudo -u www-data ./occ status
680
     sudo -u www-data ./occ status
670
     sudo -u www-data ./occ app:list
681
     sudo -u www-data ./occ app:list
671
-    sudo -u www-data ./occ app:enable encryption
672
-    if ! sudo -u www-data ./occ encryption:enable; then
673
-        echo $'Encryption not enabled'
674
-        exit 73527
682
+    if [ $NEXTCLOUD_SERVER_SIDE_ENCRYPTION ]; then
683
+        sudo -u www-data ./occ app:enable encryption
684
+        if ! sudo -u www-data ./occ encryption:enable; then
685
+            echo $'Encryption not enabled'
686
+            exit 73527
687
+        fi
688
+        sudo -u www-data ./occ encryption:status
675
     fi
689
     fi
676
-    sudo -u www-data ./occ encryption:status
677
     sudo -u www-data ./occ config:system:set appstoreenabled --value=false
690
     sudo -u www-data ./occ config:system:set appstoreenabled --value=false
678
     chmod g+w "/var/www/${NEXTCLOUD_DOMAIN_NAME}/htdocs/config/config.php"
691
     chmod g+w "/var/www/${NEXTCLOUD_DOMAIN_NAME}/htdocs/config/config.php"
679
     chown -R www-data:www-data "/var/www/${NEXTCLOUD_DOMAIN_NAME}/htdocs"
692
     chown -R www-data:www-data "/var/www/${NEXTCLOUD_DOMAIN_NAME}/htdocs"