diff --git a/README.md b/README.md index 3c90205..57cf349 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # YOURLS for YunoHost [![Integration level](https://dash.yunohost.org/integration/yourls.svg)](https://dash.yunohost.org/appci/app/yourls) ![](https://ci-apps.yunohost.org/ci/badges/yourls.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/yourls.maintain.svg) -[![Install yourls with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=yourls) +[![Install YOURLS with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=yourls) *[Lire ce readme en français.](./README_fr.md)* -> *This package allows you to install Yourls quickly and simply on a YunoHost server. +> *This package allows you to install YOURLS quickly and simply on a YunoHost server. If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview diff --git a/scripts/upgrade b/scripts/upgrade index 2b8582b..23b96ac 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -109,11 +109,29 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=4 # Create a dedicated PHP-FPM config ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" +#================================================= +# MODIFY A CONFIG FILE +#================================================= +ynh_script_progression --message="Modifying a config file..." --weight=2 + # Verify the checksum and backup the file if it's different ynh_backup_if_checksum_is_different --file="$final_path/user/config.php" + +sudo cp ../conf/config.php $final_path/user/config.php + +ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/user/config.php" +ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$db_pwd" --target_file="$final_path/user/config.php" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/user/config.php" +ynh_replace_string --match_string="__PATH__" --replace_string="${path_url%/}" --target_file="$final_path/user/config.php" +ynh_replace_string --match_string="__RANDOM__" --replace_string="$(ynh_string_random 24)" --target_file="$final_path/user/config.php" + # Recalculate and store the config file checksum into the app settings ynh_store_file_checksum --file="$final_path/user/config.php" +#================================================= +# SECURE FILES AND DIRECTORIES +#================================================= + # Set right permissions for curl installation chown -R $app: $final_path