diff --git a/conf/nginx.conf-nosub b/conf/nginx.conf similarity index 100% rename from conf/nginx.conf-nosub rename to conf/nginx.conf diff --git a/scripts/install b/scripts/install index 0c1a6d0..694415b 100644 --- a/scripts/install +++ b/scripts/install @@ -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 diff --git a/scripts/remove b/scripts/remove index 68399f6..c469a30 100755 --- a/scripts/remove +++ b/scripts/remove @@ -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 diff --git a/scripts/upgrade b/scripts/upgrade index 7345187..b46b432 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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