1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nextcloud_ynh.git synced 2024-09-03 19:55:57 +02:00
This commit is contained in:
Éric Gaspar 2022-11-04 23:09:00 +01:00
parent e877ce9c89
commit eff9cce7c9
13 changed files with 34 additions and 361 deletions

View file

@ -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

View file

@ -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 nayant 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
}
]
}
}

View file

@ -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. 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] [integration]
yunohost = ">= 11.0.9" yunohost = ">= 11.1.0"
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"] architectures = ["amd64", "arm64"]
multi_instance = true multi_instance = true
ldap = "?" # FIXME: replace with true, false, or "not_relevant" ldap = "true" #
sso = "?" # FIXME: replace with true, false, or "not_relevant" sso = "true" #
disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... 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.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, ... 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] [resources.database]
type = "mysql" 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"

View file

@ -5,7 +5,6 @@
#================================================= #=================================================
YNH_PHP_VERSION="8.0" 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 # EXPERIMENTAL HELPERS

View file

@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers
app=$YNH_APP_INSTANCE_NAME 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 # 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` # Define a function to execute commands with `occ`
exec_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 "$@") php$YNH_PHP_VERSION --define apc.enable_cli=1 occ --no-interaction --no-ansi "$@")
} }

View file

@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers
app=$YNH_APP_INSTANCE_NAME 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 # 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 # 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 then
ynh_die --message="Nextcloud isn't currently under maintenance." --ret_code=0 ynh_die --message="Nextcloud isn't currently under maintenance." --ret_code=0
fi fi
@ -41,7 +41,7 @@ fi
ynh_script_progression --message="Disabling maintenance mode..." --weight=3 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 php$YNH_PHP_VERSION --define apc.enable_cli=1 occ --no-interaction --no-ansi maintenance:mode --off
) )

View file

@ -9,26 +9,6 @@
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers 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 # 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 ynh_mysql_dump_db --database="$db_name" > db.sql
#=================================================
# SPECIFIC BACKUP
#================================================= #=================================================
# BACKUP LOGROTATE # BACKUP LOGROTATE
#================================================= #=================================================

View file

@ -21,15 +21,6 @@ new_path=$YNH_APP_NEW_PATH
app=$YNH_APP_INSTANCE_NAME 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 # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================

View file

@ -68,12 +68,12 @@ get__free_footprint() {
set__maintenance_mode() { set__maintenance_mode() {
if [ "$maintenance_mode" -eq "0" ]; then if [ "$maintenance_mode" -eq "0" ]; then
# If maintenance_mode was set to 0, disable maintenance mode # 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) php${phpversion} --define apc.enable_cli=1 occ --no-interaction --no-ansi maintenance:mode --off)
ynh_print_info "Maintenance mode disabled" ynh_print_info "Maintenance mode disabled"
elif [ "$maintenance_mode" -eq "1" ]; then elif [ "$maintenance_mode" -eq "1" ]; then
# If maintenance_mode was set to 1, enable maintenance mode # 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) php${phpversion} --define apc.enable_cli=1 occ --no-interaction --no-ansi maintenance:mode --on)
ynh_print_info "Maintenance mode enabled" ynh_print_info "Maintenance mode enabled"
fi fi

View file

@ -9,75 +9,23 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers 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 # RETRIEVE ARGUMENTS FROM THE MANIFEST
#================================================= #=================================================
#REMOVEME? domain=$YNH_APP_ARG_DOMAIN user_home=$YNH_APP_ARG_USER_HOME
#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
phpversion=$YNH_PHP_VERSION 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 # 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 ynh_app_setting_set --app=$app --key=user_home --value=$user_home
maintenance_mode=0 maintenance_mode=0
ynh_app_setting_set --app=$app --key=maintenance_mode --value=$maintenance_mode 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 # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
@ -95,20 +43,11 @@ SOURCE_FORMAT=tar.bz2
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true
EOF EOF
#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir
# Enable YunoHost patches on Nextcloud sources # Enable YunoHost patches on Nextcloud sources
cp -a ../sources/patches_last_version/* ../sources/patches cp -a ../sources/patches_last_version/* ../sources/patches
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" 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 # 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 # Create a dedicated php-fpm config
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$YNH_PHP_VERSION 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 # NGINX CONFIGURATION
@ -144,20 +81,6 @@ fi
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_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 # INSTALL NEXTCLOUD
#================================================= #=================================================
@ -356,15 +279,9 @@ ynh_add_fail2ban_config --logpath="/home/yunohost.app/$app/data/nextcloud.log" -
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
#REMOVEME? ynh_script_progression --message="Configuring permissions..." ynh_script_progression --message="Configuring permissions..."
# Make app public if necessary ynh_permission_create --permission="api" --label="api" --url="re:$domain\/.well-known\/.*" --allowed="visitors" "all_users" --auth_header="false" --show_tile="false" --protected="true"
#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"
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX

View file

@ -9,56 +9,6 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers 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 # REMOVE NGINX CONFIGURATION
#================================================= #=================================================
@ -111,16 +61,6 @@ for i in $(ls /home); do
&& setfacl --remove g:$app:rwx 2>&1 && setfacl --remove g:$app:rwx 2>&1
done 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 # END OF SCRIPT
#================================================= #=================================================

View file

@ -9,38 +9,13 @@
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers 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 # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading settings..." ynh_script_progression --message="Loading settings..."
#REMOVEME? app=$YNH_APP_INSTANCE_NAME fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage)
#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 "
#================================================= #=================================================
# STANDARD RESTORATION STEPS # STANDARD RESTORATION STEPS
@ -54,30 +29,10 @@ ynh_restore_file --origin_path="$install_dir"
#================================================= #=================================================
# RESTORE THE MYSQL DATABASE # 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 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 # RESTORE THE PHP-FPM CONFIGURATION
#================================================= #=================================================

View file

@ -12,21 +12,12 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# LOAD SETTINGS # 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 user_home=$(ynh_app_setting_get --app=$app --key=user_home)
maintenance_mode=$(ynh_app_setting_get --app=$app --key=maintenance_mode)
#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage)
#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)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
@ -34,12 +25,6 @@ source /usr/share/yunohost/helpers
upgrade_type=$(ynh_check_app_version_changed) 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 # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
@ -90,16 +75,10 @@ if [ -z "$fpm_usage" ]; then
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
fi 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 # Create a permission if needed
#REMOVEME? if ! ynh_permission_exists --permission="api"; then 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" 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 fi
# Delete existing ini configuration file (backward compatibility) # Delete existing ini configuration file (backward compatibility)
@ -137,31 +116,13 @@ then
fi fi
# Exit if an error occurs during the execution of the script # 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 if ynh_legacy_permissions_exists; then
#REMOVEME? ynh_legacy_permissions_delete_all 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"
#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"
fi 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 # PHP-FPM CONFIGURATION
#================================================= #=================================================
@ -170,8 +131,6 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2
# Recreate a dedicated PHP-FPM config # Recreate a dedicated PHP-FPM config
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================