From 74f6c3c44ab557fe3dd54cc223daa0b4f8717fd9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 27 Aug 2021 12:09:03 +0200 Subject: [PATCH] Add enigma by default --- check_process | 1 - manifest.json | 9 --------- scripts/install | 18 +++++------------- scripts/upgrade | 30 +++++------------------------- 4 files changed, 10 insertions(+), 48 deletions(-) diff --git a/check_process b/check_process index fde97b2..399421a 100644 --- a/check_process +++ b/check_process @@ -4,7 +4,6 @@ path="/path" language="en_GB" with_carddav=1 - with_enigma=1 ; Checks pkg_linter=1 setup_sub_dir=1 diff --git a/manifest.json b/manifest.json index e4d446d..fbfe0f2 100644 --- a/manifest.json +++ b/manifest.json @@ -61,15 +61,6 @@ "fr": "Installer le plugin de synchronisation CardDAV ?" }, "default": false - }, - { - "name": "with_enigma", - "type": "boolean", - "ask": { - "en": "Install Enigma messages encryption plugin?", - "fr": "Installer le plugin de chiffrement des messages Enigma ?" - }, - "default": false } ] } diff --git a/scripts/install b/scripts/install index ea34410..02a6bca 100644 --- a/scripts/install +++ b/scripts/install @@ -23,7 +23,6 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH with_carddav=$YNH_APP_ARG_WITH_CARDDAV -with_enigma=$YNH_APP_ARG_WITH_ENIGMA language=$YNH_APP_ARG_LANGUAGE app=$YNH_APP_INSTANCE_NAME @@ -47,7 +46,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=2 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=with_carddav --value=$with_carddav -ynh_app_setting_set --app=$app --key=with_enigma --value=$with_enigma ynh_app_setting_set --app=$app --key=language --value=$language #================================================= @@ -153,7 +151,11 @@ ynh_composer_exec --commands="require \ johndoh/contextmenu $contextmenu_version \ sblaisot/automatic_addressbook $automatic_addressbook_version" -installed_plugins=" 'contextmenu', 'automatic_addressbook'," +installed_plugins+=" 'contextmenu', 'automatic_addressbook', 'enigma'," + +ynh_add_config --template="../conf/enigma.config.inc.php" --destination="$final_path/plugins/enigma/config.inc.php" +mkdir -p "$final_path/plugins/enigma/home" +chown -R $app:$app "$final_path/plugins/enigma/home" # Install CardDAV plugin if [ $with_carddav -eq 1 ] @@ -191,16 +193,6 @@ then fi fi -# Install Enigma plugin -if [ $with_enigma -eq 1 ] -then - ynh_add_config --template="../conf/enigma.config.inc.php" --destination="$final_path/plugins/enigma/config.inc.php" - installed_plugins+=" 'enigma'," || ynh_print_warn --message="Unable to install Enigma plugin" - - mkdir -p "$final_path/plugins/enigma/home" - chown -R $app:$app "$final_path/plugins/enigma/home" -fi - #================================================= # UPDATE ROUNDCUBE CONFIGURATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 1528129..b35e024 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,7 +22,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 with_carddav=$(ynh_app_setting_get --app=$app --key=with_carddav) -with_enigma=$(ynh_app_setting_get --app=$app --key=with_enigma) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) language=$(ynh_app_setting_get --app=$app --key=language) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) @@ -75,17 +74,6 @@ if [ -z "$with_carddav" ]; then ynh_app_setting_set --app=$app --key=with_carddav --value=$with_carddav fi -# If with_enigma doesn't exist, create it -if [ -z "$with_enigma" ]; then - if [ -f "${final_path}/plugins/enigma/config.inc.php" ] - then - with_enigma=1 - else - with_enigma=0 - fi - ynh_app_setting_set --app=$app --key=with_enigma --value=$with_enigma -fi - # If language doesn't exist, create it if [ -z "$language" ]; then language="en_GB" @@ -201,7 +189,11 @@ then johndoh/contextmenu $contextmenu_version \ sblaisot/automatic_addressbook $automatic_addressbook_version" - installed_plugins+=" 'contextmenu', 'automatic_addressbook'," + installed_plugins+=" 'contextmenu', 'automatic_addressbook', 'enigma'," + + ynh_add_config --template="../conf/enigma.config.inc.php" --destination="$final_path/plugins/enigma/config.inc.php" + mkdir -p "$final_path/plugins/enigma/home" + chown -R $app:$app "$final_path/plugins/enigma/home" # Update or install CardDAV plugin if [ $with_carddav -eq 1 ] @@ -239,18 +231,6 @@ then fi fi - # Install Enigma plugin - if [ $with_enigma -eq 1 ] - then - enigma_tmp_config="../conf/enigma.config.inc.php" - - ynh_replace_string --match_string="__DIR__" --replace_string="$final_path/plugins/enigma/home" --target_file="$enigma_tmp_config" - - cp "$enigma_tmp_config" "$final_path/plugins/enigma/config.inc.php" \ - && installed_plugins+=" 'enigma'," \ - || ynh_print_warn --message="Unable to install Enigma plugin" - fi - #================================================= # UPDATE ROUNDCUBE CONFIGURATION #=================================================