Skip to content

Commit 6160219

Browse files
authored
Fix hestiacp#3643: SOA updating on rebuild command from main server (hestiacp#3660)
* Update Cluster DNS on (un)suspend action * Don't update serial on update...
1 parent d26cc7e commit 6160219

File tree

5 files changed

+31
-7
lines changed

5 files changed

+31
-7
lines changed

bin/v-rebuild-dns-domain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
user=$1
1515
domain=$2
1616
restart=$3
17-
update_serial=$4
17+
update_serial=${4-no}
1818

1919
# Includes
2020
# shellcheck source=/etc/hestiacp/hestia.conf

bin/v-rebuild-dns-domains

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# Argument definition
1414
user=$1
1515
restart=$2
16-
update_serial=$3
16+
update_serial=${3-no}
1717

1818
# Includes
1919
# shellcheck source=/etc/hestiacp/hestia.conf

bin/v-suspend-dns-record

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,22 @@ check_hestia_demo_mode
5454

5555
update_object_value "dns/$domain" 'ID' "$id" '$SUSPENDED' "yes"
5656

57+
# Update serial
58+
update_domain_serial
5759
# Updating zone
5860
if [[ "$DNS_SYSTEM" =~ named|bind ]]; then
59-
update_domain_serial
60-
update_domain_zone
61+
# Do full rebuild due DNS SEC
62+
rebuild_dns_domain_conf
63+
fi
64+
65+
# Updating dns-cluster queue
66+
if [ "$DNS_CLUSTER" = "yes" ]; then
67+
# Check for first sync
68+
dlock=$(grep "domain $user $domain" $HESTIA/data/queue/dns-cluster.pipe)
69+
if [ -z "$dlock" ]; then
70+
cmd="$BIN/v-add-remote-dns-record $user $domain $id"
71+
echo "$cmd" >> $HESTIA/data/queue/dns-cluster.pipe
72+
fi
6173
fi
6274

6375
#----------------------------------------------------------#

bin/v-sync-dns-cluster

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ for cluster in $hosts; do
107107
done
108108
if [ "$DNS_CLUSTER_SYSTEM" != "hestia-zone" ]; then
109109
# Rebuilding dns zones
110-
cluster_cmd v-rebuild-dns-domains "$DNS_USER"
110+
cluster_cmd v-rebuild-dns-domains "$DNS_USER" "yes" "no"
111111
check_result $? "$TYPE connection to $HOST failed" "$E_CONNECT"
112112
fi
113113
done

bin/v-unsuspend-dns-record

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,22 @@ is_object_valid "dns/$domain" 'ID' "$id"
5353

5454
update_object_value "dns/$domain" 'ID' "$id" '$SUSPENDED' "no"
5555

56+
# Update serial
57+
update_domain_serial
5658
# Updating zone
5759
if [[ "$DNS_SYSTEM" =~ named|bind ]]; then
58-
update_domain_serial
59-
update_domain_zone
60+
# Do full rebuild due DNS SEC
61+
rebuild_dns_domain_conf
62+
fi
63+
64+
# Updating dns-cluster queue
65+
if [ "$DNS_CLUSTER" = "yes" ]; then
66+
# Check for first sync
67+
dlock=$(grep "domain $user $domain" $HESTIA/data/queue/dns-cluster.pipe)
68+
if [ -z "$dlock" ]; then
69+
cmd="$BIN/v-add-remote-dns-record $user $domain $id"
70+
echo "$cmd" >> $HESTIA/data/queue/dns-cluster.pipe
71+
fi
6072
fi
6173

6274
#----------------------------------------------------------#

0 commit comments

Comments
 (0)