committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 157 additions and 88 deletions
-
4README.md
-
4README_fr.md
-
9actions.toml
-
6check_process
-
2conf/nginx.conf
-
2manifest.json
-
2scripts/_common.sh
-
66scripts/actions/add_multimedia_directories
-
18scripts/backup
-
14scripts/change_url
-
25scripts/install
-
12scripts/remove
-
6scripts/restore
-
53scripts/upgrade
-
7scripts/upgrade.d/upgrade.18.sh
-
13scripts/upgrade.d/upgrade.last.sh
@ -0,0 +1,66 @@ |
|||||
|
#!/bin/bash |
||||
|
|
||||
|
#================================================= |
||||
|
# GENERIC STARTING |
||||
|
#================================================= |
||||
|
# IMPORT GENERIC HELPERS |
||||
|
#================================================= |
||||
|
|
||||
|
source scripts/_common.sh |
||||
|
source /usr/share/yunohost/helpers |
||||
|
|
||||
|
#================================================= |
||||
|
# RETRIEVE ARGUMENTS |
||||
|
#================================================= |
||||
|
|
||||
|
app=$YNH_APP_INSTANCE_NAME |
||||
|
|
||||
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path) |
||||
|
|
||||
|
#================================================= |
||||
|
# CHECK IF ARGUMENTS ARE CORRECT |
||||
|
#================================================= |
||||
|
|
||||
|
#================================================= |
||||
|
# DEFINE FUNCTION |
||||
|
#================================================= |
||||
|
|
||||
|
# Define a function to execute commands with `occ` |
||||
|
exec_occ() { |
||||
|
(cd "$final_path" && exec_as "$app" \ |
||||
|
php$YNH_PHP_VERSION 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 |
||||
|
} |
||||
|
|
||||
|
#================================================= |
||||
|
# SPECIFIC ACTION |
||||
|
#================================================= |
||||
|
# YUNOHOST MULTIMEDIA INTEGRATION |
||||
|
#================================================= |
||||
|
ynh_script_progression --message="Updating multimedia directories..." --weight=6 |
||||
|
|
||||
|
# Build YunoHost multimedia directories |
||||
|
ynh_multimedia_build_main_dir |
||||
|
# Mount the user directory in Nextcloud |
||||
|
exec_occ app:enable files_external |
||||
|
create_external_storage "/home/yunohost.multimedia/\$user" "Multimedia" |
||||
|
create_external_storage "/home/yunohost.multimedia/share" "Shared multimedia" |
||||
|
# Allow nextcloud to write into these directories |
||||
|
ynh_multimedia_addaccess $app |
||||
|
|
||||
|
#================================================= |
||||
|
# END OF SCRIPT |
||||
|
#================================================= |
||||
|
|
||||
|
ynh_script_progression --message="Execution completed" --last |
||||
@ -0,0 +1,7 @@ |
|||||
|
#!/bin/bash |
||||
|
|
||||
|
# Last available nextcloud version |
||||
|
next_version="19.0.0" |
||||
|
|
||||
|
# Nextcloud tarball checksum sha256 |
||||
|
nextcloud_source_sha256="d23d429657c5e3476d7e73af1eafc70e42a81cfe2ed65b20655a005724fe0aae" |
||||
@ -1,16 +1,7 @@ |
|||||
#!/bin/bash |
#!/bin/bash |
||||
|
|
||||
# Last available nextcloud version |
# Last available nextcloud version |
||||
next_version="18.0.7" |
|
||||
|
next_version="19.0.3" |
||||
|
|
||||
# Nextcloud tarball checksum sha256 |
# Nextcloud tarball checksum sha256 |
||||
nextcloud_source_sha256="4b2cc7475d925faf9ce6c655d290cbbee8c02a40aaf0628d3d41b7ccd8416a5e" |
|
||||
|
|
||||
# This function will only be executed upon applying the last upgrade referenced above |
|
||||
last_upgrade_operations () { |
|
||||
# Patch nextcloud files only for the last version |
|
||||
cp -a ../sources/patches_last_version/* ../sources/patches |
|
||||
|
|
||||
# Execute post-upgrade operations later on |
|
||||
(cd /tmp ; at now + 10 minutes <<< "(cd $final_path ; sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices ; sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n) > /tmp/${app}_maintenance.log") |
|
||||
} |
|
||||
|
nextcloud_source_sha256="fc503985e8aa4ed795d882e35679e0e1b7670181768e7820307222d8b4658969" |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue