diff --git a/manifest.json b/manifest.json index 38e9987..ef715e9 100644 --- a/manifest.json +++ b/manifest.json @@ -12,8 +12,7 @@ "license": "GPL-3.0", "website": "https://prober.inn-studio.com/", "demo": "https://prober.inn-studio.com/", - "admindoc": "https://yunohost.org/packaging_apps", - "userdoc": "https://yunohost.org/apps", + "userdoc": "https://github.com/kmvan/x-prober", "code": "https://github.com/kmvan/x-prober" }, "license": "GPL-3.0", @@ -46,8 +45,8 @@ "name": "phpversion", "type": "string", "ask": { - "en": "Choose a PHP version you want to use for your app", - "fr": "Choisissez une version PHP que vous souhaitez utiliser pour votre application" + "en": "Choose a PHP version you want to use for your app. Yes, 8 is better", + "fr": "Choisissez une version PHP que vous souhaitez utiliser pour votre application. Oui, la 8 est meilleure" }, "choices" : ["7.4", "8.0"], "default" : "8.0" diff --git a/scripts/backup b/scripts/backup index def6acc..56a924c 100755 --- a/scripts/backup +++ b/scripts/backup @@ -31,7 +31,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) + #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -49,12 +49,6 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$final_path" -#================================================= -# BACKUP THE DATA DIR -#================================================= - -ynh_backup --src_path="$datadir" --is_big - #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= diff --git a/scripts/install b/scripts/install index 63ae080..ccf73b6 100755 --- a/scripts/install +++ b/scripts/install @@ -29,7 +29,6 @@ path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC phpversion=$YNH_APP_ARG_PHPVERSION - ### If it's a multi-instance app, meaning it can be installed several times independently ### The id of the app as stated in the manifest is available as $YNH_APP_ID ### The instance number is available as $YNH_APP_INSTANCE_NUMBER (equals "1", "2"...) @@ -78,17 +77,13 @@ ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion # INSTALL DEPENDENCIES #================================================= -if [ $phpversion != "none" ] -then ynh_script_progression --message="Installing dependencies..." --weight=2 ynh_install_app_dependencies "php${phpversion}-fpm" -fi #================================================= # STANDARD MODIFICATIONS #================================================= - #================================================= # CREATE DEDICATED USER #================================================= @@ -150,42 +145,7 @@ ynh_script_progression --message="Configuring PHP-FPM..." --time --weight=1 ynh_add_fpm_config --usage=low --footprint=low --phpversion=$phpversion #================================================= -# SPECIFIC SETUP -#================================================= -# ... -#================================================= - -#================================================= -# CREATE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Creating a data directory..." --time --weight=1 - -### Use these lines if you need to create a directory to store "persistent files" for the application. -### Usually this directory is used to store uploaded files or any file that won't be updated during -### an upgrade and that won't be deleted during app removal unless "--purge" option is used. -### If you're not using these lines: -### - Remove the section "BACKUP THE DATA DIR" in the backup script -### - Remove the section "RESTORE THE DATA DIRECTORY" in the restore script -### - As well as the section "REMOVE DATA DIR" in the remove script - -datadir=/home/yunohost.app/$app -ynh_app_setting_set --app=$app --key=datadir --value=$datadir - -mkdir -p $datadir - -# FIXME: this should be managed by the core in the future -# Here, as a packager, you may have to tweak the ownerhsip/permissions -# such that the appropriate users (e.g. maybe www-data) can access -# files in some cases. -# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder - -# this will be treated as a security issue. -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" - - -#================================================= -# SETUP APPLICATION WITH CURL +# SETUP APPLICATION WITH CURL >>> to be removed #================================================= ### Use these lines only if the app installation needs to be finalized through @@ -194,16 +154,16 @@ chown -R $app:www-data "$datadir" ### forms. # Set the app as temporarily public for curl call -ynh_script_progression --message="Configuring SSOwat..." --time --weight=1 +# ynh_script_progression --message="Configuring SSOwat..." --time --weight=1 # Making the app public for curl -ynh_permission_update --permission="main" --add="visitors" +# ynh_permission_update --permission="main" --add="visitors" # Installation with curl -ynh_script_progression --message="Finalizing installation..." --time --weight=1 -ynh_local_curl "/INSTALL_PATH" "key1=value1" "key2=value2" "key3=value3" +# ynh_script_progression --message="Finalizing installation..." --time --weight=1 +# ynh_local_curl "/INSTALL_PATH" "key1=value1" "key2=value2" "key3=value3" # Remove the public access -ynh_permission_update --permission="main" --remove="visitors" +# ynh_permission_update --permission="main" --remove="visitors" #================================================= # GENERIC FINALIZATION diff --git a/scripts/restore b/scripts/restore index d75ea39..f94778b 100755 --- a/scripts/restore +++ b/scripts/restore @@ -32,7 +32,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) + #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -76,25 +76,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# RESTORE THE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Restoring the data directory..." --time --weight=1 - -ynh_restore_file --origin_path="$datadir" --not_mandatory - -mkdir -p $datadir - -# FIXME: this should be managed by the core in the future -# Here, as a packager, you may have to tweak the ownerhsip/permissions -# such that the appropriate users (e.g. maybe www-data) can access -# files in some cases. -# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder - -# this will be treated as a security issue. -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" - #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= @@ -131,20 +112,6 @@ ynh_script_progression --message="Restoring the logrotate configuration..." --ti ynh_restore_file --origin_path="/etc/logrotate.d/$app" -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 - -yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" - -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 - -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index e4a816d..61fcc61 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK VERSION @@ -143,7 +144,7 @@ ynh_add_nginx_config ynh_script_progression --message="Upgrading PHP-FPM configuration..." --time --weight=1 # Create a dedicated PHP-FPM config -ynh_add_fpm_config +ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion #================================================= # SPECIFIC UPGRADE