From c9f4a58bf065423d8eda9e88d01341d827295b35 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 21 Apr 2021 23:09:56 +0200 Subject: [PATCH] Cleaning up --- check_process | 1 - conf/config.inc.php | 2 +- manifest.json | 2 +- scripts/install | 13 ++++--------- scripts/upgrade | 14 +++----------- 5 files changed, 9 insertions(+), 23 deletions(-) diff --git a/check_process b/check_process index 5499e44..6755534 100644 --- a/check_process +++ b/check_process @@ -14,7 +14,6 @@ upgrade=1 backup_restore=1 multi_instance=1 - port_already_use=0 change_url=1 ;;; Options Email= diff --git a/conf/config.inc.php b/conf/config.inc.php index 2df7dc3..4012e33 100644 --- a/conf/config.inc.php +++ b/conf/config.inc.php @@ -28,7 +28,7 @@ $config = array(); // For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php // NOTE: for SQLite use absolute path (Linux): 'sqlite:////full/path/to/sqlite.db?mode=0646' // or (Windows): 'sqlite:///C:/full/path/to/sqlite.db' -$config['db_dsnw'] = 'mysql://__DB_USER__:__DB_PWD__@localhost/__DB_NAME__'; +$config['db_dsnw'] = 'mysql://__DB_NAME__:__DB_PWD__@localhost/__DB_NAME__'; // The IMAP host chosen to perform the log-in. // Leave blank to show a textbox at login, give a list of hosts diff --git a/manifest.json b/manifest.json index c6064ae..abd990f 100644 --- a/manifest.json +++ b/manifest.json @@ -42,7 +42,7 @@ "en": "Choose the application language", "fr": "Choisissez la langue de l'application" }, - "choices": ["fr_FR", "en_GB", "de_DE"], + "choices": ["de_DE", "en_GB", "fr_FR", "it_IT"], "default": "en_GB" }, { diff --git a/scripts/install b/scripts/install index fd59465..cf9d073 100644 --- a/scripts/install +++ b/scripts/install @@ -123,14 +123,9 @@ ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name ynh_script_progression --message="Configuring Roundcube..." rc_conf="$final_path/config/config.inc.php" +deskey=$(ynh_string_random --length=24) -cp ../conf/config.inc.php "$rc_conf" - -ynh_replace_string --match_string="__DESKEY__" --replace_string="$(ynh_string_random --length=24)" --target_file="$rc_conf" -ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_name" --target_file="$rc_conf" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$rc_conf" -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$rc_conf" -ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$rc_conf" +ynh_add_config --template="../conf/config.inc.php" --destination="$rc_conf" #================================================= # INSTALL ADDITIONAL PLUGINS @@ -181,7 +176,7 @@ then done done - # Do not actualy add the carddav plugin if there's no carddav server available... + # Do not actualy add the cardDAV plugin if there's no carddav server available... if [ $carddav_server -eq 1 ] then installed_plugins+=" 'carddav'," @@ -225,7 +220,7 @@ chown -R root: "$final_path" mkdir -p "$final_path/plugins/enigma/home" chown -R $app: "$final_path/"{temp,logs,plugins/enigma/home} -chmod 600 "$final_path/config/config.inc.php" +chmod 400 "$final_path/config/config.inc.php" chown $app:$app "$final_path/config/config.inc.php" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b83edf7..35a373b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -144,17 +144,9 @@ then ynh_script_progression --message="Reconfiguring Roundcube..." rc_conf="$final_path/config/config.inc.php" + deskey=$(ynh_string_random --length=24) - # Verify the checksum and backup the file if it's different - ynh_backup_if_checksum_is_different "$rc_conf" - - cp ../conf/config.inc.php "$rc_conf" - - ynh_replace_string --match_string="__DESKEY__" --replace_string="$(ynh_string_random --length=24)" --target_file="$rc_conf" - ynh_replace_string --match_string="__DB_USER__" --replace_string=$db_name --target_file="$rc_conf" - ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$rc_conf" - ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$rc_conf" - ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$rc_conf" + ynh_add_config --template="../conf/config.inc.php" --destination="$rc_conf" #================================================= # UPDATE DEPENDENCIES WITH COMPOSER @@ -275,7 +267,7 @@ chown -R root: "$final_path" mkdir -p "$final_path/plugins/enigma/home" chown -R $app: "$final_path/"{temp,logs,plugins/enigma/home} -chmod 600 "$final_path/config/config.inc.php" +chmod 400 "$final_path/config/config.inc.php" chown $app:$app "$final_path/config/config.inc.php" #=================================================