From b25549fffcfc883d5f80e5e0f6993369bcfdd8d2 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 11 Jun 2023 14:20:58 +0200 Subject: [PATCH 1/4] Delete obsolete 'actions' files --- actions.toml | 17 ------ scripts/actions/add_multimedia_directories | 66 ---------------------- scripts/actions/disable_maintenance | 52 ----------------- 3 files changed, 135 deletions(-) delete mode 100644 actions.toml delete mode 100755 scripts/actions/add_multimedia_directories delete mode 100755 scripts/actions/disable_maintenance diff --git a/actions.toml b/actions.toml deleted file mode 100644 index fc6cb0f..0000000 --- a/actions.toml +++ /dev/null @@ -1,17 +0,0 @@ -[disable_maintenance] -name = "Disable the maintenance mode of Nextcloud" -command = "/bin/bash scripts/actions/disable_maintenance" -# user = "root" # optional -# cwd = "/" # optional -# accepted_return_codes = [0, 1, 2, 3] # optional -accepted_return_codes = [0] -description = "Disable the maintenance mode of Nextcloud if you're stuck after an upgrade" - -[add_multimedia_directories] -name = "Add multimedia directories" -command = "/bin/bash scripts/actions/add_multimedia_directories" -# user = "root" # optional -# cwd = "/" # optional -# accepted_return_codes = [0, 1, 2, 3] # optional -accepted_return_codes = [0] -description = "Add the multimedia and shared multimedia directories again" diff --git a/scripts/actions/add_multimedia_directories b/scripts/actions/add_multimedia_directories deleted file mode 100755 index 8b5a9af..0000000 --- a/scripts/actions/add_multimedia_directories +++ /dev/null @@ -1,66 +0,0 @@ -#!/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 --define apc.enable_cli=1 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 diff --git a/scripts/actions/disable_maintenance b/scripts/actions/disable_maintenance deleted file mode 100755 index 60e8738..0000000 --- a/scripts/actions/disable_maintenance +++ /dev/null @@ -1,52 +0,0 @@ -#!/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 -#================================================= - -#================================================= -# CHECK IF AN ACTION HAS TO BE DONE -#================================================= - -# Check the current status of the maintenance mode - -if [ "$(grep "maintenance" "$final_path/config/config.php" | awk '{print $3}' | cut -d',' -f1)" != "true" ] -then - ynh_die --message="Nextcloud isn't currently under maintenance." --ret_code=0 -fi - -#================================================= -# SPECIFIC ACTION -#================================================= -# DISABLE THE MAINTENANCE MODE -#================================================= - -ynh_script_progression --message="Disabling maintenance mode..." --weight=3 - -( -cd "$final_path" && exec_as "$app" \ - php$YNH_PHP_VERSION --define apc.enable_cli=1 occ --no-interaction --no-ansi maintenance:mode --off -) - -#================================================= -# END OF SCRIPT -#================================================= - -ynh_script_progression --message="Execution completed" --last From 9ce721b2b2018f73b35b49d979e1c5c6d1e7118b Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 11 Jun 2023 14:23:57 +0200 Subject: [PATCH 2/4] Add -r to xargs to not miserably fail when find doesn't list any file --- scripts/install | 8 ++++---- scripts/restore | 8 ++++---- scripts/upgrade | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/install b/scripts/install index 19dcb67..102e984 100755 --- a/scripts/install +++ b/scripts/install @@ -336,10 +336,10 @@ ynh_multimedia_addaccess $app # Fix app ownerships & permissions chown -R $app:www-data "$final_path" chown -R $app: "$datadir" -find $final_path/ -type f -print0 | xargs -0 chmod 0644 -find $final_path/ -type d -print0 | xargs -0 chmod 0755 -find $datadir/ -type f -print0 | xargs -0 chmod 0640 -find $datadir/ -type d -print0 | xargs -0 chmod 0750 +find $final_path/ -type f -print0 | xargs -r0 chmod 0644 +find $final_path/ -type d -print0 | xargs -r0 chmod 0755 +find $datadir/ -type f -print0 | xargs -r0 chmod 0640 +find $datadir/ -type d -print0 | xargs -r0 chmod 0750 chmod 640 "$final_path/config/config.php" chmod 755 /home/yunohost.app chmod 750 $final_path diff --git a/scripts/restore b/scripts/restore index 83c233f..42e6dcc 100755 --- a/scripts/restore +++ b/scripts/restore @@ -139,10 +139,10 @@ mkdir -p "$datadir" # Fix app ownerships & permissions chown -R $app:www-data "$final_path" chown -R $app: "$datadir" -find $final_path/ -type f -print0 | xargs -0 chmod 0644 -find $final_path/ -type d -print0 | xargs -0 chmod 0755 -find $datadir/ -type f -print0 | xargs -0 chmod 0640 -find $datadir/ -type d -print0 | xargs -0 chmod 0750 +find $final_path/ -type f -print0 | xargs -r0 chmod 0644 +find $final_path/ -type d -print0 | xargs -r0 chmod 0755 +find $datadir/ -type f -print0 | xargs -r0 chmod 0640 +find $datadir/ -type d -print0 | xargs -r0 chmod 0750 chmod 640 "$final_path/config/config.php" chmod 755 /home/yunohost.app chmod 750 $final_path diff --git a/scripts/upgrade b/scripts/upgrade index b7a7fcc..eb1adb6 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -452,10 +452,10 @@ exec_occ background:cron # Fix app ownerships & permissions chown -R $app:www-data "$final_path" chown -R $app: "$datadir" -find $final_path/ -type f -print0 | xargs -0 chmod 0644 -find $final_path/ -type d -print0 | xargs -0 chmod 0755 -find $datadir/ -type f -print0 | xargs -0 chmod 0640 -find $datadir/ -type d -print0 | xargs -0 chmod 0750 +find $final_path/ -type f -print0 | xargs -r0 chmod 0644 +find $final_path/ -type d -print0 | xargs -r0 chmod 0755 +find $datadir/ -type f -print0 | xargs -r0 chmod 0640 +find $datadir/ -type d -print0 | xargs -r0 chmod 0750 chmod 640 "$final_path/config/config.php" chmod 755 /home/yunohost.app chmod 750 $final_path From 5af4396bd952bac52c5eeb77296024fb7145b408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 11 Jun 2023 14:36:54 +0200 Subject: [PATCH 3/4] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index da4effc..fdcd515 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online storage, file sharing platform and various other applications", "fr": "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications" }, - "version": "26.0.2~ynh2", + "version": "26.0.2~ynh3", "url": "https://nextcloud.com", "upstream": { "license": "AGPL-3.0", From 8f09386e9ad9b5b2189b29c51c24a108b803bcb2 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 11 Jun 2023 12:36:59 +0000 Subject: [PATCH 4/4] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bbfcac1..eb78c8f 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ this package: * Serve `/.well-known` paths for CalDAV and CardDAV on the domain only if it's not already served - i.e. by Baïkal -**Shipped version:** 26.0.2~ynh2 +**Shipped version:** 26.0.2~ynh3 **Demo:** https://demo.nextcloud.com/ diff --git a/README_fr.md b/README_fr.md index c5a5339..8ab4943 100644 --- a/README_fr.md +++ b/README_fr.md @@ -29,7 +29,7 @@ En plus des fonctionnalités principales de Nextcloud, les fonctionnalités suiv * Utilise l'adresse `/.well-known` pour la synchronisation CalDAV et CardDAV du domaine si aucun autre service ne l'utilise déjà - par exemple, Baïkal -**Version incluse :** 26.0.2~ynh2 +**Version incluse :** 26.0.2~ynh3 **Démo :** https://demo.nextcloud.com/