mirror of
https://github.com/YunoHost-Apps/nextcloud_ynh.git
synced 2024-09-03 19:55:57 +02:00
Merge branch 'testing' into en_update_17.0.0
This commit is contained in:
commit
1f6076fe5d
4 changed files with 36 additions and 25 deletions
|
@ -12,7 +12,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to
|
|||
own data. A personal cloud which run on your own server. With Nextcloud
|
||||
you can synchronize your files over your devices.
|
||||
|
||||
**Shipped version:** 16.0.1
|
||||
**Shipped version:** 17.0.0
|
||||
|
||||
## Screenshots
|
||||
|
||||
|
|
|
@ -434,7 +434,10 @@ php_admin_value[memory_limit] = 512M
|
|||
php_value[upload_max_filesize] = 10G
|
||||
php_value[post_max_size] = 10G
|
||||
php_value[default_charset] = UTF-8
|
||||
php_value[opcache.enable]=1
|
||||
; OPcache is already activated by default
|
||||
; php_value[opcache.enable]=1
|
||||
; The following parameters are nevertheless recommended for Nextcloud
|
||||
; see here: https://docs.nextcloud.com/server/15/admin_manual/installation/server_tuning.html#enable-php-opcache
|
||||
php_value[opcache.enable_cli]=1
|
||||
php_value[opcache.interned_strings_buffer]=8
|
||||
php_value[opcache.max_accelerated_files]=10000
|
||||
|
|
|
@ -71,7 +71,7 @@ ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name
|
|||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Setting up source files..."5
|
||||
ynh_script_progression --message="Setting up source files..."
|
||||
|
||||
# Load the last available version
|
||||
source upgrade.d/upgrade.last.sh
|
||||
|
|
|
@ -179,23 +179,34 @@ ynh_install_php --phpversion="$php_version" --package="$extra_pkg_dependencies"
|
|||
# VERSION TO THE NEXT ONE
|
||||
#=================================================
|
||||
|
||||
# Define a function to execute commands with `occ`
|
||||
exec_occ() {
|
||||
(cd "$final_path" && exec_as "$app" \
|
||||
php occ --no-interaction --no-ansi "$@")
|
||||
}
|
||||
|
||||
# Define a function to add an external storage
|
||||
# Create the external storage for the given folders and enable sharing
|
||||
create_external_storage() {
|
||||
local datadir="$1"
|
||||
local mount_name="$2"
|
||||
local mount_id=`exec_occ files_external:create --output=json \
|
||||
"$mount_name" 'local' 'null::null' -c "datadir=$datadir" || true`
|
||||
! [[ $mount_id =~ ^[0-9]+$ ]] \
|
||||
&& ynh_print_warn --message="Unable to create external storage" \
|
||||
|| exec_occ files_external:option "$mount_id" enable_sharing true
|
||||
}
|
||||
# Define app's data directory
|
||||
datadir="/home/yunohost.app/$app/data"
|
||||
|
||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||
then
|
||||
ynh_script_progression --message="Upgrading nextcloud..." --weight=3
|
||||
|
||||
# Define a function to execute commands with `occ`
|
||||
exec_occ() {
|
||||
(cd "$final_path" && exec_as "$app" \
|
||||
php$php_version occ --no-interaction --no-ansi "$@")
|
||||
}
|
||||
|
||||
# Load the last available version
|
||||
source upgrade.d/upgrade.last.sh
|
||||
last_version=$next_version
|
||||
|
||||
# Define app's data directory
|
||||
datadir="/home/yunohost.app/$app/data"
|
||||
|
||||
# Set write access for the following commands
|
||||
chown -R $app: "$final_path" "$datadir"
|
||||
|
||||
|
@ -244,7 +255,16 @@ then
|
|||
# Backup 3rd party applications from the current nextcloud
|
||||
# But do not overwrite if there is any upgrade
|
||||
# (apps directory already exists in Nextcloud archive)
|
||||
cp -a --update "$final_path/apps" "$tmpdir"
|
||||
(
|
||||
cd $final_path/apps
|
||||
for nc_app_dir in */
|
||||
do
|
||||
if [ ! -d "$tmpdir/apps/$nc_app_dir" ]
|
||||
then
|
||||
cp -a "$nc_app_dir" "$tmpdir/apps/$nc_app_dir"
|
||||
fi
|
||||
done
|
||||
)
|
||||
|
||||
# Replace the old nextcloud by the new one
|
||||
ynh_secure_remove --file="$final_path"
|
||||
|
@ -317,18 +337,6 @@ then
|
|||
# MOUNT HOME FOLDERS AS EXTERNAL STORAGE
|
||||
#=================================================
|
||||
|
||||
# Define a function to add an external storage
|
||||
# Create the external storage for the given folders and enable sharing
|
||||
create_external_storage() {
|
||||
local datadir="$1"
|
||||
local mount_name="$2"
|
||||
local mount_id=`exec_occ files_external:create --output=json \
|
||||
"$mount_name" 'local' 'null::null' -c "datadir=$datadir" || true`
|
||||
! [[ $mount_id =~ ^[0-9]+$ ]] \
|
||||
&& ynh_print_warn --message="Unable to create external storage" \
|
||||
|| exec_occ files_external:option "$mount_id" enable_sharing true
|
||||
}
|
||||
|
||||
# Enable External Storage and create local mount to home folder as needed
|
||||
if [ $user_home -eq 1 ]; then
|
||||
exec_occ app:enable files_external
|
||||
|
|
Loading…
Add table
Reference in a new issue