1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mattermost_ynh.git synced 2024-09-03 19:36:29 +02:00
This commit is contained in:
ericgaspar 2021-01-10 21:03:04 +01:00
parent 89f6da98c1
commit 7169b70270
No known key found for this signature in database
GPG key ID: 574F281483054D44
2 changed files with 19 additions and 21 deletions

View file

@ -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

View file

@ -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