diff --git a/conf/nextcloud.cron b/conf/nextcloud.cron index 13de049..c2a825c 100644 --- a/conf/nextcloud.cron +++ b/conf/nextcloud.cron @@ -1 +1 @@ -*/15 * * * * __APP__ /usr/bin/php__PHPVERSION__ --define apc.enable_cli=1 -f __FINAL_PATH__/cron.php +*/15 * * * * __APP__ /usr/bin/php__PHPVERSION__ --define apc.enable_cli=1 -f __INSTALL_DIR__/cron.php diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 799055d..0000000 --- a/manifest.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "id": "nextcloud", - "name": "Nextcloud", - "packaging_format": 1, - "description": { - "en": "Online storage, file sharing platform and various other applications", - "fr": "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications" - }, - "version": "25.0.1~ynh1", - "url": "https://nextcloud.com", - "upstream": { - "license": "AGPL-3.0", - "website": "https://nextcloud.com", - "demo": "https://demo.nextcloud.com/", - "admindoc": "https://docs.nextcloud.com/server/stable/admin_manual/", - "userdoc": "https://docs.nextcloud.com/server/latest/user_manual/en/", - "code": "https://github.com/nextcloud/server", - "cpe": "cpe:2.3:a:nextcloud:nextcloud" - }, - "license": "AGPL-3.0", - "maintainer": { - "name": "kay0u", - "email": "pierre@kayou.io" - }, - "requirements": { - "yunohost": ">= 11.0.9" - }, - "multi_instance": true, - "services": [ - "nginx", - "php8.0-fpm", - "mysql" - ], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "path", - "type": "path", - "example": "/nextcloud", - "default": "/nextcloud" - }, - { - "name": "admin", - "type": "user" - }, - { - "name": "is_public", - "type": "boolean", - "help": { - "en": "If enabled, Nextcloud will be accessible by Nextcloud Desktop and by users without a YunoHost account. This can be changed later in the webadmin.", - "fr": "Si cette case est cochée, Nextcloud sera accessible par Nextcloud Desktop et par les utilisateurs n’ayant pas de compte YunoHost. Vous pourrez changer dans la webadmin." - }, - "default": true - }, - { - "name": "user_home", - "type": "boolean", - "ask": { - "en": "Access the users home folder from Nextcloud?", - "fr": "Accéder au dossier personnel des utilisateurs depuis Nextcloud ?" - }, - "default": false - } - ] - } -} \ No newline at end of file diff --git a/manifest.toml b/manifest.toml index 8be653b..e3d8d06 100644 --- a/manifest.toml +++ b/manifest.toml @@ -20,11 +20,11 @@ cpe = "???" # FIXME: optional but recommended if relevant, this is meant to cont fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. [integration] -yunohost = ">= 11.0.9" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64/armel), for example: ["amd64", "i386"] +yunohost = ">= 11.1.0" +architectures = ["amd64", "arm64"] multi_instance = true -ldap = "?" # FIXME: replace with true, false, or "not_relevant" -sso = "?" # FIXME: replace with true, false, or "not_relevant" +ldap = "true" # +sso = "true" # disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... @@ -67,3 +67,7 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [resources.database] type = "mysql" + + [resources.apt] + packages = "imagemagick libmagickcore-6.q16-6-extra acl tar smbclient at php${YNH_PHP_VERSION}-fpm php${YNH_PHP_VERSION}-bz2 php${YNH_PHP_VERSION}-imap php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-apcu php${YNH_PHP_VERSION}-redis php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-igbinary php${YNH_PHP_VERSION}-bcmath" + diff --git a/scripts/_common.sh b/scripts/_common.sh index 69b4633..8c270a6 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,6 @@ #================================================= YNH_PHP_VERSION="8.0" -#REMOVEME? pkg_dependencies="imagemagick libmagickcore-6.q16-6-extra acl tar smbclient at php${YNH_PHP_VERSION}-fpm php${YNH_PHP_VERSION}-bz2 php${YNH_PHP_VERSION}-imap php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-apcu php${YNH_PHP_VERSION}-redis php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-igbinary php${YNH_PHP_VERSION}-bcmath" #================================================= # EXPERIMENTAL HELPERS diff --git a/scripts/actions/add_multimedia_directories b/scripts/actions/add_multimedia_directories index 8b5a9af..f616019 100755 --- a/scripts/actions/add_multimedia_directories +++ b/scripts/actions/add_multimedia_directories @@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) #================================================= # CHECK IF ARGUMENTS ARE CORRECT @@ -27,7 +27,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) # Define a function to execute commands with `occ` exec_occ() { - (cd "$final_path" && exec_as "$app" \ + (cd "$install_dir" && exec_as "$app" \ php$YNH_PHP_VERSION --define apc.enable_cli=1 occ --no-interaction --no-ansi "$@") } diff --git a/scripts/actions/disable_maintenance b/scripts/actions/disable_maintenance index 60e8738..e56fd5b 100755 --- a/scripts/actions/disable_maintenance +++ b/scripts/actions/disable_maintenance @@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) #================================================= # CHECK IF ARGUMENTS ARE CORRECT @@ -27,7 +27,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) # Check the current status of the maintenance mode -if [ "$(grep "maintenance" "$final_path/config/config.php" | awk '{print $3}' | cut -d',' -f1)" != "true" ] +if [ "$(grep "maintenance" "$install_dir/config/config.php" | awk '{print $3}' | cut -d',' -f1)" != "true" ] then ynh_die --message="Nextcloud isn't currently under maintenance." --ret_code=0 fi @@ -41,7 +41,7 @@ fi ynh_script_progression --message="Disabling maintenance mode..." --weight=3 ( -cd "$final_path" && exec_as "$app" \ +cd "$install_dir" && exec_as "$app" \ php$YNH_PHP_VERSION --define apc.enable_cli=1 occ --no-interaction --no-ansi maintenance:mode --off ) diff --git a/scripts/backup b/scripts/backup index 24601fa..57d66b2 100755 --- a/scripts/backup +++ b/scripts/backup @@ -9,26 +9,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_print_info --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= @@ -59,8 +39,6 @@ ynh_print_info --message="Backing up the MySQL database..." ynh_mysql_dump_db --database="$db_name" > db.sql -#================================================= -# SPECIFIC BACKUP #================================================= # BACKUP LOGROTATE #================================================= diff --git a/scripts/change_url b/scripts/change_url index e4e3696..147f45a 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -21,15 +21,6 @@ new_path=$YNH_APP_NEW_PATH app=$YNH_APP_INSTANCE_NAME -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." - -# Needed for helper "ynh_add_nginx_config" -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= diff --git a/scripts/config b/scripts/config index 7b6b67e..10ee4b2 100644 --- a/scripts/config +++ b/scripts/config @@ -68,12 +68,12 @@ get__free_footprint() { set__maintenance_mode() { if [ "$maintenance_mode" -eq "0" ]; then # If maintenance_mode was set to 0, disable maintenance mode - (cd "$final_path" && ynh_exec_as "$app" \ + (cd "$install_dir" && ynh_exec_as "$app" \ php${phpversion} --define apc.enable_cli=1 occ --no-interaction --no-ansi maintenance:mode --off) ynh_print_info "Maintenance mode disabled" elif [ "$maintenance_mode" -eq "1" ]; then # If maintenance_mode was set to 1, enable maintenance mode - (cd "$final_path" && ynh_exec_as "$app" \ + (cd "$install_dir" && ynh_exec_as "$app" \ php${phpversion} --define apc.enable_cli=1 occ --no-interaction --no-ansi maintenance:mode --on) ynh_print_info "Maintenance mode enabled" fi diff --git a/scripts/install b/scripts/install index e36fcd6..a36dc11 100755 --- a/scripts/install +++ b/scripts/install @@ -9,75 +9,23 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -#REMOVEME? domain=$YNH_APP_ARG_DOMAIN -#REMOVEME? path=$YNH_APP_ARG_PATH -#REMOVEME? admin=$YNH_APP_ARG_ADMIN -#REMOVEME? user_home=$YNH_APP_ARG_USER_HOME -#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC +user_home=$YNH_APP_ARG_USER_HOME phpversion=$YNH_PHP_VERSION -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -#REMOVEME? ynh_script_progression --message="Validating installation parameters..." - -#REMOVEME? install_dir=/var/www/$app -#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" - -# Register (book) web path -#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path - -# Check machine architecture (Seens 25.0 Nextcloud doesn't support 32bit machines) -if [ $YNH_ARCH == "i386" ]; -then - ynh_die --message="Sorry, Nextcloud has deprecated 32-bit support" -fi - #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -#REMOVEME? ynh_script_progression --message="Storing installation settings..." +ynh_script_progression --message="Storing installation settings..." -#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain -#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path -#REMOVEME? ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_app_setting_set --app=$app --key=user_home --value=$user_home maintenance_mode=0 ynh_app_setting_set --app=$app --key=maintenance_mode --value=$maintenance_mode -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# INSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=10 - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# CREATE A MYSQL DATABASE -#================================================= -#REMOVEME? ynh_script_progression --message="Creating a MySQL database..." --weight=2 - -#REMOVEME? db_name=$(ynh_sanitize_dbid --db_name=$app) -#REMOVEME? db_user=$db_name -#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name -#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -95,20 +43,11 @@ SOURCE_FORMAT=tar.bz2 SOURCE_IN_SUBDIR=true EOF -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Enable YunoHost patches on Nextcloud sources cp -a ../sources/patches_last_version/* ../sources/patches # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=3 - -# Create a system user -#REMOVEME? ynh_system_user_create --username=$app - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -124,8 +63,6 @@ ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage # Create a dedicated php-fpm config ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$YNH_PHP_VERSION -# Used by ynh_add_nginx_config -#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # NGINX CONFIGURATION @@ -144,20 +81,6 @@ fi # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SPECIFIC SETUP -#================================================= -# CREATE THE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Creating a data directory..." --weight=1 - -# Define app's data directory -#REMOVEME? data_dir="/home/yunohost.app/$app/data" -#REMOVEME? ynh_app_setting_set --app=$app --key=data_dir --value=$data_dir - -# Create app folders -mkdir -p "$data_dir" - #================================================= # INSTALL NEXTCLOUD #================================================= @@ -356,15 +279,9 @@ ynh_add_fail2ban_config --logpath="/home/yunohost.app/$app/data/nextcloud.log" - #================================================= # SETUP SSOWAT #================================================= -#REMOVEME? ynh_script_progression --message="Configuring permissions..." +ynh_script_progression --message="Configuring permissions..." -# Make app public if necessary -#REMOVEME? if [ $is_public -eq 1 ] -then -#REMOVEME? ynh_permission_update --permission="main" --add="visitors" -fi - -#REMOVEME? ynh_permission_create --permission="api" --label="api" --url="re:$domain\/.well-known\/.*" --allowed="visitors" "all_users" --auth_header="false" --show_tile="false" --protected="true" +ynh_permission_create --permission="api" --label="api" --url="re:$domain\/.well-known\/.*" --allowed="visitors" "all_users" --auth_header="false" --show_tile="false" --protected="true" #================================================= # RELOAD NGINX diff --git a/scripts/remove b/scripts/remove index 5c09222..0d0ff5b 100755 --- a/scripts/remove +++ b/scripts/remove @@ -9,56 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=2 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? db_user=$db_name -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - -#================================================= -# STANDARD REMOVE -#================================================= -# REMOVE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=20 - -# Remove metapackage and its dependencies -#REMOVEME? ynh_remove_app_dependencies - -#================================================= -# REMOVE THE MYSQL DATABASE -#================================================= -#REMOVEME? ynh_script_progression --message="Removing the MySQL database..." --weight=5 - -# Remove a database if it exists, along with the associated user -#REMOVEME? ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name - -#================================================= -# REMOVE APP MAIN DIR -#================================================= -#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=3 - -# Remove the app directory securely -#REMOVEME? ynh_secure_remove --file="$install_dir" - -#================================================= -# REMOVE DATA DIR -#================================================= - -# Remove the data directory if --purge option is used -if [ "${YNH_APP_PURGE:-0}" -eq 1 ] -then - ynh_script_progression --message="Removing app data directory..." --weight=1 -#REMOVEME? ynh_secure_remove --file="$data_dir" -fi - #================================================= # REMOVE NGINX CONFIGURATION #================================================= @@ -111,16 +61,6 @@ for i in $(ls /home); do && setfacl --remove g:$app:rwx 2>&1 done -#================================================= -# GENERIC FINALIZATION -#================================================= -# REMOVE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." - -# Delete a system user -#REMOVEME? ynh_system_user_delete --username=$app - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index a1fda54..79712c7 100755 --- a/scripts/restore +++ b/scripts/restore @@ -9,38 +9,13 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # LOAD SETTINGS #================================================= ynh_script_progression --message="Loading settings..." -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? db_user=$db_name -#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - -#REMOVEME? fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) -#REMOVEME? fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=4 - -#REMOVEME? test ! -d $install_dir \ - || ynh_die --message="There is already a directory: $install_dir " +fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) +fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) #================================================= # STANDARD RESTORATION STEPS @@ -54,30 +29,10 @@ ynh_restore_file --origin_path="$install_dir" #================================================= # RESTORE THE MYSQL DATABASE #================================================= -#REMOVEME? ynh_script_progression --message="Restoring the MySQL database..." --weight=9 +ynh_script_progression --message="Restoring the MySQL database..." --weight=9 -#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=3 - -# Create the dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app - -#================================================= -# SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=10 - -# Define and install dependencies -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 5721323..e09d7b6 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,21 +12,12 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=3 +ynh_script_progression --message="Loading installation settings..." --weight=3 -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? admin=$(ynh_app_setting_get --app=$app --key=admin) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? db_user=$db_name -#REMOVEME? user_home=$(ynh_app_setting_get --app=$app --key=user_home) - -#REMOVEME? maintenance_mode=$(ynh_app_setting_get --app=$app --key=maintenance_mode) -#REMOVEME? fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) -#REMOVEME? fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) +user_home=$(ynh_app_setting_get --app=$app --key=user_home) +maintenance_mode=$(ynh_app_setting_get --app=$app --key=maintenance_mode) +fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) +fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) #================================================= # CHECK VERSION @@ -34,12 +25,6 @@ source /usr/share/yunohost/helpers upgrade_type=$(ynh_check_app_version_changed) -# Check machine architecture (Seens 25.0 Nextcloud doesn't support 32bit machines) -if [ $YNH_ARCH == "i386" ]; -then - ynh_die --message="Sorry, Nextcloud has deprecated 32-bit support" -fi - #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -90,16 +75,10 @@ if [ -z "$fpm_usage" ]; then ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage fi -# Cleaning legacy permissions -#REMOVEME? if ynh_legacy_permissions_exists; then -#REMOVEME? ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi # Create a permission if needed -#REMOVEME? if ! ynh_permission_exists --permission="api"; then -#REMOVEME? ynh_permission_create --permission="api" --label="api" --url="re:$domain\/.well-known\/.*" --allowed="visitors" "all_users" --auth_header="false" --show_tile="false" --protected="true" +if ! ynh_permission_exists --permission="api"; then + ynh_permission_create --permission="api" --label="api" --url="re:$domain\/.well-known\/.*" --allowed="visitors" "all_users" --auth_header="false" --show_tile="false" --protected="true" fi # Delete existing ini configuration file (backward compatibility) @@ -137,31 +116,13 @@ then fi # Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors +ynh_abort_if_errors -#REMOVEME? if ynh_legacy_permissions_exists; then -#REMOVEME? ynh_legacy_permissions_delete_all - -#REMOVEME? ynh_permission_create --permission="api" --label="api" --url="re:$domain\/.well-known\/.*" --allowed="visitors" "all_users" --auth_header="false" --show_tile="false" --protected="true" +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + ynh_permission_create --permission="api" --label="api" --url="re:$domain\/.well-known\/.*" --allowed="visitors" "all_users" --auth_header="false" --show_tile="false" --protected="true" fi -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=7 - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# STANDARD UPGRADE STEPS -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." - -# Create a dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -170,8 +131,6 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Recreate a dedicated PHP-FPM config ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint -#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) - #================================================= # NGINX CONFIGURATION #=================================================