diff --git a/scripts/remove b/scripts/remove index 824c632..0099fbd 100755 --- a/scripts/remove +++ b/scripts/remove @@ -68,7 +68,7 @@ ynh_script_progression --message="Removing $app main directory..." --weight=6 # Remove the app directory securely ynh_secure_remove --file="$final_path" -ynh_secure_remove "$data_path" +ynh_secure_remove --file="$data_path" #================================================= # REMOVE NGINX CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index acaab5d..63bc355 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,14 +23,12 @@ ynh_script_progression --message="Loading installation settings..." --weight=2 app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get $app domain) -path_url=$(ynh_app_setting_get $app path) -is_public=$(ynh_app_setting_get $app is_public) -port=$(ynh_app_setting_get $app port) -mattermost_user="$app" - +domain=$(ynh_app_setting_get --app=$app --key=domain) +path_url=$(ynh_app_setting_get --app=$app --key=path) +is_public=$(ynh_app_setting_get --app=$app --key=is_public) +port=$(ynh_app_setting_get --app=$app --key=port) +final_path=$(ynh_app_setting_get --app=$app --key=final_path) root_path="$(pwd)/.." -final_path="/var/www/$app" data_path="/home/yunohost.app/$app" logs_path="/var/log/$app" @@ -135,25 +133,25 @@ ynh_add_systemd_config # SPECIFIC UPGRADE STEPS #================================================= -# Fix log FileLocation path (changed in Mattermost 3.8, makes Mattermost >= 4.2 crash) -# https://docs.mattermost.com/administration/changelog.html#release-v3-8-3 -ynh_replace_string --match_string "\"FileLocation\": \"/var/log/mattermost.log\"" --replace_string "\"FileLocation\": \"/var/log\"" --target_file "$config_file" +# # Fix log FileLocation path (changed in Mattermost 3.8, makes Mattermost >= 4.2 crash) +# # https://docs.mattermost.com/administration/changelog.html#release-v3-8-3 +# ynh_replace_string --match_string "\"FileLocation\": \"/var/log/mattermost.log\"" --replace_string "\"FileLocation\": \"/var/log\"" --target_file "$config_file" -# Move log files to a directory (rather than directly in /var/log) -# See https://github.com/YunoHost-Apps/mattermost_ynh/issues/61 -mkdir -p "$logs_path" -ynh_replace_string --match_string "\"FileLocation\": \"/var/log\"" --replace_string "\"FileLocation\": \"$logs_path\"" --target_file "$config_file" -if [ -f "/var/log/${app}.log" ]; then - mv "/var/log/${app}.log" "$logs_path/" -fi +# # Move log files to a directory (rather than directly in /var/log) +# # See https://github.com/YunoHost-Apps/mattermost_ynh/issues/61 +# mkdir -p "$logs_path" +# ynh_replace_string --match_string "\"FileLocation\": \"/var/log\"" --replace_string "\"FileLocation\": \"$logs_path\"" --target_file "$config_file" +# if [ -f "/var/log/${app}.log" ]; then +# mv "/var/log/${app}.log" "$logs_path/" +# fi #================================================= # RESTORE FILE PERMISSIONS #================================================= -chown -R "$app:www-data" "$final_path" -chown -R "$app:www-data" "$data_path" -chown -R "$app:adm" "$logs_path" +chown -R $app: $final_path +chown -R $app: $data_path +chown -R $app: $logs_path #================================================= # INTEGRATE SERVICE IN YUNOHOST