File tree Expand file tree Collapse file tree 19 files changed +74
-178
lines changed Expand file tree Collapse file tree 19 files changed +74
-178
lines changed Original file line number Diff line number Diff line change 11
2- [ v0.26.17] ( https://github.com/nextcloud/nextcloudpi/commit/a7bfd17 )  (2017-09-07) ncp-web: link to changelog
2+ [ v0.26.18] ( https://github.com/nextcloud/nextcloudpi/commit/a4144dc )  (2017-09-07) refactor show_info(), make it only depend on variables
3+ 
4+ [ v0.26.17] ( https://github.com/nextcloud/nextcloudpi/commit/0197f31 )  (2017-09-07) ncp-web: link to changelog
35
46[ v0.26.16] ( https://github.com/nextcloud/nextcloudpi/commit/e3d07fb )  (2017-09-06) added sendmail and mail configuration
57
Original file line number Diff line number Diff line change @@ -220,15 +220,17 @@ function launch_script()
220220  )
221221}
222222
223+ #  show an info box for a script if the INFO variable is set in the script
223224function  info_script() 
224225{
225226  (
226227    local  SCRIPT=$1 
227228    cd  /usr/local/etc/nextcloudpi-config.d/ ||  return  1
228-     unset  show_info
229+     unset  show_info INFO INFOTITLE 
229230    source  ./" $SCRIPT " 
230-     [[ $(  type  -t show_info ) ==  function  ]]  ||  return  0
231-     [[ $(  type  -t show_info ) ==  function  ]]  &&  show_info 
231+     local  INFOTITLE=" ${INFOTITLE:- Info} " 
232+     [[ " $INFO " ==  " " &&  return  0
233+     whiptail --yesno --backtitle " NextCloudPi configuration" " $INFOTITLE " " $INFO " 
232234  )
233235}
234236
Original file line number Diff line number Diff line change @@ -20,6 +20,13 @@ USER_=www-data
2020GROUP_=www-data
2121DESCRIPTION=" NFS network file system server (for Linux LAN)" 
2222
23+ INFOTITLE=" Instructions for external synchronization" 
24+ INFO=" If we intend to modify the data folder through NFS,
25+ then we have to synchronize NextCloud to make it aware of the changes. 
26+ 
27+ This can be done manually or automatically using 'nc-scan' and 'nc-scan-auto'  
28+ from 'nextcloudpi-config'"   
29+ 
2330install ()
2431{
2532  apt-get update
@@ -61,18 +68,6 @@ Alias=portmap
6168EOF 
6269}
6370
64- show_info ()
65- {
66-   whiptail --yesno \
67-            --backtitle " NextCloudPi configuration" 
68-            --title " Instructions for external synchronization" 
69- " If we intend to modify the data folder through NFS,
70- then we have to synchronize NextCloud to make it aware of the changes. \n 
71- This can be done manually or automatically using 'nc-scan' and 'nc-scan-auto'  
72- from 'nextcloudpi-config'"   \
73-   20 90
74- }
75- 
7671configure ()
7772{
7873  [[ $ACTIVE_  !=  " yes" &&  { 
Original file line number Diff line number Diff line change @@ -19,14 +19,7 @@ DNSSERVER_=8.8.8.8
1919CACHESIZE_=150 
2020DESCRIPTION=" DNS server with cache" 
2121
22- show_info ()
23- {
24-   whiptail --yesno \
25-            --backtitle " NextCloudPi configuration" 
26-            --title " Info" 
27- " Remember to point your PC and devices DNS to your Raspberry Pi IP" 
28-   20 90
29- }
22+ INFO=" Remember to point your PC and devices DNS to your Raspberry Pi IP" 
3023
3124install ()
3225{
Original file line number Diff line number Diff line change @@ -22,26 +22,19 @@ VHOSTCFG=/etc/apache2/sites-available/nextcloud.conf
2222VHOSTCFG2=/etc/apache2/sites-available/ncp.conf
2323DESCRIPTION=" Automatic signed SSL certificates" 
2424
25+ INFOTITLE=" Warning" 
26+ INFO=" Internet access is required for this configuration to complete
27+ Both ports 80 and 443 need to be accessible from the internet 
28+   
29+ Your certificate will be automatically renewed every month"  
30+ 
2531install ()
2632{
2733  cd  /etc ||  return  1
2834  git clone https://github.com/letsencrypt/letsencrypt
2935  /etc/letsencrypt/letsencrypt-auto --help #  do not actually run certbot, only install packages
3036}
3137
32- show_info ()
33- {
34-   whiptail --yesno \
35-            --backtitle " NextCloudPi configuration" 
36-            --title " Warning" 
37- " Internet access is required for this configuration to complete
38- Both ports 80 and 443 need to be accessible from the internet 
39-   
40- Your certificate will be automatically renewed every month 
41- " 
42-   20 90
43- }
44- 
4538#  tested with git version v0.11.0-71-g018a304
4639configure () 
4740{
Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ NCDIR=/var/www/nextcloud/
1919NCPWB=/var/www/ncp-web/
2020DESCRIPTION=" Web Application Firewall for extra security (experimental)" 
2121
22+ INFOTITLE=" Experimental feature warning" 
23+ INFO=" This feature is highly experimental and has only been tested with
24+ a basic NextCloud installation. If a new App does not work disable it"  
25+ 
2226install ()
2327{
2428  apt-get update
4448EOF 
4549}
4650
47- show_info ()
48- {
49-   whiptail --yesno \
50-            --backtitle " NextCloudPi configuration" 
51-            --title " Experimental feature warning" 
52- " This feature is highly experimental and has only been tested with
53- a basic NextCloud installation. If a new App does not work disable it"   \
54-   20 90
55- }
56- 
5751configure () 
5852{ 
5953  cat >  /etc/modsecurity/modsecurity_crs_99_whitelist.conf << EOF 
Original file line number Diff line number Diff line change 1717ACTIVE_=no
1818DESCRIPTION=" Automount USB drives by plugging them in" 
1919
20- show_info ()
21- {
22-   whiptail --yesno \
23-            --backtitle " NextCloudPi configuration" 
24-            --title " Automount notes" 
25- " Plugged in USB drives will be automounted under /media
20+ INFOTITLE=" Automount notes" 
21+ INFO=" Plugged in USB drives will be automounted under /media
2622on boot or at the moment of insertion. 
2723
2824Format your drive as ext4 in order to move NC datafolder or database 
2925VFAT or NTFS is not recommended for this task, as it does not suport permissions 
3026
31- Drives with multiple partitions are not supported 
32- 
33- IMPORTANT: halt or umount the drive before extracting"   \
34-   20 90
35- }
27+ IMPORTANT: halt or umount the drive before extracting"  
3628
3729install ()
3830{
Original file line number Diff line number Diff line change 1717DBDIR_=/media/USBdrive/ncdatabase
1818DESCRIPTION=" Move your database to a new location, like a USB drive" 
1919
20- show_info ()
21- {
22-   whiptail --yesno \
23-            --backtitle " NextCloudPi configuration" 
24-            --title " Info" 
25- " Note that non Unix filesystems such as NTFS are not supported
20+ INFO=" Note that non Unix filesystems such as NTFS are not supported
2621because they do not provide a compatible user/permissions system 
2722
2823You need to use a USB drive that is permanently on and is responsive  
2924or the database will fail. 
3025
31- ** If it ever fails with a white page, move the database back to the SD ** 
32- " 
33-   20 90
34- }
26+ ** If it ever fails with a white page, move the database back to the SD **"  
3527
3628configure ()
3729{
Original file line number Diff line number Diff line change 1717DATADIR_=/media/USBdrive/ncdata
1818DESCRIPTION=" Change your data dir to a new location, like a USB drive" 
1919
20- show_info ()
21- {
22-   whiptail --yesno \
23-            --backtitle " NextCloudPi configuration" 
24-            --title " Info" 
25- " Note that non Unix filesystems such as NTFS are not supported
26- because they do not provide a compatible user/permissions system"   \
27-   20 90
28- }
20+ INFO=" Note that non Unix filesystems such as NTFS are not supported
21+ because they do not provide a compatible user/permissions system"  
2922
3023configure ()
3124{
Original file line number Diff line number Diff line change 1616LABEL_=myCloudDrive
1717DESCRIPTION=" Format an external USB drive as a ext4 partition (dangerous)" 
1818
19- show_info ()
20- {
21-   whiptail --yesno \
22-     --backtitle " NextCloudPi configuration" 
23-     --title " Instructions for USB drive formatting" 
24- " Make sure that ONLY the USB drive that you want to format is plugged in.
25- 
26- Be careful, this will destroy any data in the USB drive 
19+ INFOTITLE=" Instructions for USB drive formatting" 
20+ INFO=" Make sure that ONLY the USB drive that you want to format is plugged in.
21+ careful, this will destroy any data in the USB drive 
2722
28- ** YOU WILL LOSE ALL YOUR USB DATA ** "   \
29-       20 90
30- }
23+ ** YOU WILL LOSE ALL YOUR USB DATA **"  
3124
3225configure () 
3326{
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments