standarlize nextcloud_occ (#1544)
This commit is contained in:
Родитель
fab0e56bb2
Коммит
f571448c1a
|
@ -34,7 +34,7 @@ In the next step you will be able to choose to proceed or exit."
|
||||||
if yesno_box_yes "Do you want to enable automatic updates?"
|
if yesno_box_yes "Do you want to enable automatic updates?"
|
||||||
then
|
then
|
||||||
# TODO: delete the following line after a few releases. It was copied to the install-script.
|
# TODO: delete the following line after a few releases. It was copied to the install-script.
|
||||||
occ_command config:app:set updatenotification notify_groups --value="[]"
|
nextcloud_occ config:app:set updatenotification notify_groups --value="[]"
|
||||||
touch $VMLOGS/update.log
|
touch $VMLOGS/update.log
|
||||||
crontab -u root -l | { cat; echo "0 $AUT_UPDATES_TIME * * 6 $SCRIPTS/update.sh minor >> $VMLOGS/update.log"; } | crontab -u root -
|
crontab -u root -l | { cat; echo "0 $AUT_UPDATES_TIME * * 6 $SCRIPTS/update.sh minor >> $VMLOGS/update.log"; } | crontab -u root -
|
||||||
if yesno_box_yes "Do you want to reboot your server after every update? *recommended*"
|
if yesno_box_yes "Do you want to reboot your server after every update? *recommended*"
|
||||||
|
|
|
@ -44,7 +44,7 @@ then
|
||||||
crontab -u root -l | grep -v 'clamav-fullscan.sh' | crontab -u root -
|
crontab -u root -l | grep -v 'clamav-fullscan.sh' | crontab -u root -
|
||||||
if is_app_installed files_antivirus
|
if is_app_installed files_antivirus
|
||||||
then
|
then
|
||||||
occ_command_no_check app:remove files_antivirus
|
nextcloud_occ_no_check app:remove files_antivirus
|
||||||
fi
|
fi
|
||||||
# Show successful uninstall if applicable
|
# Show successful uninstall if applicable
|
||||||
removal_popup
|
removal_popup
|
||||||
|
@ -98,11 +98,11 @@ check_command systemctl restart clamav-daemon
|
||||||
install_and_enable_app files_antivirus
|
install_and_enable_app files_antivirus
|
||||||
|
|
||||||
# Configure Nextcloud app
|
# Configure Nextcloud app
|
||||||
occ_command config:app:set files_antivirus av_mode --value="socket"
|
nextcloud_occ config:app:set files_antivirus av_mode --value="socket"
|
||||||
occ_command config:app:set files_antivirus av_socket --value="/var/run/clamav/clamd.ctl"
|
nextcloud_occ config:app:set files_antivirus av_socket --value="/var/run/clamav/clamd.ctl"
|
||||||
occ_command config:app:set files_antivirus av_stream_max_length --value="104857600"
|
nextcloud_occ config:app:set files_antivirus av_stream_max_length --value="104857600"
|
||||||
occ_command config:app:set files_antivirus av_max_file_size --value="-1"
|
nextcloud_occ config:app:set files_antivirus av_max_file_size --value="-1"
|
||||||
occ_command config:app:set files_antivirus av_infected_action --value="only_log"
|
nextcloud_occ config:app:set files_antivirus av_infected_action --value="only_log"
|
||||||
|
|
||||||
# Inform the user
|
# Inform the user
|
||||||
msg_box "ClamAV was succesfully installed.
|
msg_box "ClamAV was succesfully installed.
|
||||||
|
|
|
@ -63,15 +63,15 @@ $MENU_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
||||||
# Disable RichDocuments (Collabora App) if activated
|
# Disable RichDocuments (Collabora App) if activated
|
||||||
if is_app_installed richdocuments
|
if is_app_installed richdocuments
|
||||||
then
|
then
|
||||||
occ_command app:remove richdocuments
|
nextcloud_occ app:remove richdocuments
|
||||||
fi
|
fi
|
||||||
# Remove trusted domain
|
# Remove trusted domain
|
||||||
count=0
|
count=0
|
||||||
while [ "$count" -lt 10 ]
|
while [ "$count" -lt 10 ]
|
||||||
do
|
do
|
||||||
if [ "$(occ_command_no_check config:system:get trusted_domains "$count")" == "$SUBDOMAIN" ]
|
if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" == "$SUBDOMAIN" ]
|
||||||
then
|
then
|
||||||
occ_command_no_check config:system:delete trusted_domains "$count"
|
nextcloud_occ_no_check config:system:delete trusted_domains "$count"
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
count=$((count+1))
|
count=$((count+1))
|
||||||
|
@ -124,9 +124,9 @@ then
|
||||||
count=0
|
count=0
|
||||||
while [ "$count" -lt 10 ]
|
while [ "$count" -lt 10 ]
|
||||||
do
|
do
|
||||||
if [ "$(occ_command_no_check config:system:get trusted_domains "$count")" == "$SUBDOMAIN" ]
|
if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" == "$SUBDOMAIN" ]
|
||||||
then
|
then
|
||||||
occ_command_no_check config:system:delete trusted_domains "$count"
|
nextcloud_occ_no_check config:system:delete trusted_domains "$count"
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
count=$((count+1))
|
count=$((count+1))
|
||||||
|
@ -138,20 +138,20 @@ fi
|
||||||
if is_app_enabled documentserver_community
|
if is_app_enabled documentserver_community
|
||||||
then
|
then
|
||||||
any_key "OnlyOffice will get uninstalled. Press any key to continue. Press CTRL+C to abort"
|
any_key "OnlyOffice will get uninstalled. Press any key to continue. Press CTRL+C to abort"
|
||||||
occ_command app:remove documentserver_community
|
nextcloud_occ app:remove documentserver_community
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Disable OnlyOffice App if activated
|
# Disable OnlyOffice App if activated
|
||||||
if is_app_installed onlyoffice
|
if is_app_installed onlyoffice
|
||||||
then
|
then
|
||||||
occ_command app:remove onlyoffice
|
nextcloud_occ app:remove onlyoffice
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Ask for the domain for Collabora
|
# Ask for the domain for Collabora
|
||||||
SUBDOMAIN=$(input_box_flow "Collabora subdomain e.g: office.yourdomain.com\n\nNOTE: This domain must be different than your Nextcloud domain. They can however be hosted on the same server, but would require seperate DNS entries.")
|
SUBDOMAIN=$(input_box_flow "Collabora subdomain e.g: office.yourdomain.com\n\nNOTE: This domain must be different than your Nextcloud domain. They can however be hosted on the same server, but would require seperate DNS entries.")
|
||||||
|
|
||||||
# Nextcloud Main Domain
|
# Nextcloud Main Domain
|
||||||
NCDOMAIN=$(occ_command_no_check config:system:get overwrite.cli.url | sed 's|https://||;s|/||')
|
NCDOMAIN=$(nextcloud_occ_no_check config:system:get overwrite.cli.url | sed 's|https://||;s|/||')
|
||||||
|
|
||||||
# Nextcloud Main Domain dot-escaped
|
# Nextcloud Main Domain dot-escaped
|
||||||
NCDOMAIN_ESCAPED=${NCDOMAIN//[.]/\\\\.}
|
NCDOMAIN_ESCAPED=${NCDOMAIN//[.]/\\\\.}
|
||||||
|
@ -331,9 +331,9 @@ fi
|
||||||
# Set config for RichDocuments (Collabora App)
|
# Set config for RichDocuments (Collabora App)
|
||||||
if is_app_installed richdocuments
|
if is_app_installed richdocuments
|
||||||
then
|
then
|
||||||
occ_command config:app:set richdocuments wopi_url --value=https://"$SUBDOMAIN"
|
nextcloud_occ config:app:set richdocuments wopi_url --value=https://"$SUBDOMAIN"
|
||||||
chown -R www-data:www-data "$NC_APPS_PATH"
|
chown -R www-data:www-data "$NC_APPS_PATH"
|
||||||
occ_command config:system:set trusted_domains 3 --value="$SUBDOMAIN"
|
nextcloud_occ config:system:set trusted_domains 3 --value="$SUBDOMAIN"
|
||||||
# Add prune command
|
# Add prune command
|
||||||
add_dockerprune
|
add_dockerprune
|
||||||
# Restart Docker
|
# Restart Docker
|
||||||
|
|
|
@ -40,12 +40,12 @@ then
|
||||||
# Disable RichDocuments (Collabora App) if activated
|
# Disable RichDocuments (Collabora App) if activated
|
||||||
if is_app_installed richdocuments
|
if is_app_installed richdocuments
|
||||||
then
|
then
|
||||||
occ_command app:remove richdocuments
|
nextcloud_occ app:remove richdocuments
|
||||||
fi
|
fi
|
||||||
# Disable OnlyOffice (Collabora App) if activated
|
# Disable OnlyOffice (Collabora App) if activated
|
||||||
if is_app_installed onlyoffice
|
if is_app_installed onlyoffice
|
||||||
then
|
then
|
||||||
occ_command app:remove onlyoffice
|
nextcloud_occ app:remove onlyoffice
|
||||||
fi
|
fi
|
||||||
# Revoke LE
|
# Revoke LE
|
||||||
SUBDOMAIN=$(input_box_flow "Please enter the subdomain you are using for Collabora, e.g: office.yourdomain.com")
|
SUBDOMAIN=$(input_box_flow "Please enter the subdomain you are using for Collabora, e.g: office.yourdomain.com")
|
||||||
|
@ -68,9 +68,9 @@ then
|
||||||
count=0
|
count=0
|
||||||
while [ "$count" -lt 10 ]
|
while [ "$count" -lt 10 ]
|
||||||
do
|
do
|
||||||
if [ "$(occ_command_no_check config:system:get trusted_domains "$count")" == "$SUBDOMAIN" ]
|
if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" == "$SUBDOMAIN" ]
|
||||||
then
|
then
|
||||||
occ_command_no_check config:system:delete trusted_domains "$count"
|
nextcloud_occ_no_check config:system:delete trusted_domains "$count"
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
count=$((count+1))
|
count=$((count+1))
|
||||||
|
@ -90,18 +90,18 @@ $MENU_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
"Uninstall Collabora")
|
"Uninstall Collabora")
|
||||||
print_text_in_color "$ICyan" "Uninstalling Collabora..."
|
print_text_in_color "$ICyan" "Uninstalling Collabora..."
|
||||||
occ_command app:remove richdocumentscode
|
nextcloud_occ app:remove richdocumentscode
|
||||||
# Disable Collabora App if activated
|
# Disable Collabora App if activated
|
||||||
if is_app_installed richdocuments
|
if is_app_installed richdocuments
|
||||||
then
|
then
|
||||||
occ_command app:remove richdocuments
|
nextcloud_occ app:remove richdocuments
|
||||||
fi
|
fi
|
||||||
msg_box "Collabora was successfully uninstalled."
|
msg_box "Collabora was successfully uninstalled."
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
"Reinstall Collabora")
|
"Reinstall Collabora")
|
||||||
print_text_in_color "$ICyan" "Reinstalling Collabora..."
|
print_text_in_color "$ICyan" "Reinstalling Collabora..."
|
||||||
occ_command app:remove richdocumentscode
|
nextcloud_occ app:remove richdocumentscode
|
||||||
;;
|
;;
|
||||||
"")
|
"")
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -138,9 +138,9 @@ then
|
||||||
count=0
|
count=0
|
||||||
while [ "$count" -lt 10 ]
|
while [ "$count" -lt 10 ]
|
||||||
do
|
do
|
||||||
if [ "$(occ_command_no_check config:system:get trusted_domains "$count")" == "$SUBDOMAIN" ]
|
if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" == "$SUBDOMAIN" ]
|
||||||
then
|
then
|
||||||
occ_command_no_check config:system:delete trusted_domains "$count"
|
nextcloud_occ_no_check config:system:delete trusted_domains "$count"
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
count=$((count+1))
|
count=$((count+1))
|
||||||
|
@ -150,7 +150,7 @@ else
|
||||||
# Remove OnlyOffice app
|
# Remove OnlyOffice app
|
||||||
if is_app_installed onlyoffice
|
if is_app_installed onlyoffice
|
||||||
then
|
then
|
||||||
occ_command app:remove onlyoffice
|
nextcloud_occ app:remove onlyoffice
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -158,13 +158,13 @@ fi
|
||||||
if is_app_enabled documentserver_community
|
if is_app_enabled documentserver_community
|
||||||
then
|
then
|
||||||
any_key "OnlyOffice will get uninstalled. Press any key to continue. Press CTRL+C to abort"
|
any_key "OnlyOffice will get uninstalled. Press any key to continue. Press CTRL+C to abort"
|
||||||
occ_command app:remove documentserver_community
|
nextcloud_occ app:remove documentserver_community
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Disable OnlyOffice App if activated
|
# Disable OnlyOffice App if activated
|
||||||
if is_app_installed onlyoffice
|
if is_app_installed onlyoffice
|
||||||
then
|
then
|
||||||
occ_command app:remove onlyoffice
|
nextcloud_occ app:remove onlyoffice
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install Collabora
|
# Install Collabora
|
||||||
|
|
|
@ -69,21 +69,21 @@ mkdir -p "$VMLOGS"
|
||||||
print_text_in_color "$ICyan" "Finding nextcloud.log..."
|
print_text_in_color "$ICyan" "Finding nextcloud.log..."
|
||||||
while :
|
while :
|
||||||
do
|
do
|
||||||
if [ "$(occ_command_no_check config:system:get logfile)" = "$VMLOGS/nextcloud.log" ]
|
if [ "$(nextcloud_occ_no_check config:system:get logfile)" = "$VMLOGS/nextcloud.log" ]
|
||||||
then
|
then
|
||||||
if [ -f "$VMLOGS/nextcloud.log" ]
|
if [ -f "$VMLOGS/nextcloud.log" ]
|
||||||
then
|
then
|
||||||
chown www-data:www-data "$VMLOGS/nextcloud.log"
|
chown www-data:www-data "$VMLOGS/nextcloud.log"
|
||||||
occ_command config:system:set log_type --value=file
|
nextcloud_occ config:system:set log_type --value=file
|
||||||
occ_command config:system:set loglevel --value=2
|
nextcloud_occ config:system:set loglevel --value=2
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
elif [ "$(occ_command_no_check config:system:get logfile)" != "" ]
|
elif [ "$(nextcloud_occ_no_check config:system:get logfile)" != "" ]
|
||||||
then
|
then
|
||||||
# Set logging
|
# Set logging
|
||||||
occ_command config:system:set log_type --value=file
|
nextcloud_occ config:system:set log_type --value=file
|
||||||
occ_command config:system:set logfile --value="$VMLOGS/nextcloud.log"
|
nextcloud_occ config:system:set logfile --value="$VMLOGS/nextcloud.log"
|
||||||
occ_command config:system:set loglevel --value=2
|
nextcloud_occ config:system:set loglevel --value=2
|
||||||
touch "$VMLOGS/nextcloud.log"
|
touch "$VMLOGS/nextcloud.log"
|
||||||
chown www-data:www-data "$VMLOGS/nextcloud.log"
|
chown www-data:www-data "$VMLOGS/nextcloud.log"
|
||||||
break
|
break
|
||||||
|
@ -95,9 +95,9 @@ do
|
||||||
print_text_in_color "$ICyan" "Unexpected or non-existent logging configuration - deleting any discovered nextcloud.log files and creating a new one at $VMLOGS/nextcloud.log..."
|
print_text_in_color "$ICyan" "Unexpected or non-existent logging configuration - deleting any discovered nextcloud.log files and creating a new one at $VMLOGS/nextcloud.log..."
|
||||||
xargs rm -f <<< "$NCLOG"
|
xargs rm -f <<< "$NCLOG"
|
||||||
# Set logging
|
# Set logging
|
||||||
occ_command config:system:set log_type --value=file
|
nextcloud_occ config:system:set log_type --value=file
|
||||||
occ_command config:system:set logfile --value="$VMLOGS/nextcloud.log"
|
nextcloud_occ config:system:set logfile --value="$VMLOGS/nextcloud.log"
|
||||||
occ_command config:system:set loglevel --value=2
|
nextcloud_occ config:system:set loglevel --value=2
|
||||||
touch "$VMLOGS/nextcloud.log"
|
touch "$VMLOGS/nextcloud.log"
|
||||||
chown www-data:www-data "$VMLOGS/nextcloud.log"
|
chown www-data:www-data "$VMLOGS/nextcloud.log"
|
||||||
break
|
break
|
||||||
|
@ -118,7 +118,7 @@ check_command apt install fail2ban -y
|
||||||
check_command update-rc.d fail2ban disable
|
check_command update-rc.d fail2ban disable
|
||||||
|
|
||||||
# Set timezone
|
# Set timezone
|
||||||
occ_command config:system:set logtimezone --value="$(cat /etc/timezone)"
|
nextcloud_occ config:system:set logtimezone --value="$(cat /etc/timezone)"
|
||||||
|
|
||||||
# Create nextcloud.conf file
|
# Create nextcloud.conf file
|
||||||
# Test: failregex = Login failed.*Remote IP.*<HOST>
|
# Test: failregex = Login failed.*Remote IP.*<HOST>
|
||||||
|
|
|
@ -55,16 +55,16 @@ $MENU_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
||||||
if is_app_installed fulltextsearch
|
if is_app_installed fulltextsearch
|
||||||
then
|
then
|
||||||
print_text_in_color "$ICyan" "Removing old version of Full Text Search and resetting the app..."
|
print_text_in_color "$ICyan" "Removing old version of Full Text Search and resetting the app..."
|
||||||
occ_command_no_check fulltextsearch:reset
|
nextcloud_occ_no_check fulltextsearch:reset
|
||||||
occ_command app:remove fulltextsearch
|
nextcloud_occ app:remove fulltextsearch
|
||||||
fi
|
fi
|
||||||
if is_app_installed fulltextsearch_elasticsearch
|
if is_app_installed fulltextsearch_elasticsearch
|
||||||
then
|
then
|
||||||
occ_command app:remove fulltextsearch_elasticsearch
|
nextcloud_occ app:remove fulltextsearch_elasticsearch
|
||||||
fi
|
fi
|
||||||
if is_app_installed files_fulltextsearch
|
if is_app_installed files_fulltextsearch
|
||||||
then
|
then
|
||||||
occ_command app:remove files_fulltextsearch
|
nextcloud_occ app:remove files_fulltextsearch
|
||||||
fi
|
fi
|
||||||
# Remove nc_fts docker if installed
|
# Remove nc_fts docker if installed
|
||||||
docker_prune_this "$nc_fts"
|
docker_prune_this "$nc_fts"
|
||||||
|
@ -82,16 +82,16 @@ $MENU_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
||||||
# Reset database table
|
# Reset database table
|
||||||
check_command sudo -Hiu postgres psql "$NCCONFIGDB" -c "TRUNCATE TABLE oc_fulltextsearch_ticks;"
|
check_command sudo -Hiu postgres psql "$NCCONFIGDB" -c "TRUNCATE TABLE oc_fulltextsearch_ticks;"
|
||||||
# Reset Full Text Search to be able to index again, and also remove the app to be able to install it again
|
# Reset Full Text Search to be able to index again, and also remove the app to be able to install it again
|
||||||
occ_command_no_check fulltextsearch:reset
|
nextcloud_occ_no_check fulltextsearch:reset
|
||||||
occ_command app:remove fulltextsearch
|
nextcloud_occ app:remove fulltextsearch
|
||||||
fi
|
fi
|
||||||
if is_app_installed fulltextsearch_elasticsearch
|
if is_app_installed fulltextsearch_elasticsearch
|
||||||
then
|
then
|
||||||
occ_command app:remove fulltextsearch_elasticsearch
|
nextcloud_occ app:remove fulltextsearch_elasticsearch
|
||||||
fi
|
fi
|
||||||
if is_app_installed files_fulltextsearch
|
if is_app_installed files_fulltextsearch
|
||||||
then
|
then
|
||||||
occ_command app:remove files_fulltextsearch
|
nextcloud_occ app:remove files_fulltextsearch
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove nc_fts docker if installed
|
# Remove nc_fts docker if installed
|
||||||
|
@ -108,7 +108,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure there is an Nextcloud installation
|
# Make sure there is an Nextcloud installation
|
||||||
if ! [ "$(occ_command -V)" ]
|
if ! [ "$(nextcloud_occ -V)" ]
|
||||||
then
|
then
|
||||||
msg_box "It seems there is no Nextcloud server installed, please check your installation."
|
msg_box "It seems there is no Nextcloud server installed, please check your installation."
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -119,7 +119,7 @@ if is_app_installed nextant
|
||||||
then
|
then
|
||||||
# Remove Nextant
|
# Remove Nextant
|
||||||
msg_box "We will now remove Nextant + Solr and replace it with Full Text Search"
|
msg_box "We will now remove Nextant + Solr and replace it with Full Text Search"
|
||||||
occ_command app:remove nextant
|
nextcloud_occ app:remove nextant
|
||||||
|
|
||||||
# Remove Solr
|
# Remove Solr
|
||||||
systemctl stop solr.service
|
systemctl stop solr.service
|
||||||
|
@ -180,10 +180,10 @@ install_and_enable_app files_fulltextsearch
|
||||||
chown -R www-data:www-data $NC_APPS_PATH
|
chown -R www-data:www-data $NC_APPS_PATH
|
||||||
|
|
||||||
# Final setup
|
# Final setup
|
||||||
occ_command fulltextsearch:configure '{"search_platform":"OCA\\FullTextSearch_ElasticSearch\\Platform\\ElasticSearchPlatform"}'
|
nextcloud_occ fulltextsearch:configure '{"search_platform":"OCA\\FullTextSearch_ElasticSearch\\Platform\\ElasticSearchPlatform"}'
|
||||||
occ_command fulltextsearch_elasticsearch:configure "{\"elastic_host\":\"http://${INDEX_USER}:${ROREST}@localhost:9200\",\"elastic_index\":\"${INDEX_USER}-index\"}"
|
nextcloud_occ fulltextsearch_elasticsearch:configure "{\"elastic_host\":\"http://${INDEX_USER}:${ROREST}@localhost:9200\",\"elastic_index\":\"${INDEX_USER}-index\"}"
|
||||||
occ_command files_fulltextsearch:configure "{\"files_pdf\":\"1\",\"files_office\":\"1\"}"
|
nextcloud_occ files_fulltextsearch:configure "{\"files_pdf\":\"1\",\"files_office\":\"1\"}"
|
||||||
if occ_command fulltextsearch:index < /dev/null
|
if nextcloud_occ fulltextsearch:index < /dev/null
|
||||||
then
|
then
|
||||||
msg_box "Full Text Search was successfully installed!"
|
msg_box "Full Text Search was successfully installed!"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -31,7 +31,7 @@ check_nextcloud_https "OnlyOffice (Docker)"
|
||||||
if is_app_enabled documentserver_community
|
if is_app_enabled documentserver_community
|
||||||
then
|
then
|
||||||
any_key "The integrated OnlyOffice Documentserver will get uninstalled. Press any key to continue. Press CTRL+C to abort"
|
any_key "The integrated OnlyOffice Documentserver will get uninstalled. Press any key to continue. Press CTRL+C to abort"
|
||||||
occ_command app:remove documentserver_community
|
nextcloud_occ app:remove documentserver_community
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if collabora is already installed
|
# Check if collabora is already installed
|
||||||
|
@ -70,15 +70,15 @@ $MENU_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
||||||
# Disable RichDocuments (Collabora App) if activated
|
# Disable RichDocuments (Collabora App) if activated
|
||||||
if is_app_installed onlyoffice
|
if is_app_installed onlyoffice
|
||||||
then
|
then
|
||||||
occ_command app:remove onlyoffice
|
nextcloud_occ app:remove onlyoffice
|
||||||
fi
|
fi
|
||||||
# Remove trusted domain
|
# Remove trusted domain
|
||||||
count=0
|
count=0
|
||||||
while [ "$count" -lt 10 ]
|
while [ "$count" -lt 10 ]
|
||||||
do
|
do
|
||||||
if [ "$(occ_command_no_check config:system:get trusted_domains "$count")" == "$SUBDOMAIN" ]
|
if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" == "$SUBDOMAIN" ]
|
||||||
then
|
then
|
||||||
occ_command_no_check config:system:delete trusted_domains "$count"
|
nextcloud_occ_no_check config:system:delete trusted_domains "$count"
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
count=$((count+1))
|
count=$((count+1))
|
||||||
|
@ -131,15 +131,15 @@ then
|
||||||
# Disable Collabora App if activated
|
# Disable Collabora App if activated
|
||||||
if is_app_installed richdocuments
|
if is_app_installed richdocuments
|
||||||
then
|
then
|
||||||
occ_command app:remove richdocuments
|
nextcloud_occ app:remove richdocuments
|
||||||
fi
|
fi
|
||||||
# Remove trusted domain
|
# Remove trusted domain
|
||||||
count=0
|
count=0
|
||||||
while [ "$count" -lt 10 ]
|
while [ "$count" -lt 10 ]
|
||||||
do
|
do
|
||||||
if [ "$(occ_command_no_check config:system:get trusted_domains "$count")" == "$SUBDOMAIN" ]
|
if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" == "$SUBDOMAIN" ]
|
||||||
then
|
then
|
||||||
occ_command_no_check config:system:delete trusted_domains "$count"
|
nextcloud_occ_no_check config:system:delete trusted_domains "$count"
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
count=$((count+1))
|
count=$((count+1))
|
||||||
|
@ -166,7 +166,7 @@ fi
|
||||||
SUBDOMAIN=$(input_box_flow "OnlyOffice subdomain e.g: office.yourdomain.com\n\nNOTE: This domain must be different than your Nextcloud domain. They can however be hosted on the same server, but would require seperate DNS entries.")
|
SUBDOMAIN=$(input_box_flow "OnlyOffice subdomain e.g: office.yourdomain.com\n\nNOTE: This domain must be different than your Nextcloud domain. They can however be hosted on the same server, but would require seperate DNS entries.")
|
||||||
|
|
||||||
# Nextcloud Main Domain
|
# Nextcloud Main Domain
|
||||||
NCDOMAIN=$(occ_command_no_check config:system:get overwrite.cli.url | sed 's|https://||;s|/||')
|
NCDOMAIN=$(nextcloud_occ_no_check config:system:get overwrite.cli.url | sed 's|https://||;s|/||')
|
||||||
|
|
||||||
# shellcheck disable=2034,2059
|
# shellcheck disable=2034,2059
|
||||||
true
|
true
|
||||||
|
@ -334,9 +334,9 @@ fi
|
||||||
# Set config for OnlyOffice
|
# Set config for OnlyOffice
|
||||||
if [ -d "$NC_APPS_PATH"/onlyoffice ]
|
if [ -d "$NC_APPS_PATH"/onlyoffice ]
|
||||||
then
|
then
|
||||||
occ_command config:app:set onlyoffice DocumentServerUrl --value=https://"$SUBDOMAIN/"
|
nextcloud_occ config:app:set onlyoffice DocumentServerUrl --value=https://"$SUBDOMAIN/"
|
||||||
chown -R www-data:www-data "$NC_APPS_PATH"
|
chown -R www-data:www-data "$NC_APPS_PATH"
|
||||||
occ_command config:system:set trusted_domains 3 --value="$SUBDOMAIN"
|
nextcloud_occ config:system:set trusted_domains 3 --value="$SUBDOMAIN"
|
||||||
# Add prune command
|
# Add prune command
|
||||||
add_dockerprune
|
add_dockerprune
|
||||||
# Restart Docker
|
# Restart Docker
|
||||||
|
|
|
@ -40,12 +40,12 @@ then
|
||||||
# Disable RichDocuments (Collabora App) if activated
|
# Disable RichDocuments (Collabora App) if activated
|
||||||
if is_app_installed richdocuments
|
if is_app_installed richdocuments
|
||||||
then
|
then
|
||||||
occ_command app:remove richdocuments
|
nextcloud_occ app:remove richdocuments
|
||||||
fi
|
fi
|
||||||
# Disable OnlyOffice (Collabora App) if activated
|
# Disable OnlyOffice (Collabora App) if activated
|
||||||
if is_app_installed onlyoffice
|
if is_app_installed onlyoffice
|
||||||
then
|
then
|
||||||
occ_command app:remove onlyoffice
|
nextcloud_occ app:remove onlyoffice
|
||||||
fi
|
fi
|
||||||
# Revoke LE
|
# Revoke LE
|
||||||
SUBDOMAIN=$(input_box_flow "Please enter the subdomain you are using for OnlyOffice, e.g: office.yourdomain.com")
|
SUBDOMAIN=$(input_box_flow "Please enter the subdomain you are using for OnlyOffice, e.g: office.yourdomain.com")
|
||||||
|
@ -68,9 +68,9 @@ then
|
||||||
count=0
|
count=0
|
||||||
while [ "$count" -lt 10 ]
|
while [ "$count" -lt 10 ]
|
||||||
do
|
do
|
||||||
if [ "$(occ_command_no_check config:system:get trusted_domains "$count")" == "$SUBDOMAIN" ]
|
if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" == "$SUBDOMAIN" ]
|
||||||
then
|
then
|
||||||
occ_command_no_check config:system:delete trusted_domains "$count"
|
nextcloud_occ_no_check config:system:delete trusted_domains "$count"
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
count=$((count+1))
|
count=$((count+1))
|
||||||
|
@ -98,18 +98,18 @@ $MENU_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
"Uninstall OnlyOffice")
|
"Uninstall OnlyOffice")
|
||||||
print_text_in_color "$ICyan" "Uninstalling OnlyOffice..."
|
print_text_in_color "$ICyan" "Uninstalling OnlyOffice..."
|
||||||
occ_command app:remove documentserver_community
|
nextcloud_occ app:remove documentserver_community
|
||||||
# Disable Onlyoffice App if activated
|
# Disable Onlyoffice App if activated
|
||||||
if is_app_installed onlyoffice
|
if is_app_installed onlyoffice
|
||||||
then
|
then
|
||||||
occ_command app:remove onlyoffice
|
nextcloud_occ app:remove onlyoffice
|
||||||
fi
|
fi
|
||||||
msg_box "OnlyOffice was successfully uninstalled."
|
msg_box "OnlyOffice was successfully uninstalled."
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
"Reinstall OnlyOffice")
|
"Reinstall OnlyOffice")
|
||||||
print_text_in_color "$ICyan" "Reinstalling OnlyOffice..."
|
print_text_in_color "$ICyan" "Reinstalling OnlyOffice..."
|
||||||
occ_command app:remove documentserver_community
|
nextcloud_occ app:remove documentserver_community
|
||||||
;;
|
;;
|
||||||
"")
|
"")
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -153,15 +153,15 @@ then
|
||||||
# Disable Collabora App if activated
|
# Disable Collabora App if activated
|
||||||
if is_app_installed richdocuments
|
if is_app_installed richdocuments
|
||||||
then
|
then
|
||||||
occ_command app:remove richdocuments
|
nextcloud_occ app:remove richdocuments
|
||||||
fi
|
fi
|
||||||
# Remove trusted domain
|
# Remove trusted domain
|
||||||
count=0
|
count=0
|
||||||
while [ "$count" -lt 10 ]
|
while [ "$count" -lt 10 ]
|
||||||
do
|
do
|
||||||
if [ "$(occ_command_no_check config:system:get trusted_domains "$count")" == "$SUBDOMAIN" ]
|
if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" == "$SUBDOMAIN" ]
|
||||||
then
|
then
|
||||||
occ_command_no_check config:system:delete trusted_domains "$count"
|
nextcloud_occ_no_check config:system:delete trusted_domains "$count"
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
count=$((count+1))
|
count=$((count+1))
|
||||||
|
@ -171,7 +171,7 @@ else
|
||||||
# Remove Collabora app
|
# Remove Collabora app
|
||||||
if is_app_installed richdocuments
|
if is_app_installed richdocuments
|
||||||
then
|
then
|
||||||
occ_command app:remove richdocuments
|
nextcloud_occ app:remove richdocuments
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ sleep 2
|
||||||
if install_and_enable_app documentserver_community
|
if install_and_enable_app documentserver_community
|
||||||
then
|
then
|
||||||
chown -R www-data:www-data "$NC_APPS_PATH"
|
chown -R www-data:www-data "$NC_APPS_PATH"
|
||||||
occ_command config:app:set onlyoffice DocumentServerUrl --value="$(occ_command_no_check config:system:get overwrite.cli.url)/index.php/apps/documentserver_community/"
|
nextcloud_occ config:app:set onlyoffice DocumentServerUrl --value="$(nextcloud_occ_no_check config:system:get overwrite.cli.url)/index.php/apps/documentserver_community/"
|
||||||
msg_box "OnlyOffice was successfully installed."
|
msg_box "OnlyOffice was successfully installed."
|
||||||
else
|
else
|
||||||
msg_box "The documentserver_community app failed to install. Please try again later.\n\nIf the error presist, please report the issue to https://github.com/nextcloud/documentserver_community\n\n'sudo -u www-data php ./occ app:install documentserver_community failed!'"
|
msg_box "The documentserver_community app failed to install. Please try again later.\n\nIf the error presist, please report the issue to https://github.com/nextcloud/documentserver_community\n\n'sudo -u www-data php ./occ app:install documentserver_community failed!'"
|
||||||
|
|
|
@ -50,13 +50,13 @@ then
|
||||||
if is_app_installed previewgenerator
|
if is_app_installed previewgenerator
|
||||||
then
|
then
|
||||||
# enable previews
|
# enable previews
|
||||||
occ_command config:system:set enable_previews --value=true --type=boolean
|
nextcloud_occ config:system:set enable_previews --value=true --type=boolean
|
||||||
|
|
||||||
# install needed dependency for movies
|
# install needed dependency for movies
|
||||||
install_if_not ffmpeg
|
install_if_not ffmpeg
|
||||||
|
|
||||||
# reset the preview formats
|
# reset the preview formats
|
||||||
occ_command config:system:delete "enabledPreviewProviders"
|
nextcloud_occ config:system:delete "enabledPreviewProviders"
|
||||||
|
|
||||||
# reset the cronjob
|
# reset the cronjob
|
||||||
print_text_in_color "$ICyan" "Resetting the cronjob for the Preview Generation"
|
print_text_in_color "$ICyan" "Resetting the cronjob for the Preview Generation"
|
||||||
|
@ -114,37 +114,37 @@ $CHECKLIST_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
||||||
|
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
*"PNG"*)
|
*"PNG"*)
|
||||||
occ_command config:system:set enabledPreviewProviders 0 --value="OC\\Preview\\PNG"
|
nextcloud_occ config:system:set enabledPreviewProviders 0 --value="OC\\Preview\\PNG"
|
||||||
;;&
|
;;&
|
||||||
*"JPEG"*)
|
*"JPEG"*)
|
||||||
occ_command config:system:set enabledPreviewProviders 1 --value="OC\\Preview\\JPEG"
|
nextcloud_occ config:system:set enabledPreviewProviders 1 --value="OC\\Preview\\JPEG"
|
||||||
;;&
|
;;&
|
||||||
*"GIF"*)
|
*"GIF"*)
|
||||||
occ_command config:system:set enabledPreviewProviders 2 --value="OC\\Preview\\GIF"
|
nextcloud_occ config:system:set enabledPreviewProviders 2 --value="OC\\Preview\\GIF"
|
||||||
;;&
|
;;&
|
||||||
*"BMP"*)
|
*"BMP"*)
|
||||||
occ_command config:system:set enabledPreviewProviders 3 --value="OC\\Preview\\BMP"
|
nextcloud_occ config:system:set enabledPreviewProviders 3 --value="OC\\Preview\\BMP"
|
||||||
;;&
|
;;&
|
||||||
*"MarkDown"*)
|
*"MarkDown"*)
|
||||||
occ_command config:system:set enabledPreviewProviders 4 --value="OC\\Preview\\MarkDown"
|
nextcloud_occ config:system:set enabledPreviewProviders 4 --value="OC\\Preview\\MarkDown"
|
||||||
;;&
|
;;&
|
||||||
*"MP3"*)
|
*"MP3"*)
|
||||||
occ_command config:system:set enabledPreviewProviders 5 --value="OC\\Preview\\MP3"
|
nextcloud_occ config:system:set enabledPreviewProviders 5 --value="OC\\Preview\\MP3"
|
||||||
;;&
|
;;&
|
||||||
*"TXT"*)
|
*"TXT"*)
|
||||||
occ_command config:system:set enabledPreviewProviders 6 --value="OC\\Preview\\TXT"
|
nextcloud_occ config:system:set enabledPreviewProviders 6 --value="OC\\Preview\\TXT"
|
||||||
;;&
|
;;&
|
||||||
*"Movie"*)
|
*"Movie"*)
|
||||||
occ_command config:system:set enabledPreviewProviders 7 --value="OC\\Preview\\Movie"
|
nextcloud_occ config:system:set enabledPreviewProviders 7 --value="OC\\Preview\\Movie"
|
||||||
;;&
|
;;&
|
||||||
*"Photoshop"*)
|
*"Photoshop"*)
|
||||||
occ_command config:system:set enabledPreviewProviders 8 --value="OC\\Preview\\Photoshop"
|
nextcloud_occ config:system:set enabledPreviewProviders 8 --value="OC\\Preview\\Photoshop"
|
||||||
;;&
|
;;&
|
||||||
*"SVG"*)
|
*"SVG"*)
|
||||||
occ_command config:system:set enabledPreviewProviders 9 --value="OC\\Preview\\SVG"
|
nextcloud_occ config:system:set enabledPreviewProviders 9 --value="OC\\Preview\\SVG"
|
||||||
;;&
|
;;&
|
||||||
*"TIFF"*)
|
*"TIFF"*)
|
||||||
occ_command config:system:set enabledPreviewProviders 10 --value="OC\\Preview\\TIFF"
|
nextcloud_occ config:system:set enabledPreviewProviders 10 --value="OC\\Preview\\TIFF"
|
||||||
;;&
|
;;&
|
||||||
*)
|
*)
|
||||||
;;
|
;;
|
||||||
|
@ -176,28 +176,28 @@ $CHECKLIST_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
||||||
|
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
*"PNG"*)
|
*"PNG"*)
|
||||||
occ_command config:system:set enabledPreviewProviders 11 --value="OC\\Preview\\PNG"
|
nextcloud_occ config:system:set enabledPreviewProviders 11 --value="OC\\Preview\\PNG"
|
||||||
;;&
|
;;&
|
||||||
*"JPEG"*)
|
*"JPEG"*)
|
||||||
occ_command config:system:set enabledPreviewProviders 12 --value="OC\\Preview\\JPEG"
|
nextcloud_occ config:system:set enabledPreviewProviders 12 --value="OC\\Preview\\JPEG"
|
||||||
;;&
|
;;&
|
||||||
*"GIF"*)
|
*"GIF"*)
|
||||||
occ_command config:system:set enabledPreviewProviders 13 --value="OC\\Preview\\GIF"
|
nextcloud_occ config:system:set enabledPreviewProviders 13 --value="OC\\Preview\\GIF"
|
||||||
;;&
|
;;&
|
||||||
*"BMP"*)
|
*"BMP"*)
|
||||||
occ_command config:system:set enabledPreviewProviders 14 --value="OC\\Preview\\BMP"
|
nextcloud_occ config:system:set enabledPreviewProviders 14 --value="OC\\Preview\\BMP"
|
||||||
;;&
|
;;&
|
||||||
*"MarkDown"*)
|
*"MarkDown"*)
|
||||||
occ_command config:system:set enabledPreviewProviders 15 --value="OC\\Preview\\MarkDown"
|
nextcloud_occ config:system:set enabledPreviewProviders 15 --value="OC\\Preview\\MarkDown"
|
||||||
;;&
|
;;&
|
||||||
*"MP3"*)
|
*"MP3"*)
|
||||||
occ_command config:system:set enabledPreviewProviders 16 --value="OC\\Preview\\MP3"
|
nextcloud_occ config:system:set enabledPreviewProviders 16 --value="OC\\Preview\\MP3"
|
||||||
;;&
|
;;&
|
||||||
*"TXT"*)
|
*"TXT"*)
|
||||||
occ_command config:system:set enabledPreviewProviders 17 --value="OC\\Preview\\TXT"
|
nextcloud_occ config:system:set enabledPreviewProviders 17 --value="OC\\Preview\\TXT"
|
||||||
;;&
|
;;&
|
||||||
*"Movie"*)
|
*"Movie"*)
|
||||||
occ_command config:system:set enabledPreviewProviders 18 --value="OC\\Preview\\Movie"
|
nextcloud_occ config:system:set enabledPreviewProviders 18 --value="OC\\Preview\\Movie"
|
||||||
;;&
|
;;&
|
||||||
*)
|
*)
|
||||||
;;
|
;;
|
||||||
|
@ -205,13 +205,13 @@ $CHECKLIST_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set aspect ratio
|
# Set aspect ratio
|
||||||
occ_command config:app:set previewgenerator squareSizes --value="32 256"
|
nextcloud_occ config:app:set previewgenerator squareSizes --value="32 256"
|
||||||
occ_command config:app:set previewgenerator widthSizes --value="256 384"
|
nextcloud_occ config:app:set previewgenerator widthSizes --value="256 384"
|
||||||
occ_command config:app:set previewgenerator heightSizes --value="256"
|
nextcloud_occ config:app:set previewgenerator heightSizes --value="256"
|
||||||
occ_command config:system:set preview_max_x --value="2048"
|
nextcloud_occ config:system:set preview_max_x --value="2048"
|
||||||
occ_command config:system:set preview_max_y --value="2048"
|
nextcloud_occ config:system:set preview_max_y --value="2048"
|
||||||
occ_command config:system:set jpeg_quality --value="60"
|
nextcloud_occ config:system:set jpeg_quality --value="60"
|
||||||
occ_command config:app:set preview jpeg_quality --value="60"
|
nextcloud_occ config:app:set preview jpeg_quality --value="60"
|
||||||
|
|
||||||
msg_box "In the last step you can define a specific Nextcloud user for which will be the user that runs the Preview Generation.
|
msg_box "In the last step you can define a specific Nextcloud user for which will be the user that runs the Preview Generation.
|
||||||
|
|
||||||
|
@ -227,12 +227,12 @@ then
|
||||||
chown www-data:www-data "$VMLOGS"/previewgenerator.log
|
chown www-data:www-data "$VMLOGS"/previewgenerator.log
|
||||||
|
|
||||||
# Pre generate everything
|
# Pre generate everything
|
||||||
occ_command preview:generate-all
|
nextcloud_occ preview:generate-all
|
||||||
else
|
else
|
||||||
while :
|
while :
|
||||||
do
|
do
|
||||||
PREVIEW_USER=$(input_box "Enter the Nextcloud user for which you want to run the Preview Generation (as a scheluded task)")
|
PREVIEW_USER=$(input_box "Enter the Nextcloud user for which you want to run the Preview Generation (as a scheluded task)")
|
||||||
if [ -z "$(occ_command user:list | grep "$PREVIEW_USER" | awk '{print $3}')" ]
|
if [ -z "$(nextcloud_occ user:list | grep "$PREVIEW_USER" | awk '{print $3}')" ]
|
||||||
then
|
then
|
||||||
msg_box "It seems like the user you entered ($PREVIEW_USER) doesn't exist, please try again."
|
msg_box "It seems like the user you entered ($PREVIEW_USER) doesn't exist, please try again."
|
||||||
else
|
else
|
||||||
|
@ -245,5 +245,5 @@ else
|
||||||
chown www-data:www-data "$VMLOGS"/previewgenerator.log
|
chown www-data:www-data "$VMLOGS"/previewgenerator.log
|
||||||
|
|
||||||
# Pre generate everything
|
# Pre generate everything
|
||||||
occ_command preview:generate-all "$PREVIEW_USER"
|
nextcloud_occ preview:generate-all "$PREVIEW_USER"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -206,7 +206,7 @@ $CHECKLIST_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
||||||
"Please select which Nextcloud groups shall get access to the new external storage $NEWNAME.
|
"Please select which Nextcloud groups shall get access to the new external storage $NEWNAME.
|
||||||
If you select no group and no user, the external storage will be visible to all users of your instance.
|
If you select no group and no user, the external storage will be visible to all users of your instance.
|
||||||
$CHECKLIST_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4)
|
$CHECKLIST_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4)
|
||||||
NC_GROUPS=$(occ_command_no_check group:list | grep ".*:$" | sed 's|^ - ||g' | sed 's|:$||g')
|
NC_GROUPS=$(nextcloud_occ_no_check group:list | grep ".*:$" | sed 's|^ - ||g' | sed 's|:$||g')
|
||||||
mapfile -t NC_GROUPS <<< "$NC_GROUPS"
|
mapfile -t NC_GROUPS <<< "$NC_GROUPS"
|
||||||
for GROUP in "${NC_GROUPS[@]}"
|
for GROUP in "${NC_GROUPS[@]}"
|
||||||
do
|
do
|
||||||
|
@ -226,7 +226,7 @@ $CHECKLIST_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4)
|
||||||
"Please select which Nextcloud users shall get access to the share.
|
"Please select which Nextcloud users shall get access to the share.
|
||||||
If you select no group and no user, the external storage will be visible to all users of your instance.
|
If you select no group and no user, the external storage will be visible to all users of your instance.
|
||||||
$CHECKLIST_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4)
|
$CHECKLIST_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4)
|
||||||
NC_USER=$(occ_command_no_check user:list | sed 's|^ - ||g' | sed 's|:.*||')
|
NC_USER=$(nextcloud_occ_no_check user:list | sed 's|^ - ||g' | sed 's|:.*||')
|
||||||
mapfile -t NC_USER <<< "$NC_USER"
|
mapfile -t NC_USER <<< "$NC_USER"
|
||||||
for USER in "${NC_USER[@]}"
|
for USER in "${NC_USER[@]}"
|
||||||
do
|
do
|
||||||
|
@ -235,42 +235,42 @@ $CHECKLIST_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4)
|
||||||
SELECTED_USER=$("${args[@]}" 3>&1 1>&2 2>&3)
|
SELECTED_USER=$("${args[@]}" 3>&1 1>&2 2>&3)
|
||||||
fi
|
fi
|
||||||
# Create and mount external storage to the admin group
|
# Create and mount external storage to the admin group
|
||||||
MOUNT_ID=$(occ_command files_external:create "$NEWNAME" local null::null -c datadir="$NEWPATH" )
|
MOUNT_ID=$(nextcloud_occ files_external:create "$NEWNAME" local null::null -c datadir="$NEWPATH" )
|
||||||
MOUNT_ID=${MOUNT_ID//[!0-9]/}
|
MOUNT_ID=${MOUNT_ID//[!0-9]/}
|
||||||
# Mount to admin group if no group or user chosen
|
# Mount to admin group if no group or user chosen
|
||||||
if [ -z "$SELECTED_GROUPS" ] && [ -z "$SELECTED_USER" ]
|
if [ -z "$SELECTED_GROUPS" ] && [ -z "$SELECTED_USER" ]
|
||||||
then
|
then
|
||||||
if ! yesno_box_no "Attention! You haven't selected any Nextcloud group or user.\nIs this correct?\nIf you select 'yes', it will be visible to all users of your Nextcloud instance.\nIf you select 'no', it will be only visible to Nextcloud users in the admin group." "$SUBTITLE"
|
if ! yesno_box_no "Attention! You haven't selected any Nextcloud group or user.\nIs this correct?\nIf you select 'yes', it will be visible to all users of your Nextcloud instance.\nIf you select 'no', it will be only visible to Nextcloud users in the admin group." "$SUBTITLE"
|
||||||
then
|
then
|
||||||
occ_command files_external:applicable --add-group=admin "$MOUNT_ID" -q
|
nextcloud_occ files_external:applicable --add-group=admin "$MOUNT_ID" -q
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# Mount to chosen Nextcloud groups
|
# Mount to chosen Nextcloud groups
|
||||||
if [ -n "$SELECTED_GROUPS" ]
|
if [ -n "$SELECTED_GROUPS" ]
|
||||||
then
|
then
|
||||||
occ_command_no_check group:list | grep ".*:$" | sed 's|^ - ||g' | sed 's|:$||' | while read -r NC_GROUPS
|
nextcloud_occ_no_check group:list | grep ".*:$" | sed 's|^ - ||g' | sed 's|:$||' | while read -r NC_GROUPS
|
||||||
do
|
do
|
||||||
if [[ "$SELECTED_GROUPS" = *"$NC_GROUPS "* ]]
|
if [[ "$SELECTED_GROUPS" = *"$NC_GROUPS "* ]]
|
||||||
then
|
then
|
||||||
occ_command files_external:applicable --add-group="$NC_GROUPS" "$MOUNT_ID" -q
|
nextcloud_occ files_external:applicable --add-group="$NC_GROUPS" "$MOUNT_ID" -q
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
# Mount to chosen Nextcloud users
|
# Mount to chosen Nextcloud users
|
||||||
if [ -n "$SELECTED_USER" ]
|
if [ -n "$SELECTED_USER" ]
|
||||||
then
|
then
|
||||||
occ_command_no_check user:list | sed 's|^ - ||g' | sed 's|:.*||' | while read -r NC_USER
|
nextcloud_occ_no_check user:list | sed 's|^ - ||g' | sed 's|:.*||' | while read -r NC_USER
|
||||||
do
|
do
|
||||||
if [[ "$SELECTED_USER" = *"$NC_USER "* ]]
|
if [[ "$SELECTED_USER" = *"$NC_USER "* ]]
|
||||||
then
|
then
|
||||||
occ_command files_external:applicable --add-user="$NC_USER" "$MOUNT_ID" -q
|
nextcloud_occ files_external:applicable --add-user="$NC_USER" "$MOUNT_ID" -q
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
# Enable all other options
|
# Enable all other options
|
||||||
occ_command files_external:option "$MOUNT_ID" filesystem_check_changes 1
|
nextcloud_occ files_external:option "$MOUNT_ID" filesystem_check_changes 1
|
||||||
occ_command files_external:option "$MOUNT_ID" readonly "$READONLY"
|
nextcloud_occ files_external:option "$MOUNT_ID" readonly "$READONLY"
|
||||||
occ_command files_external:option "$MOUNT_ID" enable_sharing "$SHARING"
|
nextcloud_occ files_external:option "$MOUNT_ID" enable_sharing "$SHARING"
|
||||||
|
|
||||||
# Inform the user that mounting was successful
|
# Inform the user that mounting was successful
|
||||||
msg_box "Your mount $NEWNAME was successful, congratulations!
|
msg_box "Your mount $NEWNAME was successful, congratulations!
|
||||||
|
@ -345,12 +345,12 @@ Just press [ENTER] (on the default 'yes') to install the needed files_inotify ap
|
||||||
then
|
then
|
||||||
# This check is needed to check if the app is compatible with the current NC version
|
# This check is needed to check if the app is compatible with the current NC version
|
||||||
print_text_in_color "$ICyan" "Installing the files_inotify app..."
|
print_text_in_color "$ICyan" "Installing the files_inotify app..."
|
||||||
if ! occ_command_no_check app:install files_inotify
|
if ! nextcloud_occ_no_check app:install files_inotify
|
||||||
then
|
then
|
||||||
# Inform the user if the app couldn't get installed
|
# Inform the user if the app couldn't get installed
|
||||||
msg_box "It seems like the files_inotify app isn't compatible with the current NC version. Cannot proceed."
|
msg_box "It seems like the files_inotify app isn't compatible with the current NC version. Cannot proceed."
|
||||||
# Remove the app to be able to install it again in another try
|
# Remove the app to be able to install it again in another try
|
||||||
occ_command_no_check app:remove files_inotify
|
nextcloud_occ_no_check app:remove files_inotify
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -358,7 +358,7 @@ Just press [ENTER] (on the default 'yes') to install the needed files_inotify ap
|
||||||
# Make sure that the app is enabled, too
|
# Make sure that the app is enabled, too
|
||||||
if ! is_app_enabled files_inotify
|
if ! is_app_enabled files_inotify
|
||||||
then
|
then
|
||||||
occ_command_no_check app:enable files_inotify
|
nextcloud_occ_no_check app:enable files_inotify
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add crontab for this external storage
|
# Add crontab for this external storage
|
||||||
|
|
18
apps/talk.sh
18
apps/talk.sh
|
@ -36,7 +36,7 @@ lowest_compatible_nc 13
|
||||||
|
|
||||||
# Check if adminer is already installed
|
# Check if adminer is already installed
|
||||||
print_text_in_color "$ICyan" "Checking if Talk is already installed..."
|
print_text_in_color "$ICyan" "Checking if Talk is already installed..."
|
||||||
if [ -n "$(occ_command_no_check config:app:get spreed turn_servers | sed 's/\[\]//')" ] || is_this_installed coturn
|
if [ -n "$(nextcloud_occ_no_check config:app:get spreed turn_servers | sed 's/\[\]//')" ] || is_this_installed coturn
|
||||||
then
|
then
|
||||||
choice=$(whiptail --title "$TITLE" --menu \
|
choice=$(whiptail --title "$TITLE" --menu \
|
||||||
"It seems like 'Nextcloud Talk' is already installed.\nChoose what you want to do.
|
"It seems like 'Nextcloud Talk' is already installed.\nChoose what you want to do.
|
||||||
|
@ -47,9 +47,9 @@ $MENU_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
"Uninstall Nextcloud Talk")
|
"Uninstall Nextcloud Talk")
|
||||||
print_text_in_color "$ICyan" "Uninstalling Nextcloud Talk and resetting all settings..."
|
print_text_in_color "$ICyan" "Uninstalling Nextcloud Talk and resetting all settings..."
|
||||||
occ_command_no_check config:app:delete spreed stun_servers
|
nextcloud_occ_no_check config:app:delete spreed stun_servers
|
||||||
occ_command_no_check config:app:delete spreed turn_servers
|
nextcloud_occ_no_check config:app:delete spreed turn_servers
|
||||||
occ_command_no_check app:remove spreed
|
nextcloud_occ_no_check app:remove spreed
|
||||||
rm $TURN_CONF
|
rm $TURN_CONF
|
||||||
apt-get purge coturn -y
|
apt-get purge coturn -y
|
||||||
msg_box "Nextcloud Talk was successfully uninstalled and all settings were resetted."
|
msg_box "Nextcloud Talk was successfully uninstalled and all settings were resetted."
|
||||||
|
@ -57,9 +57,9 @@ $MENU_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
||||||
;;
|
;;
|
||||||
"Reinstall Nextcloud Talk")
|
"Reinstall Nextcloud Talk")
|
||||||
print_text_in_color "$ICyan" "Reinstalling Nextcloud Talk..."
|
print_text_in_color "$ICyan" "Reinstalling Nextcloud Talk..."
|
||||||
occ_command_no_check config:app:delete spreed stun_servers
|
nextcloud_occ_no_check config:app:delete spreed stun_servers
|
||||||
occ_command_no_check config:app:delete spreed turn_servers
|
nextcloud_occ_no_check config:app:delete spreed turn_servers
|
||||||
occ_command_no_check app:remove spreed
|
nextcloud_occ_no_check app:remove spreed
|
||||||
rm $TURN_CONF
|
rm $TURN_CONF
|
||||||
apt-get purge coturn -y
|
apt-get purge coturn -y
|
||||||
;;
|
;;
|
||||||
|
@ -176,8 +176,8 @@ TURN_SERVERS_STRING="[{\"server\":\"$TURN_DOMAIN:$TURN_PORT\",\"secret\":\"$TURN
|
||||||
if ! is_app_installed spreed
|
if ! is_app_installed spreed
|
||||||
then
|
then
|
||||||
install_and_enable_app spreed
|
install_and_enable_app spreed
|
||||||
occ_command config:app:set spreed stun_servers --value="$STUN_SERVERS_STRING" --output json
|
nextcloud_occ config:app:set spreed stun_servers --value="$STUN_SERVERS_STRING" --output json
|
||||||
occ_command config:app:set spreed turn_servers --value="$TURN_SERVERS_STRING" --output json
|
nextcloud_occ config:app:set spreed turn_servers --value="$TURN_SERVERS_STRING" --output json
|
||||||
chown -R www-data:www-data "$NC_APPS_PATH"
|
chown -R www-data:www-data "$NC_APPS_PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ check_nextcloud_https "Nextclod Talk"
|
||||||
|
|
||||||
# Check if talk/spreed is already installed
|
# Check if talk/spreed is already installed
|
||||||
print_text_in_color "$ICyan" "Checking if Talk is already installed..."
|
print_text_in_color "$ICyan" "Checking if Talk is already installed..."
|
||||||
if [ -n "$(occ_command_no_check config:app:get spreed turn_servers | sed 's/\[\]//')" ] || is_this_installed coturn
|
if [ -n "$(nextcloud_occ_no_check config:app:get spreed turn_servers | sed 's/\[\]//')" ] || is_this_installed coturn
|
||||||
then
|
then
|
||||||
choice=$(whiptail --title "$TITLE" --menu \
|
choice=$(whiptail --title "$TITLE" --menu \
|
||||||
"It seems like 'Nextcloud Talk' is already installed.\nChoose what you want to do.
|
"It seems like 'Nextcloud Talk' is already installed.\nChoose what you want to do.
|
||||||
|
@ -52,10 +52,10 @@ $MENU_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
"Uninstall Nextcloud Talk")
|
"Uninstall Nextcloud Talk")
|
||||||
print_text_in_color "$ICyan" "Uninstalling Nextcloud Talk and resetting all settings..."
|
print_text_in_color "$ICyan" "Uninstalling Nextcloud Talk and resetting all settings..."
|
||||||
occ_command_no_check config:app:delete spreed stun_servers
|
nextcloud_occ_no_check config:app:delete spreed stun_servers
|
||||||
occ_command_no_check config:app:delete spreed turn_servers
|
nextcloud_occ_no_check config:app:delete spreed turn_servers
|
||||||
occ_command_no_check config:app:delete spreed signaling_servers
|
nextcloud_occ_no_check config:app:delete spreed signaling_servers
|
||||||
occ_command_no_check app:remove spreed
|
nextcloud_occ_no_check app:remove spreed
|
||||||
rm -rf \
|
rm -rf \
|
||||||
"$TURN_CONF" \
|
"$TURN_CONF" \
|
||||||
"$SIGNALING_SERVER_CONF" \
|
"$SIGNALING_SERVER_CONF" \
|
||||||
|
@ -81,10 +81,10 @@ $MENU_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
||||||
;;
|
;;
|
||||||
"Reinstall Nextcloud Talk")
|
"Reinstall Nextcloud Talk")
|
||||||
print_text_in_color "$ICyan" "Reinstalling Nextcloud Talk..."
|
print_text_in_color "$ICyan" "Reinstalling Nextcloud Talk..."
|
||||||
occ_command_no_check config:app:delete spreed stun_servers
|
nextcloud_occ_no_check config:app:delete spreed stun_servers
|
||||||
occ_command_no_check config:app:delete spreed turn_servers
|
nextcloud_occ_no_check config:app:delete spreed turn_servers
|
||||||
occ_command_no_check config:app:delete spreed signaling_servers
|
nextcloud_occ_no_check config:app:delete spreed signaling_servers
|
||||||
occ_command_no_check app:remove spreed
|
nextcloud_occ_no_check app:remove spreed
|
||||||
rm -rf \
|
rm -rf \
|
||||||
"$TURN_CONF" \
|
"$TURN_CONF" \
|
||||||
"$SIGNALING_SERVER_CONF" \
|
"$SIGNALING_SERVER_CONF" \
|
||||||
|
@ -201,8 +201,8 @@ then
|
||||||
install_and_enable_app spreed
|
install_and_enable_app spreed
|
||||||
fi
|
fi
|
||||||
|
|
||||||
occ_command config:app:set spreed stun_servers --value="$STUN_SERVERS_STRING" --output json
|
nextcloud_occ config:app:set spreed stun_servers --value="$STUN_SERVERS_STRING" --output json
|
||||||
occ_command config:app:set spreed turn_servers --value="$TURN_SERVERS_STRING" --output json
|
nextcloud_occ config:app:set spreed turn_servers --value="$TURN_SERVERS_STRING" --output json
|
||||||
chown -R www-data:www-data "$NC_APPS_PATH"
|
chown -R www-data:www-data "$NC_APPS_PATH"
|
||||||
|
|
||||||
msg_box "Nextcloud Talk is now installed. For more information about Nextcloud Talk and its mobile apps visit:\nhttps://nextcloud.com/talk/"
|
msg_box "Nextcloud Talk is now installed. For more information about Nextcloud Talk and its mobile apps visit:\nhttps://nextcloud.com/talk/"
|
||||||
|
@ -443,7 +443,7 @@ fi
|
||||||
|
|
||||||
# Set signaling server strings
|
# Set signaling server strings
|
||||||
SIGNALING_SERVERS_STRING="{\"servers\":[{\"server\":\"https://$SUBDOMAIN/\",\"verify\":true}],\"secret\":\"$NC_SECRET\"}"
|
SIGNALING_SERVERS_STRING="{\"servers\":[{\"server\":\"https://$SUBDOMAIN/\",\"verify\":true}],\"secret\":\"$NC_SECRET\"}"
|
||||||
occ_command config:app:set spreed signaling_servers --value="$SIGNALING_SERVERS_STRING" --output json
|
nextcloud_occ config:app:set spreed signaling_servers --value="$SIGNALING_SERVERS_STRING" --output json
|
||||||
|
|
||||||
# Check that everything is working
|
# Check that everything is working
|
||||||
if ! curl -L https://"$SUBDOMAIN"/api/v1/welcome
|
if ! curl -L https://"$SUBDOMAIN"/api/v1/welcome
|
||||||
|
|
|
@ -53,7 +53,7 @@ The script will also delete everything in trashbin for all users to free up some
|
||||||
fi
|
fi
|
||||||
touch $VMLOGS/zfs_prune.log
|
touch $VMLOGS/zfs_prune.log
|
||||||
./zfs-prune-snapshots.sh 4w ncdata >> $VMLOGS/zfs_prune.log
|
./zfs-prune-snapshots.sh 4w ncdata >> $VMLOGS/zfs_prune.log
|
||||||
occ_command trashbin:cleanup --all-users >> $VMLOGS/zfs_prune.log
|
nextcloud_occ trashbin:cleanup --all-users >> $VMLOGS/zfs_prune.log
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
45
lib.sh
45
lib.sh
|
@ -578,7 +578,7 @@ fi
|
||||||
|
|
||||||
# Check if Nextcloud is installed with TLS
|
# Check if Nextcloud is installed with TLS
|
||||||
check_nextcloud_https() {
|
check_nextcloud_https() {
|
||||||
if ! occ_command_no_check config:system:get overwrite.cli.url | grep -q "https"
|
if ! nextcloud_occ_no_check config:system:get overwrite.cli.url | grep -q "https"
|
||||||
then
|
then
|
||||||
msg_box "Sorry, but Nextcloud needs to be run on HTTPS which doesn't seem to be the case here.
|
msg_box "Sorry, but Nextcloud needs to be run on HTTPS which doesn't seem to be the case here.
|
||||||
You easily activate TLS (HTTPS) by running the Let's Encrypt script.
|
You easily activate TLS (HTTPS) by running the Let's Encrypt script.
|
||||||
|
@ -835,7 +835,7 @@ if ! "$@";
|
||||||
then
|
then
|
||||||
print_text_in_color "$ICyan" "Sorry but something went wrong. Please report this issue to $ISSUES and include the output of the error message. Thank you!"
|
print_text_in_color "$ICyan" "Sorry but something went wrong. Please report this issue to $ISSUES and include the output of the error message. Thank you!"
|
||||||
print_text_in_color "$IRed" "$* failed"
|
print_text_in_color "$IRed" "$* failed"
|
||||||
if occ_command_no_check -V > /dev/null
|
if nextcloud_occ_no_check -V > /dev/null
|
||||||
then
|
then
|
||||||
notify_admin_gui \
|
notify_admin_gui \
|
||||||
"Sorry but something went wrong. Please report this issue to $ISSUES and include the output of the error message. Thank you!" \
|
"Sorry but something went wrong. Please report this issue to $ISSUES and include the output of the error message. Thank you!" \
|
||||||
|
@ -845,16 +845,25 @@ then
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Example: occ_command 'maintenance:mode --on'
|
# Example: nextcloud_occ 'maintenance:mode --on'
|
||||||
occ_command() {
|
nextcloud_occ() {
|
||||||
check_command sudo -u www-data php "$NCPATH"/occ "$@";
|
check_command sudo -u www-data php "$NCPATH"/occ "$@";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Example: occ_command_no_check 'maintenance:mode --on'
|
# Example: nextcloud_occ_no_check 'maintenance:mode --on'
|
||||||
occ_command_no_check() {
|
nextcloud_occ_no_check() {
|
||||||
sudo -u www-data php "$NCPATH"/occ "$@";
|
sudo -u www-data php "$NCPATH"/occ "$@";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Backwards compatibility (2020-10-08)
|
||||||
|
occ_command() {
|
||||||
|
nextcloud_occ
|
||||||
|
}
|
||||||
|
|
||||||
|
occ_command_no_check() {
|
||||||
|
nextcloud_occ_no_check
|
||||||
|
}
|
||||||
|
|
||||||
network_ok() {
|
network_ok() {
|
||||||
version(){
|
version(){
|
||||||
local h t v
|
local h t v
|
||||||
|
@ -914,7 +923,7 @@ calc_wt_size() {
|
||||||
|
|
||||||
# example: is_app_enabled documentserver_community
|
# example: is_app_enabled documentserver_community
|
||||||
is_app_enabled() {
|
is_app_enabled() {
|
||||||
if occ_command app:list | sed '/Disabled/,$d' | awk '{print$2}' | tr -d ':' | sed '/^$/d' | grep -q "^$1$"
|
if nextcloud_occ app:list | sed '/Disabled/,$d' | awk '{print$2}' | tr -d ':' | sed '/^$/d' | grep -q "^$1$"
|
||||||
then
|
then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
|
@ -937,12 +946,12 @@ install_and_enable_app() {
|
||||||
if ! is_app_installed "$1"
|
if ! is_app_installed "$1"
|
||||||
then
|
then
|
||||||
print_text_in_color "$ICyan" "Installing $1..."
|
print_text_in_color "$ICyan" "Installing $1..."
|
||||||
# occ_command not possible here because it uses check_command and will exit if occ_command fails
|
# nextcloud_occ not possible here because it uses check_command and will exit if nextcloud_occ fails
|
||||||
installcmd="$(occ_command_no_check app:install "$1")"
|
installcmd="$(nextcloud_occ_no_check app:install "$1")"
|
||||||
if grep 'not compatible' <<< "$installcmd"
|
if grep 'not compatible' <<< "$installcmd"
|
||||||
then
|
then
|
||||||
msg_box "The $1 app could not be installed.
|
msg_box "The $1 app could not be installed.
|
||||||
It's probably not compatible with $(occ_command -V).
|
It's probably not compatible with $(nextcloud_occ -V).
|
||||||
|
|
||||||
You can try to install the app manually after the script has finished,
|
You can try to install the app manually after the script has finished,
|
||||||
or when a new version of the app is released with the following command:
|
or when a new version of the app is released with the following command:
|
||||||
|
@ -953,13 +962,13 @@ or when a new version of the app is released with the following command:
|
||||||
# Enable $1
|
# Enable $1
|
||||||
if is_app_installed "$1"
|
if is_app_installed "$1"
|
||||||
then
|
then
|
||||||
occ_command app:enable "$1"
|
nextcloud_occ app:enable "$1"
|
||||||
chown -R www-data:www-data "$NC_APPS_PATH"
|
chown -R www-data:www-data "$NC_APPS_PATH"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
print_text_in_color "$ICyan" "It seems like $1 is installed already, trying to enable it..."
|
print_text_in_color "$ICyan" "It seems like $1 is installed already, trying to enable it..."
|
||||||
occ_command_no_check app:enable "$1"
|
nextcloud_occ_no_check app:enable "$1"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1127,7 +1136,7 @@ or experience other issues then please report this to $ISSUES"
|
||||||
yes | sudo -u www-data php /var/www/nextcloud/updater/updater.phar
|
yes | sudo -u www-data php /var/www/nextcloud/updater/updater.phar
|
||||||
download_script STATIC setup_secure_permissions_nextcloud -P $SCRIPTS
|
download_script STATIC setup_secure_permissions_nextcloud -P $SCRIPTS
|
||||||
bash $SECURE
|
bash $SECURE
|
||||||
occ_command maintenance:mode --off
|
nextcloud_occ maintenance:mode --off
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check new version
|
# Check new version
|
||||||
|
@ -1144,7 +1153,7 @@ msg_box "Your current version are still not compatible with the version required
|
||||||
|
|
||||||
To upgrade between major versions, please check this out:
|
To upgrade between major versions, please check this out:
|
||||||
https://shop.hanssonit.se/product/upgrade-between-major-owncloud-nextcloud-versions/"
|
https://shop.hanssonit.se/product/upgrade-between-major-owncloud-nextcloud-versions/"
|
||||||
occ_command -V
|
nextcloud_occ -V
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -1345,7 +1354,7 @@ esac
|
||||||
# "Subject" \
|
# "Subject" \
|
||||||
# "Message"
|
# "Message"
|
||||||
#
|
#
|
||||||
# occ_command_no_check notification:generate -l "$2" "$admin" "$1"
|
# nextcloud_occ_no_check notification:generate -l "$2" "$admin" "$1"
|
||||||
notify_admin_gui() {
|
notify_admin_gui() {
|
||||||
local NC_USERS
|
local NC_USERS
|
||||||
local user
|
local user
|
||||||
|
@ -1360,11 +1369,11 @@ print_text_in_color "$ICyan" "Posting notification to users that are admins, thi
|
||||||
send_mail "$1" "$2"
|
send_mail "$1" "$2"
|
||||||
if [ -z "${NC_ADMIN_USER[*]}" ]
|
if [ -z "${NC_ADMIN_USER[*]}" ]
|
||||||
then
|
then
|
||||||
NC_USERS=$(occ_command_no_check user:list | sed 's|^ - ||g' | sed 's|:.*||')
|
NC_USERS=$(nextcloud_occ_no_check user:list | sed 's|^ - ||g' | sed 's|:.*||')
|
||||||
mapfile -t NC_USERS <<< "$NC_USERS"
|
mapfile -t NC_USERS <<< "$NC_USERS"
|
||||||
for user in "${NC_USERS[@]}"
|
for user in "${NC_USERS[@]}"
|
||||||
do
|
do
|
||||||
if occ_command_no_check user:info "$user" | cut -d "-" -f2 | grep -x -q " admin"
|
if nextcloud_occ_no_check user:info "$user" | cut -d "-" -f2 | grep -x -q " admin"
|
||||||
then
|
then
|
||||||
NC_ADMIN_USER+=("$user")
|
NC_ADMIN_USER+=("$user")
|
||||||
fi
|
fi
|
||||||
|
@ -1374,7 +1383,7 @@ fi
|
||||||
for admin in "${NC_ADMIN_USER[@]}"
|
for admin in "${NC_ADMIN_USER[@]}"
|
||||||
do
|
do
|
||||||
print_text_in_color "$IGreen" "Posting '$1' to: $admin"
|
print_text_in_color "$IGreen" "Posting '$1' to: $admin"
|
||||||
occ_command_no_check notification:generate -l "$2" "$admin" "$1"
|
nextcloud_occ_no_check notification:generate -l "$2" "$admin" "$1"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ case "$choice" in
|
||||||
msg_box "This option will make all Nextcloud shares from other users appear in a folder named 'Shared' in the Nextcloud GUI.\n\nIf you don't enable this option, all shares will appear directly in the Nextcloud GUI root folder, which is the default behaviour." "$SUBTITLE"
|
msg_box "This option will make all Nextcloud shares from other users appear in a folder named 'Shared' in the Nextcloud GUI.\n\nIf you don't enable this option, all shares will appear directly in the Nextcloud GUI root folder, which is the default behaviour." "$SUBTITLE"
|
||||||
if yesno_box_yes "Do you want to enable this option?" "$SUBTITLE"
|
if yesno_box_yes "Do you want to enable this option?" "$SUBTITLE"
|
||||||
then
|
then
|
||||||
occ_command config:system:set share_folder --value="/Shared"
|
nextcloud_occ config:system:set share_folder --value="/Shared"
|
||||||
msg_box "All new Nextcloud shares from other users will appear in the 'Shared' folder from now on." "$SUBTITLE"
|
msg_box "All new Nextcloud shares from other users will appear in the 'Shared' folder from now on." "$SUBTITLE"
|
||||||
fi
|
fi
|
||||||
;;&
|
;;&
|
||||||
|
@ -66,7 +66,7 @@ case "$choice" in
|
||||||
sleep 1
|
sleep 1
|
||||||
else
|
else
|
||||||
# Disable workspaces
|
# Disable workspaces
|
||||||
occ_command config:app:set text workspace_available --value=0
|
nextcloud_occ config:app:set text workspace_available --value=0
|
||||||
msg_box "Rich workspaces are now disabled." "$SUBTITLE"
|
msg_box "Rich workspaces are now disabled." "$SUBTITLE"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -80,7 +80,7 @@ case "$choice" in
|
||||||
msg_box "This option will disable the with Nextcloud 18 introduced user flows. It will disable the user flow settings. Admin flows will continue to work." "$SUBTITLE"
|
msg_box "This option will disable the with Nextcloud 18 introduced user flows. It will disable the user flow settings. Admin flows will continue to work." "$SUBTITLE"
|
||||||
if yesno_box_yes "Do you want to disable user flows?" "$SUBTITLE"
|
if yesno_box_yes "Do you want to disable user flows?" "$SUBTITLE"
|
||||||
then
|
then
|
||||||
occ_command config:app:set workflowengine user_scope_disabled --value yes
|
nextcloud_occ config:app:set workflowengine user_scope_disabled --value yes
|
||||||
msg_box "User flow settings are now disabled." "$SUBTITLE"
|
msg_box "User flow settings are now disabled." "$SUBTITLE"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
@ -95,7 +95,7 @@ case "$choice" in
|
||||||
if yesno_box_yes "Do you want to enable logrotate for Nextcloud logs?" "$SUBTITLE"
|
if yesno_box_yes "Do you want to enable logrotate for Nextcloud logs?" "$SUBTITLE"
|
||||||
then
|
then
|
||||||
# Set logrotate (without size restriction)
|
# Set logrotate (without size restriction)
|
||||||
occ_command config:system:set log_rotate_size --value=0
|
nextcloud_occ config:system:set log_rotate_size --value=0
|
||||||
|
|
||||||
# Configure logrotate to rotate logs for us (max 10, every day a new one)
|
# Configure logrotate to rotate logs for us (max 10, every day a new one)
|
||||||
cat << NEXTCLOUD_CONF > /etc/logrotate.d/nextcloud.log.conf
|
cat << NEXTCLOUD_CONF > /etc/logrotate.d/nextcloud.log.conf
|
||||||
|
|
|
@ -100,7 +100,7 @@ case "$choice" in
|
||||||
sed -i "s|;date.timezone.*|date.timezone = $(cat /etc/timezone)|g" "$PHP_INI"
|
sed -i "s|;date.timezone.*|date.timezone = $(cat /etc/timezone)|g" "$PHP_INI"
|
||||||
|
|
||||||
# Change timezone for logging
|
# Change timezone for logging
|
||||||
occ_command config:system:set logtimezone --value="$(cat /etc/timezone)"
|
nextcloud_occ config:system:set logtimezone --value="$(cat /etc/timezone)"
|
||||||
clear
|
clear
|
||||||
msg_box "The timezone was changed successfully." "$SUBTITLE"
|
msg_box "The timezone was changed successfully." "$SUBTITLE"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -297,15 +297,15 @@ clear
|
||||||
sed -i "s|;date.timezone.*|date.timezone = $(cat /etc/timezone)|g" "$PHP_INI"
|
sed -i "s|;date.timezone.*|date.timezone = $(cat /etc/timezone)|g" "$PHP_INI"
|
||||||
|
|
||||||
# Change timezone for logging
|
# Change timezone for logging
|
||||||
occ_command config:system:set logtimezone --value="$(cat /etc/timezone)"
|
nextcloud_occ config:system:set logtimezone --value="$(cat /etc/timezone)"
|
||||||
clear
|
clear
|
||||||
|
|
||||||
# Pretty URLs
|
# Pretty URLs
|
||||||
print_text_in_color "$ICyan" "Setting RewriteBase to \"/\" in config.php..."
|
print_text_in_color "$ICyan" "Setting RewriteBase to \"/\" in config.php..."
|
||||||
chown -R www-data:www-data $NCPATH
|
chown -R www-data:www-data $NCPATH
|
||||||
occ_command config:system:set overwrite.cli.url --value="http://localhost/"
|
nextcloud_occ config:system:set overwrite.cli.url --value="http://localhost/"
|
||||||
occ_command config:system:set htaccess.RewriteBase --value="/"
|
nextcloud_occ config:system:set htaccess.RewriteBase --value="/"
|
||||||
occ_command maintenance:update:htaccess
|
nextcloud_occ maintenance:update:htaccess
|
||||||
bash $SECURE & spinner_loading
|
bash $SECURE & spinner_loading
|
||||||
|
|
||||||
# Generate new SSH Keys
|
# Generate new SSH Keys
|
||||||
|
@ -351,7 +351,7 @@ unset UNIX_PASSWORD
|
||||||
clear
|
clear
|
||||||
|
|
||||||
# NEXTCLOUD USER
|
# NEXTCLOUD USER
|
||||||
NCADMIN=$(occ_command user:list | awk '{print $3}')
|
NCADMIN=$(nextcloud_occ user:list | awk '{print $3}')
|
||||||
msg_box "We will now change the username and password for the Web Admin in Nextcloud."
|
msg_box "We will now change the username and password for the Web Admin in Nextcloud."
|
||||||
while :
|
while :
|
||||||
do
|
do
|
||||||
|
@ -393,7 +393,7 @@ done
|
||||||
if [[ "$NCADMIN" ]]
|
if [[ "$NCADMIN" ]]
|
||||||
then
|
then
|
||||||
print_text_in_color "$ICyan" "Deleting $NCADMIN..."
|
print_text_in_color "$ICyan" "Deleting $NCADMIN..."
|
||||||
occ_command user:delete "$NCADMIN"
|
nextcloud_occ user:delete "$NCADMIN"
|
||||||
sleep 2
|
sleep 2
|
||||||
fi
|
fi
|
||||||
clear
|
clear
|
||||||
|
@ -462,7 +462,7 @@ bash "$SCRIPTS"/temporary-fix.sh
|
||||||
rm "$SCRIPTS"/temporary-fix.sh
|
rm "$SCRIPTS"/temporary-fix.sh
|
||||||
|
|
||||||
# Cleanup 1
|
# Cleanup 1
|
||||||
occ_command maintenance:repair
|
nextcloud_occ maintenance:repair
|
||||||
rm -f "$SCRIPTS/ip.sh"
|
rm -f "$SCRIPTS/ip.sh"
|
||||||
rm -f "$SCRIPTS/change_db_pass.sh"
|
rm -f "$SCRIPTS/change_db_pass.sh"
|
||||||
rm -f "$SCRIPTS/instruction.sh"
|
rm -f "$SCRIPTS/instruction.sh"
|
||||||
|
|
|
@ -419,7 +419,7 @@ bash $SECURE & spinner_loading
|
||||||
# Install Nextcloud
|
# Install Nextcloud
|
||||||
print_text_in_color "$ICyan" "Installing Nextcloud..."
|
print_text_in_color "$ICyan" "Installing Nextcloud..."
|
||||||
cd "$NCPATH"
|
cd "$NCPATH"
|
||||||
occ_command maintenance:install \
|
nextcloud_occ maintenance:install \
|
||||||
--data-dir="$NCDATA" \
|
--data-dir="$NCDATA" \
|
||||||
--database=pgsql \
|
--database=pgsql \
|
||||||
--database-name=nextcloud_db \
|
--database-name=nextcloud_db \
|
||||||
|
@ -429,7 +429,7 @@ occ_command maintenance:install \
|
||||||
--admin-pass="$NCPASS"
|
--admin-pass="$NCPASS"
|
||||||
echo
|
echo
|
||||||
print_text_in_color "$ICyan" "Nextcloud version:"
|
print_text_in_color "$ICyan" "Nextcloud version:"
|
||||||
occ_command status
|
nextcloud_occ status
|
||||||
sleep 3
|
sleep 3
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
@ -437,8 +437,8 @@ echo
|
||||||
crontab -u www-data -l | { cat; echo "*/5 * * * * php -f $NCPATH/cron.php > /dev/null 2>&1"; } | crontab -u www-data -
|
crontab -u www-data -l | { cat; echo "*/5 * * * * php -f $NCPATH/cron.php > /dev/null 2>&1"; } | crontab -u www-data -
|
||||||
|
|
||||||
# Run the updatenotification on a schelude
|
# Run the updatenotification on a schelude
|
||||||
occ_command config:system:set upgrade.disable-web --value="true"
|
nextcloud_occ config:system:set upgrade.disable-web --value="true"
|
||||||
occ_command config:app:set updatenotification notify_groups --value="[]"
|
nextcloud_occ config:app:set updatenotification notify_groups --value="[]"
|
||||||
print_text_in_color "$ICyan" "Configuring update notifications specific for this server..."
|
print_text_in_color "$ICyan" "Configuring update notifications specific for this server..."
|
||||||
download_script STATIC updatenotification
|
download_script STATIC updatenotification
|
||||||
check_command chmod +x "$SCRIPTS"/updatenotification.sh
|
check_command chmod +x "$SCRIPTS"/updatenotification.sh
|
||||||
|
@ -457,31 +457,31 @@ sed -i "s|post_max_size =.*|post_max_size = 1100M|g" "$PHP_INI"
|
||||||
sed -i "s|upload_max_filesize =.*|upload_max_filesize = 1000M|g" "$PHP_INI"
|
sed -i "s|upload_max_filesize =.*|upload_max_filesize = 1000M|g" "$PHP_INI"
|
||||||
|
|
||||||
# Set loggging
|
# Set loggging
|
||||||
occ_command config:system:set log_type --value=file
|
nextcloud_occ config:system:set log_type --value=file
|
||||||
occ_command config:system:set logfile --value="$VMLOGS/nextcloud.log"
|
nextcloud_occ config:system:set logfile --value="$VMLOGS/nextcloud.log"
|
||||||
rm -f "$NCDATA/nextcloud.log"
|
rm -f "$NCDATA/nextcloud.log"
|
||||||
occ_command config:system:set loglevel --value=2
|
nextcloud_occ config:system:set loglevel --value=2
|
||||||
install_and_enable_app admin_audit
|
install_and_enable_app admin_audit
|
||||||
occ_command config:app:set admin_audit logfile --value="$VMLOGS/audit.log"
|
nextcloud_occ config:app:set admin_audit logfile --value="$VMLOGS/audit.log"
|
||||||
occ_command config:system:set log.condition apps 0 --value admin_audit
|
nextcloud_occ config:system:set log.condition apps 0 --value admin_audit
|
||||||
|
|
||||||
# Set SMTP mail
|
# Set SMTP mail
|
||||||
occ_command config:system:set mail_smtpmode --value="smtp"
|
nextcloud_occ config:system:set mail_smtpmode --value="smtp"
|
||||||
|
|
||||||
# Forget login/session after 30 minutes
|
# Forget login/session after 30 minutes
|
||||||
occ_command config:system:set remember_login_cookie_lifetime --value="1800"
|
nextcloud_occ config:system:set remember_login_cookie_lifetime --value="1800"
|
||||||
|
|
||||||
# Set logrotate (max 10 MB)
|
# Set logrotate (max 10 MB)
|
||||||
occ_command config:system:set log_rotate_size --value="10485760"
|
nextcloud_occ config:system:set log_rotate_size --value="10485760"
|
||||||
|
|
||||||
# Set trashbin retention obligation (save it in trahbin for 6 months or delete when space is needed)
|
# Set trashbin retention obligation (save it in trahbin for 6 months or delete when space is needed)
|
||||||
occ_command config:system:set trashbin_retention_obligation --value="auto, 180"
|
nextcloud_occ config:system:set trashbin_retention_obligation --value="auto, 180"
|
||||||
|
|
||||||
# Set versions retention obligation (save versions for 12 months or delete when space is needed)
|
# Set versions retention obligation (save versions for 12 months or delete when space is needed)
|
||||||
occ_command config:system:set versions_retention_obligation --value="auto, 365"
|
nextcloud_occ config:system:set versions_retention_obligation --value="auto, 365"
|
||||||
|
|
||||||
# Remove simple signup
|
# Remove simple signup
|
||||||
occ_command config:system:set simpleSignUpLink.shown --type=bool --value=false
|
nextcloud_occ config:system:set simpleSignUpLink.shown --type=bool --value=false
|
||||||
|
|
||||||
# Enable OPCache for PHP
|
# Enable OPCache for PHP
|
||||||
# https://docs.nextcloud.com/server/14/admin_manual/configuration_server/server_tuning.html#enable-php-opcache
|
# https://docs.nextcloud.com/server/14/admin_manual/configuration_server/server_tuning.html#enable-php-opcache
|
||||||
|
@ -587,15 +587,15 @@ fi
|
||||||
|
|
||||||
# Fix https://github.com/nextcloud/vm/issues/714
|
# Fix https://github.com/nextcloud/vm/issues/714
|
||||||
print_text_in_color "$ICyan" "Optimizing Nextcloud..."
|
print_text_in_color "$ICyan" "Optimizing Nextcloud..."
|
||||||
yes | occ_command db:convert-filecache-bigint
|
yes | nextcloud_occ db:convert-filecache-bigint
|
||||||
occ_command db:add-missing-indices
|
nextcloud_occ db:add-missing-indices
|
||||||
while [ -z "$CURRENTVERSION" ]
|
while [ -z "$CURRENTVERSION" ]
|
||||||
do
|
do
|
||||||
CURRENTVERSION=$(sudo -u www-data php $NCPATH/occ status | grep "versionstring" | awk '{print $3}')
|
CURRENTVERSION=$(sudo -u www-data php $NCPATH/occ status | grep "versionstring" | awk '{print $3}')
|
||||||
done
|
done
|
||||||
if [ "${CURRENTVERSION%%.*}" -ge "19" ]
|
if [ "${CURRENTVERSION%%.*}" -ge "19" ]
|
||||||
then
|
then
|
||||||
occ_command db:add-missing-columns
|
nextcloud_occ db:add-missing-columns
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install Figlet
|
# Install Figlet
|
||||||
|
|
|
@ -301,10 +301,10 @@ fi
|
||||||
# Update all Nextcloud apps
|
# Update all Nextcloud apps
|
||||||
if [ "${CURRENTVERSION%%.*}" -ge "15" ]
|
if [ "${CURRENTVERSION%%.*}" -ge "15" ]
|
||||||
then
|
then
|
||||||
occ_command maintenance:mode --off
|
nextcloud_occ maintenance:mode --off
|
||||||
# Check for upgrades
|
# Check for upgrades
|
||||||
print_text_in_color "$ICyan" "Trying to automatically update all Nextcloud apps..."
|
print_text_in_color "$ICyan" "Trying to automatically update all Nextcloud apps..."
|
||||||
UPDATED_APPS="$(occ_command_no_check app:update --all)"
|
UPDATED_APPS="$(nextcloud_occ_no_check app:update --all)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check which apps got updated
|
# Check which apps got updated
|
||||||
|
@ -440,7 +440,7 @@ countdown "Backing up files and upgrading to Nextcloud $NCVERSION in 10 seconds.
|
||||||
# Backup app status
|
# Backup app status
|
||||||
# Fixing https://github.com/nextcloud/server/issues/4538
|
# Fixing https://github.com/nextcloud/server/issues/4538
|
||||||
print_text_in_color "$ICyan" "Getting and backing up the status of apps for later, this might take a while..."
|
print_text_in_color "$ICyan" "Getting and backing up the status of apps for later, this might take a while..."
|
||||||
NC_APPS="$(occ_command app:list | awk '{print$2}' | tr -d ':' | sed '/^$/d')"
|
NC_APPS="$(nextcloud_occ app:list | awk '{print$2}' | tr -d ':' | sed '/^$/d')"
|
||||||
if [ -z "$NC_APPS" ]
|
if [ -z "$NC_APPS" ]
|
||||||
then
|
then
|
||||||
print_text_in_color "$IRed" "No apps detected, aborting export of app status... Please report this issue to $ISSUES"
|
print_text_in_color "$IRed" "No apps detected, aborting export of app status... Please report this issue to $ISSUES"
|
||||||
|
@ -449,7 +449,7 @@ else
|
||||||
declare -Ag APPSTORAGE
|
declare -Ag APPSTORAGE
|
||||||
for app in $NC_APPS
|
for app in $NC_APPS
|
||||||
do
|
do
|
||||||
APPSTORAGE[$app]=$(occ_command_no_check config:app:get "$app" enabled)
|
APPSTORAGE[$app]=$(nextcloud_occ_no_check config:app:get "$app" enabled)
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -544,7 +544,7 @@ then
|
||||||
print_text_in_color "$ICyan" "$BACKUP/apps/ exists"
|
print_text_in_color "$ICyan" "$BACKUP/apps/ exists"
|
||||||
echo
|
echo
|
||||||
print_text_in_color "$IGreen" "All files are backed up."
|
print_text_in_color "$IGreen" "All files are backed up."
|
||||||
occ_command maintenance:mode --on
|
nextcloud_occ maintenance:mode --on
|
||||||
countdown "Removing old Nextcloud instance in 5 seconds..." "5"
|
countdown "Removing old Nextcloud instance in 5 seconds..." "5"
|
||||||
rm -rf $NCPATH
|
rm -rf $NCPATH
|
||||||
print_text_in_color "$IGreen" "Extracting new package...."
|
print_text_in_color "$IGreen" "Extracting new package...."
|
||||||
|
@ -553,17 +553,17 @@ then
|
||||||
print_text_in_color "$IGreen" "Restoring config to Nextcloud..."
|
print_text_in_color "$IGreen" "Restoring config to Nextcloud..."
|
||||||
rsync -Aaxz $BACKUP/config "$NCPATH"/
|
rsync -Aaxz $BACKUP/config "$NCPATH"/
|
||||||
bash $SECURE & spinner_loading
|
bash $SECURE & spinner_loading
|
||||||
occ_command maintenance:mode --off
|
nextcloud_occ maintenance:mode --off
|
||||||
occ_command upgrade
|
nextcloud_occ upgrade
|
||||||
# Optimize
|
# Optimize
|
||||||
print_text_in_color "$ICyan" "Optimizing Nextcloud..."
|
print_text_in_color "$ICyan" "Optimizing Nextcloud..."
|
||||||
yes | occ_command db:convert-filecache-bigint
|
yes | nextcloud_occ db:convert-filecache-bigint
|
||||||
occ_command db:add-missing-indices
|
nextcloud_occ db:add-missing-indices
|
||||||
CURRENTVERSION=$(sudo -u www-data php $NCPATH/occ status | grep "versionstring" | awk '{print $3}')
|
CURRENTVERSION=$(sudo -u www-data php $NCPATH/occ status | grep "versionstring" | awk '{print $3}')
|
||||||
if [ "${CURRENTVERSION%%.*}" -ge "19" ]
|
if [ "${CURRENTVERSION%%.*}" -ge "19" ]
|
||||||
then
|
then
|
||||||
check_php
|
check_php
|
||||||
occ_command db:add-missing-columns
|
nextcloud_occ db:add-missing-columns
|
||||||
install_if_not php"$PHPVER"-bcmath
|
install_if_not php"$PHPVER"-bcmath
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
@ -636,7 +636,7 @@ then
|
||||||
then
|
then
|
||||||
if is_app_enabled "$app"
|
if is_app_enabled "$app"
|
||||||
then
|
then
|
||||||
occ_command_no_check config:app:set "$app" enabled --value="${APPSTORAGE[$app]}"
|
nextcloud_occ_no_check config:app:set "$app" enabled --value="${APPSTORAGE[$app]}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -659,12 +659,12 @@ chown -R root:root "$BACKUP"
|
||||||
# Pretty URLs
|
# Pretty URLs
|
||||||
print_text_in_color "$ICyan" "Setting RewriteBase to \"/\" in config.php..."
|
print_text_in_color "$ICyan" "Setting RewriteBase to \"/\" in config.php..."
|
||||||
chown -R www-data:www-data "$NCPATH"
|
chown -R www-data:www-data "$NCPATH"
|
||||||
occ_command config:system:set htaccess.RewriteBase --value="/"
|
nextcloud_occ config:system:set htaccess.RewriteBase --value="/"
|
||||||
occ_command maintenance:update:htaccess
|
nextcloud_occ maintenance:update:htaccess
|
||||||
bash "$SECURE"
|
bash "$SECURE"
|
||||||
|
|
||||||
# Repair
|
# Repair
|
||||||
occ_command maintenance:repair
|
nextcloud_occ maintenance:repair
|
||||||
|
|
||||||
# Create $VMLOGS dir
|
# Create $VMLOGS dir
|
||||||
if [ ! -d "$VMLOGS" ]
|
if [ ! -d "$VMLOGS" ]
|
||||||
|
@ -672,7 +672,7 @@ then
|
||||||
mkdir -p "$VMLOGS"
|
mkdir -p "$VMLOGS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CURRENTVERSION_after=$(occ_command status | grep "versionstring" | awk '{print $3}')
|
CURRENTVERSION_after=$(nextcloud_occ status | grep "versionstring" | awk '{print $3}')
|
||||||
if [[ "$NCVERSION" == "$CURRENTVERSION_after" ]] || [ -n "$PRERELEASE_VERSION" ]
|
if [[ "$NCVERSION" == "$CURRENTVERSION_after" ]] || [ -n "$PRERELEASE_VERSION" ]
|
||||||
then
|
then
|
||||||
msg_box "Latest version is: $NCVERSION. Current version is: $CURRENTVERSION_after.
|
msg_box "Latest version is: $NCVERSION. Current version is: $CURRENTVERSION_after.
|
||||||
|
@ -683,8 +683,8 @@ If you notice that some apps are disabled it's due to that they are not compatib
|
||||||
To recover your old apps, please check $BACKUP/apps and copy them to $NCPATH/apps manually.
|
To recover your old apps, please check $BACKUP/apps and copy them to $NCPATH/apps manually.
|
||||||
|
|
||||||
Thank you for using T&M Hansson IT's updater!"
|
Thank you for using T&M Hansson IT's updater!"
|
||||||
occ_command status
|
nextcloud_occ status
|
||||||
occ_command maintenance:mode --off
|
nextcloud_occ maintenance:mode --off
|
||||||
print_text_in_color "$ICyan" "Sending notification about the successful update to all admins..."
|
print_text_in_color "$ICyan" "Sending notification about the successful update to all admins..."
|
||||||
notify_admin_gui \
|
notify_admin_gui \
|
||||||
"Nextcloud is now updated!" \
|
"Nextcloud is now updated!" \
|
||||||
|
@ -703,6 +703,6 @@ Maintenance mode is kept on."
|
||||||
notify_admin_gui \
|
notify_admin_gui \
|
||||||
"Nextcloud update failed!" \
|
"Nextcloud update failed!" \
|
||||||
"Your Nextcloud update failed, please check the logs at $VMLOGS/update.log"
|
"Your Nextcloud update failed, please check the logs at $VMLOGS/update.log"
|
||||||
occ_command status
|
nextcloud_occ status
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -249,7 +249,7 @@ add_user() {
|
||||||
|
|
||||||
# Check if the user already exists
|
# Check if the user already exists
|
||||||
NEWNAME_TRANSLATED=$(echo "$NEWNAME" | tr "[:upper:]" "[:lower:]")
|
NEWNAME_TRANSLATED=$(echo "$NEWNAME" | tr "[:upper:]" "[:lower:]")
|
||||||
NEXTCLOUD_USERS=$(occ_command_no_check user:list | sed 's|^ - ||g' | sed 's|:.*||' | tr "[:upper:]" "[:lower:]")
|
NEXTCLOUD_USERS=$(nextcloud_occ_no_check user:list | sed 's|^ - ||g' | sed 's|:.*||' | tr "[:upper:]" "[:lower:]")
|
||||||
if echo "$NEXTCLOUD_USERS" | grep -q "^$NEWNAME_TRANSLATED$"
|
if echo "$NEXTCLOUD_USERS" | grep -q "^$NEWNAME_TRANSLATED$"
|
||||||
then
|
then
|
||||||
msg_box "This Nextcloud user already exists. No chance to add it as a user to Nextcloud." "$SUBTITLE"
|
msg_box "This Nextcloud user already exists. No chance to add it as a user to Nextcloud." "$SUBTITLE"
|
||||||
|
@ -394,7 +394,7 @@ do
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if a NC account with the same name exists
|
# Check if a NC account with the same name exists
|
||||||
NEXTCLOUD_USERS=$(occ_command_no_check user:list | sed 's|^ - ||g' | sed 's|:.*||')
|
NEXTCLOUD_USERS=$(nextcloud_occ_no_check user:list | sed 's|^ - ||g' | sed 's|:.*||')
|
||||||
if ! echo "$NEXTCLOUD_USERS" | grep -q "^$user$"
|
if ! echo "$NEXTCLOUD_USERS" | grep -q "^$user$"
|
||||||
then
|
then
|
||||||
msg_box "There doesn't exist any user with this name $user in Nextcloud. No chance to change the password of the Nextcloud account." "$SUBTITLE"
|
msg_box "There doesn't exist any user with this name $user in Nextcloud. No chance to change the password of the Nextcloud account." "$SUBTITLE"
|
||||||
|
@ -806,7 +806,7 @@ $CHECKLIST_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
||||||
"Please select which Nextcloud groups shall get access to the new external storage $NEWNAME.
|
"Please select which Nextcloud groups shall get access to the new external storage $NEWNAME.
|
||||||
If you select no group and no user, the external storage will be visible to all users of your instance.
|
If you select no group and no user, the external storage will be visible to all users of your instance.
|
||||||
$CHECKLIST_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4)
|
$CHECKLIST_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4)
|
||||||
NC_GROUPS=$(occ_command_no_check group:list | grep ".*:$" | sed 's|^ - ||g' | sed 's|:$||g')
|
NC_GROUPS=$(nextcloud_occ_no_check group:list | grep ".*:$" | sed 's|^ - ||g' | sed 's|:$||g')
|
||||||
mapfile -t NC_GROUPS <<< "$NC_GROUPS"
|
mapfile -t NC_GROUPS <<< "$NC_GROUPS"
|
||||||
for GROUP in "${NC_GROUPS[@]}"
|
for GROUP in "${NC_GROUPS[@]}"
|
||||||
do
|
do
|
||||||
|
@ -827,7 +827,7 @@ $CHECKLIST_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4)
|
||||||
"Please select which Nextcloud users shall get access to the new external storage $NEWNAME.
|
"Please select which Nextcloud users shall get access to the new external storage $NEWNAME.
|
||||||
If you select no group and no user, the external storage will be visible to all users of your instance.
|
If you select no group and no user, the external storage will be visible to all users of your instance.
|
||||||
$CHECKLIST_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4)
|
$CHECKLIST_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4)
|
||||||
NC_USER=$(occ_command_no_check user:list | sed 's|^ - ||g' | sed 's|:.*||')
|
NC_USER=$(nextcloud_occ_no_check user:list | sed 's|^ - ||g' | sed 's|:.*||')
|
||||||
mapfile -t NC_USER <<< "$NC_USER"
|
mapfile -t NC_USER <<< "$NC_USER"
|
||||||
for USER in "${NC_USER[@]}"
|
for USER in "${NC_USER[@]}"
|
||||||
do
|
do
|
||||||
|
@ -837,7 +837,7 @@ $CHECKLIST_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create and mount external storage
|
# Create and mount external storage
|
||||||
MOUNT_ID=$(occ_command files_external:create "$NEWNAME" local null::null -c datadir="$NEWPATH" )
|
MOUNT_ID=$(nextcloud_occ files_external:create "$NEWNAME" local null::null -c datadir="$NEWPATH" )
|
||||||
MOUNT_ID=${MOUNT_ID//[!0-9]/}
|
MOUNT_ID=${MOUNT_ID//[!0-9]/}
|
||||||
|
|
||||||
# Mount it to the admin group if no group or user chosen
|
# Mount it to the admin group if no group or user chosen
|
||||||
|
@ -845,18 +845,18 @@ $CHECKLIST_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4)
|
||||||
then
|
then
|
||||||
if ! yesno_box_no "Attention! You haven't selected any Nextcloud group or user.\nIs this correct?\nIf you select 'yes', it will be visible to all users of your Nextcloud instance.\nIf you select 'no', it will be only visible to Nextcloud users in the admin group." "$SUBTITLE"
|
if ! yesno_box_no "Attention! You haven't selected any Nextcloud group or user.\nIs this correct?\nIf you select 'yes', it will be visible to all users of your Nextcloud instance.\nIf you select 'no', it will be only visible to Nextcloud users in the admin group." "$SUBTITLE"
|
||||||
then
|
then
|
||||||
occ_command files_external:applicable --add-group=admin "$MOUNT_ID" -q
|
nextcloud_occ files_external:applicable --add-group=admin "$MOUNT_ID" -q
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Mount it to selected groups
|
# Mount it to selected groups
|
||||||
if [ -n "$SELECTED_GROUPS" ]
|
if [ -n "$SELECTED_GROUPS" ]
|
||||||
then
|
then
|
||||||
occ_command_no_check group:list | grep ".*:$" | sed 's|^ - ||g' | sed 's|:$||' | while read -r NC_GROUPS
|
nextcloud_occ_no_check group:list | grep ".*:$" | sed 's|^ - ||g' | sed 's|:$||' | while read -r NC_GROUPS
|
||||||
do
|
do
|
||||||
if [[ "$SELECTED_GROUPS" = *"$NC_GROUPS "* ]]
|
if [[ "$SELECTED_GROUPS" = *"$NC_GROUPS "* ]]
|
||||||
then
|
then
|
||||||
occ_command files_external:applicable --add-group="$NC_GROUPS" "$MOUNT_ID" -q
|
nextcloud_occ files_external:applicable --add-group="$NC_GROUPS" "$MOUNT_ID" -q
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
@ -864,19 +864,19 @@ $CHECKLIST_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4)
|
||||||
# Mount it to selected users
|
# Mount it to selected users
|
||||||
if [ -n "$SELECTED_USER" ]
|
if [ -n "$SELECTED_USER" ]
|
||||||
then
|
then
|
||||||
occ_command_no_check user:list | sed 's|^ - ||g' | sed 's|:.*||' | while read -r NC_USER
|
nextcloud_occ_no_check user:list | sed 's|^ - ||g' | sed 's|:.*||' | while read -r NC_USER
|
||||||
do
|
do
|
||||||
if [[ "$SELECTED_USER" = *"$NC_USER "* ]]
|
if [[ "$SELECTED_USER" = *"$NC_USER "* ]]
|
||||||
then
|
then
|
||||||
occ_command files_external:applicable --add-user="$NC_USER" "$MOUNT_ID" -q
|
nextcloud_occ files_external:applicable --add-user="$NC_USER" "$MOUNT_ID" -q
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set up all other settings
|
# Set up all other settings
|
||||||
occ_command files_external:option "$MOUNT_ID" filesystem_check_changes 1
|
nextcloud_occ files_external:option "$MOUNT_ID" filesystem_check_changes 1
|
||||||
occ_command files_external:option "$MOUNT_ID" readonly "$READONLY"
|
nextcloud_occ files_external:option "$MOUNT_ID" readonly "$READONLY"
|
||||||
occ_command files_external:option "$MOUNT_ID" enable_sharing "$SHARING"
|
nextcloud_occ files_external:option "$MOUNT_ID" enable_sharing "$SHARING"
|
||||||
|
|
||||||
# Inform the user that mounting was successful
|
# Inform the user that mounting was successful
|
||||||
msg_box "Your mount $NEWNAME was successful, congratulations!
|
msg_box "Your mount $NEWNAME was successful, congratulations!
|
||||||
|
@ -951,12 +951,12 @@ Just press [ENTER] (on the default 'yes') to install the needed files_inotify ap
|
||||||
then
|
then
|
||||||
# This check is needed to check if the app is compatible with the current NC version
|
# This check is needed to check if the app is compatible with the current NC version
|
||||||
print_text_in_color "$ICyan" "Installing the files_inotify app..."
|
print_text_in_color "$ICyan" "Installing the files_inotify app..."
|
||||||
if ! occ_command_no_check app:install files_inotify
|
if ! nextcloud_occ_no_check app:install files_inotify
|
||||||
then
|
then
|
||||||
# Inform the user if the app couldn't get installed
|
# Inform the user if the app couldn't get installed
|
||||||
msg_box "It seems like the files_inotify app isn't compatible with the current NC version. Cannot proceed."
|
msg_box "It seems like the files_inotify app isn't compatible with the current NC version. Cannot proceed."
|
||||||
# Remove the app to be able to install it again in another try
|
# Remove the app to be able to install it again in another try
|
||||||
occ_command_no_check app:remove files_inotify
|
nextcloud_occ_no_check app:remove files_inotify
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -964,7 +964,7 @@ Just press [ENTER] (on the default 'yes') to install the needed files_inotify ap
|
||||||
# Make sure that the app is enabled, too
|
# Make sure that the app is enabled, too
|
||||||
if ! is_app_enabled files_inotify
|
if ! is_app_enabled files_inotify
|
||||||
then
|
then
|
||||||
occ_command_no_check app:enable files_inotify
|
nextcloud_occ_no_check app:enable files_inotify
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add crontab for this external storage
|
# Add crontab for this external storage
|
||||||
|
|
|
@ -51,15 +51,15 @@ fi
|
||||||
if [ -d "$NC_APPS_PATH/spreedme" ]
|
if [ -d "$NC_APPS_PATH/spreedme" ]
|
||||||
then
|
then
|
||||||
# Remove
|
# Remove
|
||||||
occ_command app:disable spreedme
|
nextcloud_occ app:disable spreedme
|
||||||
print_text_in_color "$ICyan" "Spreed.ME app already seems to be installed and will now be re-installed..."
|
print_text_in_color "$ICyan" "Spreed.ME app already seems to be installed and will now be re-installed..."
|
||||||
rm -R "$NC_APPS_PATH/spreedme"
|
rm -R "$NC_APPS_PATH/spreedme"
|
||||||
# Reinstall
|
# Reinstall
|
||||||
occ_command app:install spreedme
|
nextcloud_occ app:install spreedme
|
||||||
else
|
else
|
||||||
occ_command app:install spreedme
|
nextcloud_occ app:install spreedme
|
||||||
fi
|
fi
|
||||||
occ_command app:enable spreedme
|
nextcloud_occ app:enable spreedme
|
||||||
chown -R www-data:www-data "$NC_APPS_PATH"
|
chown -R www-data:www-data "$NC_APPS_PATH"
|
||||||
|
|
||||||
# Generate secret keys
|
# Generate secret keys
|
||||||
|
|
|
@ -33,22 +33,22 @@ $MENU_GUIDE\n\n$RUN_LATER_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
||||||
|
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
"1800s")
|
"1800s")
|
||||||
occ_command config:system:set remember_login_cookie_lifetime --value="1800"
|
nextcloud_occ config:system:set remember_login_cookie_lifetime --value="1800"
|
||||||
;;
|
;;
|
||||||
"7200s")
|
"7200s")
|
||||||
occ_command config:system:set remember_login_cookie_lifetime --value="7200"
|
nextcloud_occ config:system:set remember_login_cookie_lifetime --value="7200"
|
||||||
;;
|
;;
|
||||||
"43200s")
|
"43200s")
|
||||||
occ_command config:system:set remember_login_cookie_lifetime --value="43200"
|
nextcloud_occ config:system:set remember_login_cookie_lifetime --value="43200"
|
||||||
;;
|
;;
|
||||||
"172800s")
|
"172800s")
|
||||||
occ_command config:system:set remember_login_cookie_lifetime --value="172800"
|
nextcloud_occ config:system:set remember_login_cookie_lifetime --value="172800"
|
||||||
;;
|
;;
|
||||||
"604800s")
|
"604800s")
|
||||||
occ_command config:system:set remember_login_cookie_lifetime --value="604800"
|
nextcloud_occ config:system:set remember_login_cookie_lifetime --value="604800"
|
||||||
;;
|
;;
|
||||||
"2419200s")
|
"2419200s")
|
||||||
occ_command config:system:set remember_login_cookie_lifetime --value="2419200"
|
nextcloud_occ config:system:set remember_login_cookie_lifetime --value="2419200"
|
||||||
;;
|
;;
|
||||||
"Custom")
|
"Custom")
|
||||||
while :
|
while :
|
||||||
|
@ -64,7 +64,7 @@ case "$choice" in
|
||||||
then
|
then
|
||||||
msg_box "It seems like you weren't satisfied with your setting of ($COOKIE_LIFETIME) seconds. Please try again."
|
msg_box "It seems like you weren't satisfied with your setting of ($COOKIE_LIFETIME) seconds. Please try again."
|
||||||
else
|
else
|
||||||
if occ_command config:system:set remember_login_cookie_lifetime --value="$COOKIE_LIFETIME"
|
if nextcloud_occ config:system:set remember_login_cookie_lifetime --value="$COOKIE_LIFETIME"
|
||||||
then
|
then
|
||||||
msg_box "Cookie Lifetime is now successfully set to $COOKIE_LIFETIME seconds."
|
msg_box "Cookie Lifetime is now successfully set to $COOKIE_LIFETIME seconds."
|
||||||
fi
|
fi
|
||||||
|
|
Загрузка…
Ссылка в новой задаче