1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/roundcube_ynh.git synced 2024-09-03 20:16:28 +02:00

Add_config

This commit is contained in:
ericgaspar 2021-08-18 19:07:25 +02:00
parent 1d7cd8bb98
commit 51efcc2604
No known key found for this signature in database
GPG key ID: 574F281483054D44
2 changed files with 8 additions and 27 deletions

View file

@ -124,16 +124,11 @@ ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name
#================================================= #=================================================
# CONFIGURE ROUNDCUBE # CONFIGURE ROUNDCUBE
#================================================= #=================================================
ynh_script_progression --message="Configuring Roundcube..." ynh_script_progression --message="Configuring Roundcube..." --weight=2
rc_conf="$final_path/config/config.inc.php" file="__FILE__"
deskey=$(ynh_string_random --length=24)
cp ../conf/config.inc.php "$rc_conf" ynh_add_config --template="../conf/config.inc.php" --destination="$final_path/config/config.inc.php"
ynh_replace_string --match_string="__DESKEY__" --replace_string="$(ynh_string_random --length=24)" --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"
#================================================= #=================================================
# INSTALL ADDITIONAL PLUGINS # INSTALL ADDITIONAL PLUGINS
@ -214,9 +209,6 @@ ynh_replace_string --match_string="^\s*// installed plugins" --replace_string="&
(cd "$final_path" (cd "$final_path"
/usr/bin/php$phpversion -q ./bin/install-jsdeps.sh) /usr/bin/php$phpversion -q ./bin/install-jsdeps.sh)
# Store the config file checksum into the app settings
ynh_store_file_checksum --file="$final_path/config/config.inc.php"
chmod 400 "$final_path/config/config.inc.php" chmod 400 "$final_path/config/config.inc.php"
chown $app:$app "$final_path/config/config.inc.php" chown $app:$app "$final_path/config/config.inc.php"

View file

@ -152,19 +152,11 @@ ynh_add_fpm_config --package="$extra_php_dependencies"
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Reconfiguring Roundcube..." ynh_script_progression --message="Reconfiguring Roundcube..." --weight=3
rc_conf="$final_path/config/config.inc.php" file="__FILE__"
deskey=$(ynh_string_random --length=24)
# Verify the checksum and backup the file if it's different ynh_add_config --template="../conf/config.inc.php" --destination="$final_path/config/config.inc.php"
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_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"
#================================================= #=================================================
# UPDATE DEPENDENCIES WITH COMPOSER # UPDATE DEPENDENCIES WITH COMPOSER
@ -262,9 +254,6 @@ then
(cd "$final_path" (cd "$final_path"
/usr/bin/php$phpversion -q ./bin/install-jsdeps.sh) /usr/bin/php$phpversion -q ./bin/install-jsdeps.sh)
# Store the config file checksum into the app settings
ynh_store_file_checksum --file="$final_path/config/config.inc.php"
chmod 400 "$final_path/config/config.inc.php" chmod 400 "$final_path/config/config.inc.php"
chown $app:$app "$final_path/config/config.inc.php" chown $app:$app "$final_path/config/config.inc.php"