Explorar el Código

fixes

Add DB pre not working with S3 compatible services.
Cloning site not working with ENV option.
Cristhian Martínez Ochoa hace 2 años
padre
commit
f2e09a24fb
Se han modificado 2 ficheros con 11 adiciones y 9 borrados
  1. 4 2
      lib/bkp
  2. 7 7
      usr/site

+ 4 - 2
lib/bkp

@@ -183,7 +183,8 @@ bkp_local_db() {
 	
 	if [[ -s $destination/$filename ]]; then
 		echo "${gre}Database local backup successfully done!${end}${dim} ($destination/$filename)${end}"
-		[[ -n $bucket ]] && sudo webinoly -backup=s3 -send-to-s3=$destination/$filename -bucket=$bucket
+		[[ -n $s3_compatible_endpoint ]] && local param="-s3-compatible-endpoint=$s3_compatible_endpoint "
+		[[ -n $bucket ]] && sudo webinoly -backup=s3 -send-to-s3=$destination/$filename -bucket=$bucket $param
 		[[ -n $max && $max =~ ^[0-9]+$ ]] && sudo ls -1t $destination | tail -n +$((max+1)) | xargs -d '\n' -I '%' sudo rm -f $destination/%
 	else
 		echo "${red}[ERROR] Database backup failed!${end}"
@@ -304,7 +305,7 @@ bkp_s3_profile() {
 		fi
 		
 		if [[ $(wp_config_read $add_db_pre DB_HOST $subfolder) != "localhost" && -z $(conf_read external-dbu) && -z $(conf_read external-dbp) ]]; then
-			echo "${red}[ERROR] Database host is not localhost!${dim} (External databases are supported with -external-db-save)${end}"
+			echo "${red}[ERROR] Database host is not localhost!${dim} (External databases are supported only when credentials are saved in Webinoly Configuration file)${end}"
 			exit 1
 		fi
 		
@@ -312,6 +313,7 @@ bkp_s3_profile() {
 		[[ -z $max && $destination == "default" ]] && max="5"
 		[[ -n $max && $max =~ ^[0-9]+$ ]] && local param="-max=$max "
 		[[ -n $bucket && $bucket != "true" ]] && local param="${param}-bucket=$bucket "
+		[[ -n $s3_compatible_endpoint ]] && local param="${param}-s3-compatible-endpoint=$s3_compatible_endpoint "
 		[[ -n $subfolder ]] && local param="${param}-subfolder=$subfolder"
 		
 		[[ ! -f $HOME/.duply/$profile/pre ]] && sudo touch $HOME/.duply/$profile/pre

+ 7 - 7
usr/site

@@ -278,13 +278,6 @@ elif [[ -n $on && ! -L /etc/nginx/sites-enabled/$domain && -f /etc/nginx/sites-a
 elif [[ -n $redirection && -f /etc/nginx/sites-available/$domain ]]; then
 	check_for_nginx
 	redirection_manager
-
-
-# WordPress Environment Type
-elif [[ -n $env && -f /etc/nginx/sites-available/$domain ]]; then
-	wp_env_type
-	nginx_not="true" # Nginx-Reload not-needed.
-	# ENV should be always before cache
 	
 	
 # FastCGI Cache
@@ -428,6 +421,13 @@ elif [[ -n $replace_content && -f /etc/nginx/sites-available/$domain ]]; then
 	else
 		wp_replace_content
 	fi
+
+
+# WordPress Environment Type (should be here after cloning site for precedence)
+elif [[ -n $env && -f /etc/nginx/sites-available/$domain ]]; then
+	wp_env_type
+	nginx_not="true" # Nginx-Reload not-needed.
+	# ENV should be always before cache
 	
 
 # List Sites