Просмотр исходного кода

Fixes path for object validation (#5167)

* Fixes path for object validation

Corrects the relative path used to validate the existence of DNS cluster hosts.
The path was off by one directory level, leading to incorrect validation results.
This change ensures that the correct configuration files are checked, preventing potential errors when deleting, suspending, or unsuspending remote DNS hosts.

* Fixes incorrect path for DNS cluster config

Corrects the relative path to the DNS cluster configuration file,
ensuring the script can properly locate and update host suspension status.

* Fix linting
Jaap Marcus 3 месяцев назад
Родитель
Сommit
cd96c03289

+ 1 - 1
bin/v-delete-remote-dns-host

@@ -30,7 +30,7 @@ source_conf "$HESTIA/conf/hestia.conf"
 check_args '1' "$#" 'HOST'
 is_format_valid 'host'
 is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
-is_object_valid "../../conf/dns-cluster" 'HOST' "$host"
+is_object_valid "../../../conf/dns-cluster" 'HOST' "$host"
 
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode

+ 2 - 2
bin/v-suspend-remote-dns-host

@@ -28,8 +28,8 @@ source_conf "$HESTIA/conf/hestia.conf"
 check_args '1' "$#" 'HOST'
 is_format_valid 'host'
 is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
-is_object_valid "../../conf/dns-cluster" 'HOST' "$host"
-is_object_unsuspended "../../conf/dns-cluster" 'HOST' "$host"
+is_object_valid "../../../conf/dns-cluster" 'HOST' "$host"
+is_object_unsuspended "../../../conf/dns-cluster" 'HOST' "$host"
 
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode

+ 2 - 2
bin/v-unsuspend-remote-dns-host

@@ -28,8 +28,8 @@ source_conf "$HESTIA/conf/hestia.conf"
 check_args '1' "$#" 'HOST'
 is_format_valid 'host'
 is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
-is_object_valid "../../conf/dns-cluster" 'HOST' "$host"
-is_object_suspended "../../conf/dns-cluster" 'HOST' "$host"
+is_object_valid "../../../conf/dns-cluster" 'HOST' "$host"
+is_object_suspended "../../../conf/dns-cluster" 'HOST' "$host"
 
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode

+ 1 - 1
func/remote.sh

@@ -171,7 +171,7 @@ remote_dns_health_check() {
 			log_event "$E_CONNECT" "$ARGUMENTS"
 
 			# Suspending remote host
-			dconf="../../conf/dns-cluster"
+			dconf="../../../conf/dns-cluster"
 			update_object_value "$dconf" 'HOST' "$HOST" '$SUSPENDED' 'yes'
 		fi
 	done

+ 1 - 1
install/deb/nginx/nginx.conf

@@ -127,4 +127,4 @@ http {
 	# Wildcard include
 	include                         /etc/nginx/conf.d/*.conf;
 	include                         /etc/nginx/conf.d/domains/*.conf;
-}
+}