1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mattermost_ynh.git synced 2024-09-03 19:36:29 +02:00

Fix logs location

The log location used to be a filename, but it is now a
path since Mattermost 3.8.

Having a path was tolerated in Mattermost <= 4.1, but crashes
the server starting from Mattermost 4.2.0.
This commit is contained in:
Pierre de La Morinerie 2017-10-10 17:04:43 +05:30
parent a4530ddb0f
commit cc846f64b4
2 changed files with 5 additions and 1 deletions

View file

@ -107,7 +107,7 @@ sudo sed -i "s|\"SMTPServer\": \"\"|\"SMTPServer\": \"localhost\"|g"
sudo sed -i "s|\"SMTPPort\": \"\"|\"SMTPPort\": \"25\"|g" $final_path/config/config.json
sudo sed -i "s|\"EnableConsole\": true|\"EnableConsole\": false|g" $final_path/config/config.json
sudo sed -i "s|\"FileLocation\": \"\"|\"FileLocation\": \"/var/log/mattermost.log\"|g" $final_path/config/config.json
sudo sed -i "s|\"FileLocation\": \"\"|\"FileLocation\": \"/var/log\"|g" $final_path/config/config.json
if [ $analytics -eq 0 ]; then
sudo sed -i "s|\"EnableDiagnostics\": true|\"EnableDiagnostics\": false|g" $final_path/config/config.json
fi

View file

@ -51,6 +51,10 @@ sudo rm -f "$archive_filename"
# Restore configuration file
sudo cp -f "$backup_config_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
sudo sed -i "s|\"FileLocation\": \"/var/log/mattermost.log\"|\"FileLocation\": \"/var/log\"|g" "$config_file"
# Restore file permissions
sudo chown -R www-data: "$final_path"