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

scripts: use ynh_add_nginx_config helper

This commit is contained in:
Pierre de La Morinerie 2017-10-10 17:56:45 +05:30
parent a0a9fe6ab7
commit f781efb160
4 changed files with 9 additions and 6 deletions

View file

@ -149,7 +149,8 @@ sudo chown -R www-data: $data_path
# NGINX CONFIGURATION
#=================================================
sudo cp $root_path/conf/nginx.conf-nosub /etc/nginx/conf.d/$domain.d/mattermost.conf
# Copy conf/nginx.conf to the correct location
ynh_add_nginx_config
#=================================================
# SETUP SUPERVISOR
@ -177,4 +178,5 @@ sudo yunohost app ssowatconf
#=================================================
# START APP
#=================================================
sudo supervisorctl reload

View file

@ -39,14 +39,14 @@ ynh_mysql_remove_db "$db_user" "$db_name"
# REMOVE APP MAIN DIR
#=================================================
sudo rm -rf "$final_path"
sudo rm -rf "$data_path"
ynh_secure_remove "$final_path"
ynh_secure_remove "$data_path"
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
sudo rm -f "/etc/nginx/conf.d/${domain}.d/${app}.conf"
ynh_remove_nginx_config
#=================================================
# REMOVE LOG FILE

View file

@ -7,6 +7,7 @@ source /usr/share/yunohost/helpers
ynh_abort_if_errors
# Retrieve arguments
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get mattermost domain)
is_public=$(ynh_app_setting_get mattermost is_public)
@ -58,8 +59,8 @@ sudo sed -i "s|\"FileLocation\": \"/var/log/mattermost.log\"|\"FileLocation\": \
# Restore file permissions
sudo chown -R www-data: "$final_path"
# Update Nginx configuration file
sudo cp -f $root_path/conf/nginx.conf-nosub /etc/nginx/conf.d/$domain.d/mattermost.conf
# Update Nginx configuration
ynh_add_nginx_config
# Start server
sudo supervisorctl start mattermost