Skip to content

Commit 53b7979

Browse files
jaapmarcusAlecRust
andauthored
Fix issue with existing domains not updated (hestiacp#2985)
* Consistent new checkboxes * Fix inputs * Fix issue with values not saving propperly on existing domains * Remove label * Set DNSSEC disable when value issue missing * Update changelog Co-authored-by: Alec Rust <me@alecrust.com>
1 parent fc9738a commit 53b7979

File tree

6 files changed

+39
-17
lines changed

6 files changed

+39
-17
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
99

1010
### Features
1111

12+
- Add support for DNSSEC support for DNS domains (#2938)
1213
- Add support for rate limit exim in packages (#2920)
1314
- Add support for ssh keys for SFTP (#2906)
1415

bin/v-change-dns-domain-dnssec

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ source /etc/hestiacp/hestia.conf
2121
source $HESTIA/func/main.sh
2222
# shellcheck source=/usr/local/hestia/func/rebuild.sh
2323
source $HESTIA/func/rebuild.sh
24+
# shellcheck source=/usr/local/hestia/func/syshealth.sh
25+
source $HESTIA/func/syshealth.sh
2426
# shellcheck source=/usr/local/hestia/func/domain.sh
2527
source $HESTIA/func/domain.sh
2628
# load config file
@@ -57,6 +59,8 @@ if [ -f "$HESTIA/data/queue/dns-cluster.pipe" ]; then
5759
bash $HESTIA/data/queue/dns-cluster.pipe
5860
fi
5961

62+
syshealth_repair_dns_config
63+
6064
# Changing exp
6165
update_object_value 'dns' 'DOMAIN' "$domain" '$DNSSEC' "$status"
6266

func/syshealth.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function syshealth_update_dns_config_format() {
6464
# DNS DOMAINS
6565
# Create array of known keys in configuration file
6666
system="dns"
67-
known_keys="DOMAIN IP TPL TTL EXP SOA SERIAL SRC RECORDS DNSSEC KEY SLAVE SUSPENDED TIME DATE"
67+
known_keys="DOMAIN IP TPL TTL EXP SOA SERIAL SRC RECORDS DNSSEC KEY SLAVE MASTER SUSPENDED TIME DATE"
6868
write_kv_config_file
6969
unset system
7070
unset known_keys
@@ -169,6 +169,19 @@ function syshealth_repair_mail_config() {
169169
done
170170
}
171171

172+
function syshealth_repair_dns_config() {
173+
system="dns"
174+
sanitize_config_file "$system"
175+
get_domain_values 'dns'
176+
prev="DOMAIN"
177+
for key in $known_keys; do
178+
if [ -z "${!key}" ]; then
179+
add_object_key 'dns' 'DOMAIN' "$domain" "$key" "$prev"
180+
fi
181+
prev=$key
182+
done
183+
}
184+
172185
function syshealth_repair_mail_account_config() {
173186
system="mail_accounts"
174187
sanitize_config_file "$system"

web/templates/pages/add_dns.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@
114114
<tr>
115115
<td class="u-pt6">
116116
<div class="form-check">
117-
<input type="checkbox" class="form-check-input" name="v_dnssec" id="v_dnssec" value="yes" <?php if($v_dnssec != 'no'){ echo ' checked'; } ?>>
118-
<label for="v_dnssec" class="form-label"> <?=_('Enable DNSEC');?></label>
117+
<input class="form-check-input" type="checkbox" name="v_dnssec" id="v_dnssec" value="yes" <?php if($v_dnssec === 'yes'){ echo ' checked'; } ?>>
118+
<label for="v_dnssec">
119+
<?=_('Enable DNSEC');?>
120+
</label>
119121
</div>
120122
</td>
121123
</tr>

web/templates/pages/edit_dns.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@
8989
<tr>
9090
<td class="u-pt6">
9191
<div class="form-check">
92-
<input type="checkbox" class="form-check-input" name="v_dnssec" id="v_dnssec" value="yes" <?php if($v_dnssec != 'no'){ echo ' checked'; } ?>>
93-
<label for="v_dnssec" class="form-label"><?=_('Enable DNSEC');?></label>
92+
<input class="form-check-input" type="checkbox" name="v_dnssec" id="v_dnssec" value="yes" <?php if($v_dnssec === 'yes'){ echo ' checked'; } ?>>
93+
<label for="v_dnssec">
94+
<?=_('Enable DNSEC');?>
95+
</label>
9496
</div>
9597
</td>
9698
</tr>

web/templates/pages/list_dns_public.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,34 +61,34 @@
6161
<div class="l-separator"></div>
6262

6363
<div class="l-center units">
64-
64+
6565
<div class="l-unit animated fadeIn">
6666
<div class="l-unit__col l-unit__col--right">
67-
<div class="clearfix l-unit__stat-col--left text-center u-pt18"><b><?=_('DNSKEY record');?></b></div>
68-
<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" value="<?php echo $data[$domain]['RECORD'];?>"></b></div>
67+
<div class="clearfix l-unit__stat-col--left text-center u-pt10"><b><?=_('DNSKEY record');?></b></div>
68+
<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="form-control" value="<?php echo $data[$domain]['RECORD'];?>"></b></div>
6969
</div>
7070
</div>
7171
<div class="l-unit animated fadeIn">
7272
<div class="l-unit__col l-unit__col--right">
73-
<div class="clearfix l-unit__stat-col--left text-center u-pt18"><b><?=_('DS record');?></b></div>
74-
<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" value="<?php echo $data[$domain]['DS'];?>"></b></div>
73+
<div class="clearfix l-unit__stat-col--left text-center u-pt10"><b><?=_('DS record');?></b></div>
74+
<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="form-control" value="<?php echo $data[$domain]['DS'];?>"></b></div>
7575
</div>
7676
</div>
7777
<div class="l-unit animated fadeIn">
7878
<div class="l-unit__col l-unit__col--right">
79-
<div class="clearfix l-unit__stat-col--left text-center u-pt18"><b><?=_('Public key');?></b></div>
80-
<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" value="<?php echo $data[$domain]['KEY'];?>"></b></div>
79+
<div class="clearfix l-unit__stat-col--left text-center u-pt10"><b><?=_('Public key');?></b></div>
80+
<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="form-control" value="<?php echo $data[$domain]['KEY'];?>"></b></div>
8181
</div>
8282
</div>
8383
<div class="l-unit animated fadeIn">
8484
<div class="l-unit__col l-unit__col--right">
85-
<div class="clearfix l-unit__stat-col--left text-center u-pt18"><b><?=_('Key Tag / Flag');?></b></div>
86-
<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" value="<?php echo $flag;?>"></b></div>
85+
<div class="clearfix l-unit__stat-col--left text-center u-pt10"><b><?=_('Key Tag / Flag');?></b></div>
86+
<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="form-control" value="<?php echo $flag;?>"></b></div>
8787
</div>
8888
</div>
8989
<div class="l-unit animated fadeIn">
9090
<div class="l-unit__col l-unit__col--right">
91-
<div class="clearfix l-unit__stat-col--left text-center u-pt18"><b><?=_('Algorithm');?></b></div>
92-
<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" value="<?php echo $algorithm;?>"></b></div>
91+
<div class="clearfix l-unit__stat-col--left text-center u-pt10"><b><?=_('Algorithm');?></b></div>
92+
<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="form-control" value="<?php echo $algorithm;?>"></b></div>
9393
</div>
94-
</div>
94+
</div>

0 commit comments

Comments
 (0)