ソースを参照

Merge branch 'master' into add_comments

Maniack Crudelis 6 年 前
コミット
846e701632
4 ファイル変更15 行追加2 行削除
  1. 2 0
      scripts/change_url
  2. 6 1
      scripts/install
  3. 2 1
      scripts/remove
  4. 5 0
      scripts/upgrade

+ 2 - 0
scripts/change_url

@@ -57,6 +57,8 @@ nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
 # Change the path in the nginx config file
 if [ $change_path -eq 1 ]
 then
+	# Make a backup of the original nginx config file if modified
+	ynh_backup_if_checksum_is_different "$nginx_conf_path"
 	# Set global variables for nginx helper
 	domain="$old_domain"
 	path_url="$new_path"

+ 6 - 1
scripts/install

@@ -135,6 +135,11 @@ ynh_setup_source "$final_path"
 
 # Create a dedicated nginx config
 ynh_add_nginx_config
+if [ "$path_url" != "/" ]
+then
+	ynh_replace_string "^#sub_path_only" "" "/etc/nginx/conf.d/$domain.d/$app.conf"
+fi
+ynh_store_file_checksum "/etc/nginx/conf.d/$domain.d/$app.conf"
 
 #=================================================
 # CREATE DEDICATED USER
@@ -183,7 +188,7 @@ ynh_add_fpm_config
 ###		- And the section "SETUP SYSTEMD" in the upgrade script
 
 # Create a dedicated systemd config
-ynh_systemd_config
+ynh_add_systemd_config
 
 #=================================================
 # SETUP APPLICATION WITH CURL

+ 2 - 1
scripts/remove

@@ -17,6 +17,7 @@ app=$YNH_APP_INSTANCE_NAME
 
 domain=$(ynh_app_setting_get $app domain)
 db_name=$(ynh_app_setting_get $app db_name)
+db_user=$db_name
 final_path=$(ynh_app_setting_get $app final_path)
 
 #=================================================
@@ -51,7 +52,7 @@ ynh_remove_app_dependencies
 #=================================================
 
 # Remove a database if it exists, along with the associated user
-ynh_mysql_remove_db $db_name $db_name
+ynh_mysql_remove_db $db_user $db_name
 
 #=================================================
 # REMOVE APP MAIN DIR

+ 5 - 0
scripts/upgrade

@@ -83,6 +83,11 @@ ynh_setup_source "$final_path"
 
 # Create a dedicated nginx config
 ynh_add_nginx_config
+if [ "$path_url" != "/" ]
+then
+	ynh_replace_string "^#sub_path_only" "" "/etc/nginx/conf.d/$domain.d/$app.conf"
+fi
+ynh_store_file_checksum "/etc/nginx/conf.d/$domain.d/$app.conf"
 
 #=================================================
 # UPGRADE DEPENDENCIES