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:
parent
a4530ddb0f
commit
cc846f64b4
2 changed files with 5 additions and 1 deletions
|
@ -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|\"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|\"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
|
if [ $analytics -eq 0 ]; then
|
||||||
sudo sed -i "s|\"EnableDiagnostics\": true|\"EnableDiagnostics\": false|g" $final_path/config/config.json
|
sudo sed -i "s|\"EnableDiagnostics\": true|\"EnableDiagnostics\": false|g" $final_path/config/config.json
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -51,6 +51,10 @@ sudo rm -f "$archive_filename"
|
||||||
# Restore configuration file
|
# Restore configuration file
|
||||||
sudo cp -f "$backup_config_file" "$config_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
|
# Restore file permissions
|
||||||
sudo chown -R www-data: "$final_path"
|
sudo chown -R www-data: "$final_path"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue