From a4332f8fcade1362399a24d5d25d98551a0c1238 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 13 Mar 2022 07:23:49 +0100 Subject: [PATCH] remove datadir --- conf/local.yaml | 4 +--- scripts/backup | 7 ------- scripts/install | 14 -------------- scripts/remove | 12 ------------ scripts/restore | 14 -------------- scripts/upgrade | 11 ----------- 6 files changed, 1 insertion(+), 61 deletions(-) diff --git a/conf/local.yaml b/conf/local.yaml index 95d3fcf..4419987 100644 --- a/conf/local.yaml +++ b/conf/local.yaml @@ -6,9 +6,7 @@ security: firewalls: secured_area: kimai_ldap: ~ -kimai: - data_dir: "__DATADIR__" - +kimai: user: registration: __REGISTRATION__ ldap: diff --git a/scripts/backup b/scripts/backup index b86ddbf..86cad22 100755 --- a/scripts/backup +++ b/scripts/backup @@ -31,7 +31,6 @@ 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) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -44,12 +43,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 5ffbe3d..0107276 100755 --- a/scripts/install +++ b/scripts/install @@ -114,20 +114,6 @@ ynh_script_progression --message="Configuring PHP-FPM..." ynh_add_fpm_config phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) -#================================================= -# CREATE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Creating a data directory..." - -datadir=/home/yunohost.app/$app -ynh_app_setting_set --app=$app --key=datadir --value=$datadir - -mkdir -p $datadir - -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" - #================================================= # SPECIFIC SETUP #================================================= diff --git a/scripts/remove b/scripts/remove index e88de1c..9fb39ec 100755 --- a/scripts/remove +++ b/scripts/remove @@ -20,7 +20,6 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) 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) #================================================= # STANDARD REMOVE @@ -40,17 +39,6 @@ ynh_script_progression --message="Removing app main directory..." # Remove the app directory securely 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..." - ynh_secure_remove --file="$datadir" -fi - #================================================= # REMOVE NGINX CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index ab21fbd..c11ade6 100755 --- a/scripts/restore +++ b/scripts/restore @@ -33,7 +33,6 @@ 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) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -73,19 +72,6 @@ chown -R $app:www-data "$final_path" setfacl -dR -m g:"www-data":rwX -m u:$app:rwX "$final_path/var/" setfacl -R -m g:"www-data":rwX -m u:$app:rwX "$final_path/var/" -#================================================= -# RESTORE THE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Restoring the data directory..." - -ynh_restore_file --origin_path="$datadir" --not_mandatory - -mkdir -p $datadir - -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" - #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index e0891ad..626ebdd 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,7 +25,6 @@ db_user=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) random_key=$(ynh_app_setting_get --app=$app --key=random_key) phpversion=$YNH_PHP_VERSION -datadir=$(ynh_app_setting_get --app=$app --key=datadir) registration=$(ynh_app_setting_get --app=$app --key=registration) @@ -67,16 +66,6 @@ if [ -z "$registration" ]; then ynh_app_setting_set --app=$app --key=registration --value=$registration fi -# If datadir doesn't exist, create it -if [ -z "$datadir" ]; then - datadir=/home/yunohost.app/$app - mkdir -p $datadir - chmod 750 "$datadir" - chmod -R o-rwx "$datadir" - chown -R $app:www-data "$datadir" - ynh_app_setting_set --app=$app --key=datadir --value=$datadir -fi - # Cleaning legacy permissions if ynh_legacy_permissions_exists; then ynh_legacy_permissions_delete_all