From 912e3101924b7c5bcfdbcee5faa97724c5e3bf48 Mon Sep 17 00:00:00 2001 From: Hadrien Date: Tue, 2 Nov 2021 12:38:23 +0300 Subject: [PATCH] disable datadir --- scripts/backup | 4 ++-- scripts/install | 28 ++++++++++++++-------------- scripts/remove | 14 +++++++------- scripts/restore | 28 ++++++++++++++-------------- scripts/upgrade | 2 +- 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/scripts/backup b/scripts/backup index de13821..295a5ff 100755 --- a/scripts/backup +++ b/scripts/backup @@ -32,7 +32,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) # db_name=$(ynh_app_setting_get --app=$app --key=db_name) # phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) +# datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -54,7 +54,7 @@ ynh_backup --src_path="$final_path" --is_big # BACKUP THE DATA DIR #================================================= -ynh_backup --src_path="$datadir" +# ynh_backup --src_path="$datadir" #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/install b/scripts/install index e97620c..5b22be1 100755 --- a/scripts/install +++ b/scripts/install @@ -118,7 +118,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port #================================================= # INSTALL NODEJS #================================================= -ynh_script_progression --message="Installing NodeJS..." --weight=2 +ynh_script_progression --message="Installing nodejs..." --weight=2 ynh_install_nodejs --nodejs_version=$nodejs_version @@ -218,7 +218,7 @@ cd $final_path && ynh_exec_warn_less $ynh_npm install #================================================= # CREATE DATA DIRECTORY #================================================= -ynh_script_progression --message="Creating a data directory..." --weight=1 +# ynh_script_progression --message="Creating a data directory..." --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 @@ -228,20 +228,20 @@ ynh_script_progression --message="Creating a data directory..." --weight=1 ### - 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/data -ynh_app_setting_set --app=$app --key=datadir --value=$datadir +# datadir=/home/yunohost.app/$app/data +# ynh_app_setting_set --app=$app --key=datadir --value=$datadir -mkdir -p $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" +# # 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" #================================================= # ADD A CONFIGURATION diff --git a/scripts/remove b/scripts/remove index cb5bda9..a4d9909 100755 --- a/scripts/remove +++ b/scripts/remove @@ -21,7 +21,7 @@ port=$(ynh_app_setting_get --app=$app --key=port) # db_name=$(ynh_app_setting_get --app=$app --key=db_name) # db_user=$db_name final_path=$(ynh_app_setting_get --app=$app --key=final_path) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) +# datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # STANDARD REMOVE @@ -87,12 +87,12 @@ ynh_secure_remove --file="$final_path" # 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..." --time --weight=1 - ynh_secure_remove --file="$datadir" -fi +# # 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..." --time --weight=1 +# ynh_secure_remove --file="$datadir" +# fi #================================================= # REMOVE NGINX CONFIGURATION diff --git a/scripts/restore b/scripts/restore index 5049567..05e5d27 100755 --- a/scripts/restore +++ b/scripts/restore @@ -34,7 +34,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) # db_name=$(ynh_app_setting_get --app=$app --key=db_name) # db_user=$db_name # phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) +# datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -81,21 +81,21 @@ chown -R $app:www-data "$final_path" #================================================= # RESTORE THE DATA DIRECTORY #================================================= -ynh_script_progression --message="Restoring the data directory..." --weight=1 +# ynh_script_progression --message="Restoring the data directory..." --weight=1 -ynh_restore_file --origin_path="$datadir" --not_mandatory +# ynh_restore_file --origin_path="$datadir" --not_mandatory -mkdir -p $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" +# # 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 FAIL2BAN CONFIGURATION @@ -113,7 +113,7 @@ chown -R $app:www-data "$datadir" #================================================= # INSTALL NODEJS #================================================= -ynh_script_progression --message="Reinstalling NodeJS..." --weight=2 +ynh_script_progression --message="Reinstalling nodejs version..." --weight=2 ynh_install_nodejs --nodejs_version=$nodejs_version diff --git a/scripts/upgrade b/scripts/upgrade index f592d97..26f34cc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -118,7 +118,7 @@ chown -R $app:www-data "$final_path" #================================================= # INSTALL NODEJS #================================================= -ynh_script_progression --message="Upgrading NodeJS..." --weight=2 +ynh_script_progression --message="Upgrading nodejs..." --weight=2 ynh_install_nodejs --nodejs_version=$nodejs_version