diff --git a/conf/nginx.conf b/conf/nginx.conf index d8cfae8..f89a679 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -22,7 +22,7 @@ location __PATH__ # on every applicaiton update the name of CSS and JS file is different, # so they can be cache infinitely (here: 30 days) # the root path MUST NOT be cached - if ($uri != '/wekan') + if ($uri != '__PATH__') { expires 30d; } diff --git a/scripts/change_url b/scripts/change_url index 453358f..80fa5af 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -33,6 +33,8 @@ final_path=$(ynh_app_setting_get $app final_path) # Add settings here as needed by your application #db_name=$(ynh_app_setting_get "$app" db_name) #db_pwd=$(ynh_app_setting_get $app db_pwd) +db_name=$(ynh_app_setting_get $app db_name) +port=$(ynh_app_setting_get $app port) #================================================= # CHECK THE SYNTAX OF THE PATHS @@ -98,12 +100,8 @@ fi ynh_print_info "Updating .env configuration..." ynh_systemd_action --action=stop --service_name=$app --log_path="systemd" -ynh_replace_string "__NODEJS_PATH__" "$nodejs_path" "$final_path/.env" -ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/.env" -ynh_replace_string "__DOMAIN_URI__" "$new_domain$new_path" "$final_path/.env" -ynh_replace_string "__PORT__" "$port" "$final_path/.env" -ynh_systemd_action --action=start --service_name=$app --log_path="systemd" --line_match="Finishing add-custom-html-before-body-end migration" -sleep 10 +ynh_replace_string "$old_domain$old_path" "$new_domain$new_path" "$final_path/.env" +ynh_systemd_action --action=start --service_name=$app --log_path="systemd" --line_match="Kadira: completed instrumenting the app" #================================================= # GENERIC FINALISATION diff --git a/scripts/install b/scripts/install index d08fd8f..28e424c 100755 --- a/scripts/install +++ b/scripts/install @@ -101,6 +101,7 @@ ynh_print_info "Installing dependencies..." ynh_print_info "Installing nodejs ..." ynh_install_nodejs 8.15.1 +ynh_use_nodejs ynh_print_info "Installing mongodb dependencies ..." ynh_install_app_dependencies "mongodb mongodb-server" @@ -269,8 +270,7 @@ systemctl reload nginx # START SERVICE #================================================= -ynh_systemd_action --action=start --service_name=$app --log_path="systemd" --line_match="Finishing add-custom-html-before-body-end migration" -sleep 10 +ynh_systemd_action --action=start --service_name=$app --log_path="systemd" --line_match="Kadira: completed instrumenting the app" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index eeba563..3a728d6 100644 --- a/scripts/restore +++ b/scripts/restore @@ -86,6 +86,7 @@ ynh_print_info "Reinstalling dependencies..." # Define and install dependencies ynh_install_nodejs 8.15.1 +ynh_use_nodejs # Install mongodb ynh_install_app_dependencies "mongodb mongodb-server" @@ -128,8 +129,7 @@ systemctl reload nginx # START SERVICE #================================================= -ynh_systemd_action --action=start --service_name=$app --log_path="systemd" -sleep 10 +ynh_systemd_action --action=start --service_name=$app --log_path="systemd" --line_match="Kadira: completed instrumenting the app" #================================================= # END OF SCRIPT diff --git a/scripts/upgrade b/scripts/upgrade index 067e9b3..a72141a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -162,8 +162,7 @@ systemctl reload nginx # START SERVICE #================================================= -ynh_systemd_action --action=restart --service_name=$app --log_path="systemd" -sleep 10 +ynh_systemd_action --action=restart --service_name=$app --log_path="systemd" --line_match="Kadira: completed instrumenting the app" #================================================= # END OF SCRIPT